LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behavior when getting data and storing it into a tdms file

Hi

 

I am getting data from a VISA device(10bytes every 20ms) in a string buffer and then using indexing array get each element which is 2 bytes , filtering the data in real time using a butterworth filter and then storing the data to a TDMS.

The problem is that the data goes haywire after a brief the the different elemetns just switch. So for example x becomes resistance, GSR becomes  etc

 

I have uploaded the VI and the TDMS file converted to excel format

Download All
0 Kudos
Message 1 of 2
(2,374 Views)

You really should be writing to the TDMS file while you acquire the data.  By using the Autoindexing Tunnels to build the arrays, you are causing A LOT of memory allocations, which causes things to really slow down.  I would venture to say that you are missing data, causing what looks like a shift in the data.  But you would need to be looking at the error coming out of the VISA Read to know for sure.

 

So look into the Producer/Consumer.  The idea is to use a parallel loop to log the data while your current loop reads and processes the data.  The data is sent to the consumer loop via a queue.


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 2 of 2
(2,336 Views)