08-06-2015 04:59 AM
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
08-06-2015 06:58 AM
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.