LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Forcing 'Read FIFO'/while loop to stop

Hi,

 

Ive got a labview program that fills up a FIFO on the FPGA and I take this data using a vi on the PC. The 'read FIFO' is in a while loop and works fine, the problem im having is when i want to stop reading data. I dont always have data in the FIFO and when this is occuring the while loop pauses until the 'read FIFO' times out.

 

So when i try to stop my while loop I have to wait for the FIFO to time out. I cannot decrease the timeout of the FIFO any more as it needs time to read the data. Is there anyway to force the while loop to stop? or force the read FIFO to finsih so i can continue my while loop and finish it?

 

Thanks,

Mark

0 Kudos
Message 1 of 3
(3,166 Views)

Timeout in fifo indicates "For how much time read funciton should wait for getting the data from DMA".  Wire a timeout value to it so that if there is no data in DMA then it quits the function to execute other portion of the code. This way the loop is not struck within the READ FIFO function if there is not data.

 

Do not leave the timeout terminal unwired coz., default value is -1 which waits for ever!

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 2 of 3
(3,155 Views)
Could you use a "Get Number of Elements to Read" call first to check if there are enough, and if so, read them, otherwise, skip the read and check again in the next loop cycle.  That way you can set the timeout to be smaller.
0 Kudos
Message 3 of 3
(3,148 Views)