From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Target to Host FIFO Issues

I have an FPGA Target VI that collects some sensor data and writes the generated excitation to a FIFO for post processing on the Host VI. Frustratingly, none of the cases are set to write 0 values (decimals yes but the situation in which true 0 arises is extremely rare if not impossible), yet I check the recorded data in MATLAB and see 0's all over the place. I have the bit and word length long enough to support extremely small numbers and know I am not exceeding the upper or lower bound. Under what situations would the buffer write 0 values? I'm at a loss on debugging this issue and want to know if theres a more elegant solution other than just ignoring 0 values. 

 

Thank you.

0 Kudos
Message 1 of 4
(2,511 Views)

Code? It's very hard to properly help otherwise.

0 Kudos
Message 2 of 4
(2,485 Views)

Sorry; attached here.

Download All
0 Kudos
Message 3 of 4
(2,482 Views)

I am guessing you are getting 0 for many of your Pertubation channel.  You have a little bit of a race condition in the fact that you are checking the size of one FIFO and later checking another.  And then there are more samples in the second FIFO.  So when you combine the arrays, any "missing" samples from the first read will be filled in with 0.  You will have the same issue with Sine Out.

 

Why have multiple FIFOs that you need for the same data set?  Put all 3 channels into the same FIFO so that your data will always be in sync.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(2,471 Views)