LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tdms time error

Hi,

 

         I need to write the time stamp for every 500 ms to tdms file. I'm able to write the data every 500ms (120 points) but the time stamp value is 967. How do i write the time stamp to tdms exactly at 500 ms

0 Kudos
Message 1 of 6
(3,298 Views)

You need to show us your code. Without knowing how you are writing the timestamp/data it's virtually impossible to help you.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 6
(3,277 Views)

Hi,

 

           Code is simple the basic Tdms write VI. But i need the time stamp value to log at every 500ms. If i use a tdms viewer the data points and time stamp should be the same. Any ideas?

0 Kudos
Message 3 of 6
(3,273 Views)

You still haven't posted any code. Post your VI or at least a screenshot of it.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 6
(3,263 Views)

Screenshot of the code

0 Kudos
Message 5 of 6
(3,259 Views)

Ok, you should have posted the VI because you've cut off the bottom loop - is there any execution timing in that loop or does it run at the maximum rate your CPU will allow? You are repeatedly building an array which means your VI will continue to grow in memory until either you stop it or the application crashes.

 

It will probably cause the loop to take longer and longer to run which is why your timestamps are not 500ms.

 

Why are you writing to the data *after* the loop finishes running? If you wrote the data to the TDMS file inside the loop (open the file before the loop, write inside the loop and then close it outside the loop) then you wouldn't need to keep all that data in memory - it would get flushed to disk.

 

The TDMS Write VI allows you to write multiple channels of data at a time, you don't need the second for loop.

 

As your timing is on windows, you will not be able to get 'exactly' 500ms timestamps - depending on how that bottom loop runs it might be off by a few milliseconds.

 

I also can't see where your data actually comes from - you might want to have a look at the producer/consumer (data) architecture from the examples.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 6 of 6
(3,246 Views)