09-03-2009 10:35 AM
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?
09-07-2009 02:25 AM - edited 09-07-2009 02:25 AM
09-07-2009 03:02 AM
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.