LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data shifting in Target to Host FIFO when written to TDMS (LavVIEW 2015)

I am reading values from a NI 9205 module on a cRIO-9068. When I read the values and display them in the front panel for the FPGA VI everything looks correct. When I look at the values on the Host side the values shift around. An example of the TDMS file and the shifting is included below. All values are constant and shouldn't be shifting between rows: 

 

Capture.PNG

0 Kudos
Message 1 of 15
(3,617 Views)

It is impossible to debug a picture of a spreadsheet.  Attaching a VI of your code, that would help in debugging.

 

My guess is that you are missing data in the FIFO.  Perhaps it filled up before you had a chance to read it.  Pure speculation at this point.

0 Kudos
Message 2 of 15
(3,609 Views)

I have attached the two VI's valve_status.vi reads from the aio block and writes to the FIFO file. test_stand.vi reads from the FIFO and writes to the TDMS file

Download All
0 Kudos
Message 3 of 15
(3,605 Views)

You should include your entire project as a zipped up file since the project file contains a lot of the details about the FPGA and its FIFO's.

 

Something is odd.  Your "Valve-status.vi" just runs once and stops.  It doesn't have a loop.  Is there another bit of code that runs on the FPGA that has a loop that calls this?

0 Kudos
Message 4 of 15
(3,596 Views)

Hi Yes, there is a "data capture.vi" that handles running each of the subvis, the idea was to have one vi control the timing and then subvi's for collecting / converting data

0 Kudos
Message 5 of 15
(3,593 Views)

Try monitoring the number of elements in you FIFO as your program runs to see if it is continually growing.

 

A couple of comments.

1.  Most of your flat sequence structure is unneeded.  (Perhaps all of it.)

2.  I don't understand all of the array to matrix to array manipulation you are doing before writing to a TDMS.  No need to convert to a matrix at all.

 

0 Kudos
Message 6 of 15
(3,532 Views)

Hi, 

 

I am aware most of it is probably unneeded but as this is my first experience with labview (background as an embedded sw engineer) I am using it to keep things straight in my head. Once working I will go back and remove what isn't necessary. 

 

The conversions are there because I couldn't get the 1D array written to the TDMS file without the use of this and the standard transpose I found on the forums didn't work.

0 Kudos
Message 7 of 15
(3,530 Views)

You can't transpose a 1-D array.  You can only transpose a 2-D array.  You can turn a 1-D array into a 1xN 2-D array.  (1 row by N columns) by using the Build Array function, then transpose that into a Nx1 (N rows by 1 column) 2-D array.  (See top half.)

 

test_stand_BD

0 Kudos
Message 8 of 15
(3,528 Views)

Hi, 

 

I made this update and was able to remove all of the unneeded transform functions but the problem with the time-stamp field moving through the data (column shifting) is still occurring. 

0 Kudos
Message 9 of 15
(3,522 Views)

I think I have made a bit of headway, if I lower the time I wait between checks on the Host side to not having any it seems to stay correct for longer until things get out of sorts. 

 

This leads me to believe it is an issue with TDMS file output not being able to keep up with how fast I need to be polling the data. Does anyone know of a way to buffer the polled data from the FIFO until either the end of program execution or to write/flush to disk at a slower pace? 

0 Kudos
Message 10 of 15
(3,520 Views)