LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA queue keeps pushing data but RT doesnt read the queue

I work for a company where we use CRIO 9041's for a product where we collect high speed data on FPGA, push that data to an FPGA queue and then read the data, average it with a moving window in the RT to be used for processing. 
Code PIC is attached. 
In the FPGA code, we write 9 readings one by one in the queue and then on the RT read side, we read them 9 elements at a time.
In the FIFO read, the RT completely stops reading the queue, and even the log VI doesnt log anything. We just see the elements remaining start going up to more that like 15000 elements and then the queue times out. 
Seems like the RT totally stops reading from the quque. Almost like the RT dies. 
Then when the fpga queue starts being read again, there is always one element in the queue remaining because of which our read of 9 sensors is shifted by one. So the code with the  feedback loop was added as a temporary solution to shift our read of 9 elements when the elements remaining is non zero.
All of this is random as the system is idle.

CodePicForForumQuestion.png

0 Kudos
Message 1 of 4
(484 Views)

I went through your post. But my problem is different.
The code was running and elements remaining were 0 always. We didnt make any code change and found our array of 9 elements shifted. With more digging we found that while mid operation, the elements ramaining had a 1. We found that the RT kind of literally spept and because RT was not reading anything from he FPGA queue, it started backing up. And then after about 110 seconds, the whole thing resets and the elements remaining goes to 1. It seems like the FPGA kept going but the RT totally stopped running. The reason I am saying that is because the logger right after the FPGA queue read has nothing that can block it, but even the logger didnt log anything. Also the error from the logging vi is just passed, so even if the FPGA queue read has an error, the logger should still log something.

kapoor7997gmailcom_0-1708542414211.png

 

So this logging VI should log something even if there is error. But the logging VI didnt even elecute for those almost 2 minutes.
Look at this elements remaining log file.

ElementsRemaining.png

 

So right before the elements remaining starts going up, the logging vi doesnt execute for almost two minutes. Almost like RT died.

And when it recovers there is one element in the queue which shifts my data array read of 9 elements. and I see my 9th value from last fifo data being read as the first element of the current read.  in the line 227398 in the following pic.

DataBeforeAdjSwitched.png

What we are trying to find out is what can cause the Logging Vi itself to no execute. Did the RT die and FPGa kept going

0 Kudos
Message 3 of 4
(419 Views)

I see one possible issue.

You read "Current elements in queue" plus 9.

If your buffer gets to be nearly full, i.e. less than 9 elements empty, you essentially request more data than your buffer can hold. This might lead to some unexpected issues.

I would suggest maybe first reading N elements (making sure to always read multiples of 9) and THEN request the NEXT 9.

0 Kudos
Message 4 of 4
(390 Views)