LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timing problem in tdms read when replotting data.

Hi Everyone,

 

          I am new to programming with labview and have gone through a ton of examples, and scoured the internet for a solution but with no success.

 

         I am using NI9205 to acquire analog signals, but the signal is too noisy and therefore we have to take the average of the data. I then want to log the averaged "clean" data to a file to be looked at later, and am using TDMS. The data logs with no problem, but when I go to re-graph the data the time stamp (x axis) of the graph is incorrect...

 

          I have tried adding a timestamp to the data saved, but have gotten an error "Error -2525 occurred at TDMS Read in Log Viewer.vi LabVIEW:  TDMS file data could not be converted into the specified data type."

 

          Saving the noisy data to TDMS file results in the timestamp being ok! Is there a way to process the noisy data when re-opening it? I read somewhere to try converting to WDT, but can not figure out how to do this... Any help is much appreciated... I attached pictures of my current acquire and display codes...

 

Acquire.JPG

 

Read.JPG

 

0 Kudos
Message 1 of 3
(2,424 Views)

Bolvangus,

 

I have a possible workaround to suggest. We can break apart the data from the DAQ signal by using Convert From Dynamic Data and Get Waveform Components. From this, we will have direct access to the value, the original timestamp, and the change in time from the original timestamp. Next, we can calculate the correct timestamp by adding the change in time to the original (this will require a bit of math in your code since dt represents the time between pulses, not averages) and use a Mean VI (instead of the Statistics Express VI) to average the Y values. Try writing to your TDMS file in this way and let us know how that solution works.

 

KyleP

KyleP
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,369 Views)

  I have tried adding a timestamp to the data saved, but have gotten an error "Error -2525 occurred at TDMS Read in Log Viewer.vi LabVIEW:  TDMS file data could not be converted into the specified data type."

 

  You can use "TDMS Set Properties" to reset the time info property of the channel. The property "wf_start_time" will indicate the start logging time.


 Capture.PNG

          Saving the noisy data to TDMS file results in the timestamp being ok! Is there a way to process the noisy data when re-opening it? I read somewhere to try converting to WDT, but can not figure out how to do this... Any help is much appreciated... I attached pictures of my current acquire and display codes...

 

You can use the "TDMS Create Scaling Information.vi" Capture2.PNG to create some scalers on the channel, and the TDMS dll will scale and return the data based on the scalers when you read the data.(backup the original file first, don't support remove scaler so far) What kind of scalers should be set on it depends on your needs.


Or you can read out all the data as double array and process the noisy double array.


 

0 Kudos
Message 3 of 3
(2,360 Views)