11-24-2015 02:18 AM
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
11-24-2015 03:44 AM
You need to show us your code. Without knowing how you are writing the timestamp/data it's virtually impossible to help you.
11-24-2015 03:55 AM
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?
11-24-2015 04:02 AM
You still haven't posted any code. Post your VI or at least a screenshot of it.
11-24-2015 04:10 AM
Screenshot of the code
11-24-2015 04:32 AM - edited 11-24-2015 04:34 AM
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.