LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data channel switch in FPGA application

Solved!
Go to solution

Dear all,

 

I am using cRIO 9074 and NI 9234 to collect vibration data with FPGA mode. However, I found the data I collected has some channels switched. For example, I have two NI9234 modules (8 channels). I found first channel sometimes have the data value which should be in channel 8. It happens randomly. And also, the channel swich happens between thounsands of data points collected (sometimes around 50000). I think the switch happens in the Real time VI when I read FPGA data out from FIFO. I used network stream structure to stream data from Real time controller to Host computer. In the host computer vi, I can save the data when I need to. 

 

The screen shot I attached is the among 62123 samples, there are 3 samples shows the other channels' value. 

 

I attached my programs. Hoping anyone here can help me out. Thank you.

Download All
0 Kudos
Message 1 of 18
(3,313 Views)

Hi.

 

I think I've the same problem. The data switching change constantly during execution time? Try to read elements in number that is divisibly by the number of channels.

 

BJoa.

0 Kudos
Message 2 of 18
(3,300 Views)

Hi, Thank you for the reply. In the real time VI, I read the elements number equals the samples per channel times the channel numbers. It did not happens periodically actually. 

0 Kudos
Message 3 of 18
(3,298 Views)

Then you've the same problem? http://forums.ni.com/t5/LabVIEW/myRIO-FIFO-Data-Switching/td-p/3083894

 

I tried everything and didn't figure out the reason.

 

BJoa.

0 Kudos
Message 4 of 18
(3,293 Views)

My channel switch is almost invisible from the the screen. You can only find it on the data that was collected. However, when you watch the indicator, the value jumped to other channel in less than one second, then it jumped back. 

0 Kudos
Message 5 of 18
(3,287 Views)

Can you make a VI Snippet where you read the buffer? I solve that problem reading the number of elements divisible by 4 (I've 4 channels) and leaving the remainder on the buffer.

 

RT Processing.png

 

BJoa.

0 Kudos
Message 6 of 18
(3,282 Views)

Here it is. I will try your way to read the data. See what will happen. 

0 Kudos
Message 7 of 18
(3,276 Views)
Solution
Accepted by zwfjames

Think see your problem. The "Greater or Equal" don´t ensure that the number of elements is divisible by 8. The way I will doing this is check the number the elements on the buffer, divide by 8 and verify if the reamainder is not equal zero, if true read the number of elements minus reminder, if false read the number of elements per se.

0 Kudos
Message 8 of 18
(3,260 Views)

Yes, I think your way solved the previous problem. However, the same problem you posted in the link also happened to me. The channel constantly switched. 

0 Kudos
Message 9 of 18
(3,250 Views)

Why do you need the compare or select?  Just subtract the remainder from the dividend.  (what happens when you subtract 0 from a number?)


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 18
(3,241 Views)