Distributed Control & Automation Framework (DCAF)

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS Datalogger plugin is getting zero data at the end of tdms file

hi,

 

I am still new to the DCAF framework and I was trying out the TDMS datalogger plugin. I was trying to see if I can just log my data every 3 seconds. This is using the DCAF handson as an example. Since I cannot find a way to log to file every 3 seconds in the TDMS datalogging plugin, I set the timing dt = 3000 in the primary configuration for the simulation engine. Once I run the main program and stop, I took a look at the TDMS file and it is showing some zero data appended at the end of the TDMS file as shown in the screen capture attached. When I set the dt = 1000, this does not happen. I am guessing that the TDMS datalogger module is still trying to log data which is already cleared. I am not sure if this is the correct way to specify the logging interval, so please let me know if there is a better way to specify logging interval. Thanks.

 

Rando

Download All
0 Kudos
Message 1 of 4
(5,235 Views)

The TDMS data issue is documented in https://github.com/LabVIEW-DCAF/TDMSModule/issues/18

Put simply, the advanced TDMS api requires a pre-defined number of samples for each channel, so if the system exits before reaching this count it puts 0s for timestamps (you can safely filter out any row with a 0 timestamp, and by zero I mean the 1904 date)

 

As for timing, because the loop runs at a single rate you basically have to define a loop rate and decimation. So if you wanted to perform control actions at 10 Hz but log at 1 Hz, you'd set your engine to run every 100 ms but on the module configuration tab, set the TDMS module to run decimated by a factor of 10.

0 Kudos
Message 2 of 4
(5,201 Views)

Thanks smithd as that's what I need.  For the benefit of others here is the configuration required for decimation factor for 3 seconds. I just changed the value to 30 in the decimation. The primary configuration timing dt = 100. Capture.JPG

Another question, the sample time is stored at the last column instead of the first column. Is there an easy to change this to the first column? If not, it looks like I will need to go to the TDMS datalogger module and change this in the TDMS datalogger runtime.lvclass:configure tdms channels.vi and TDMS datalogger runtime.lvclass:write cache to tdms.vi.

 

 

0 Kudos
Message 3 of 4
(5,191 Views)

I don't believe that there is a way to re-order the columns without modifying the source code.

 

Do you think this feature could be helpful to others? If so, if you can find a way to bubble those options up to the configuration editor node UI without impacting performance, you could add this option without creating your own unique branch of the code. You could then submit those changes as a pull request back to the github repository so that you can continue to benefit from new improvements to the module. Feel free to message me directly if this is something you are interested in, and I can share more details.

0 Kudos
Message 4 of 4
(5,182 Views)