LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get correct data from FIFO

Hi,

 

I am performing a test wherein I intend to register the time for which a certain valve remains open (theoratically less than 1 sec) and plot a graph of parameters related to this valve. The time for which the valve remains open will form the X-axis.

 

Since the test happens very fast, I will not be able to plot a graph in real time. For this I intend to record the test parameters in a text file on my cRIO and then use it later . I run the code to calculate the time on the FPGA.

 

I am using a FIFO on the FPGA as I intend on not missing any of the time values when plotting the graph.

 

I have attached the jpg of the FPGA code created (Fifo.jpeg).

 

The FPGA loop runs at 10ms.

 

The problem occurs when I am trying to read the values on the RT side (pls refer RTcode.jpeg).

This code is running inside  loop of 100ms.

 

I think that my method of retrieving the data from the FIFO is wrong.

 

Can there be another solution to this? 

Download All
0 Kudos
Message 1 of 3
(2,781 Views)
Why use Write to file and increase the loop time. You can directly read the data from FIFO and analyze it. Well I can't see whats there down in your RT code screen shot so cant say much about why the loop time is 100ms.
Message Edited by Shreyas on 09-07-2009 12:55 PM
Shreyas Hebbare
Shreyas Technologies
India
0 Kudos
Message 2 of 3
(2,708 Views)

Since the file write operation is within the read loop, the File write operation will determing the entire loop time.  If file operation takes slightly longer time then loop will run longer than expected.

 

Also there is a query for file size within the loop which will lead to querying the file size for each iteration which will also increase loop time.

 

In general Operations like file write which affect the determinism of the RT loop should be placed in a parallel loop and queues can be used to pass the data to that loop.

 

So, remove the file operation, query of file size from that loop and substitute a Queue in that place and place the file write in a seperate parallel loop.

 

post back for queries.

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 3 of 3
(2,701 Views)