LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extra empty groupName in TDMS file when using DAQmx Start New File & stop DAQmx while waiting for trigger?

I wrote a VI that listens to an external trigger coming from a PFI line and saves a user-defined number of pretrigger+posttrigger samples into disk, and then the DAQmx restarts to wait for the next trigger. I used the DAQmx Start New File.vi to change the filename of each of the next file. However, I found that for each of the resulting TDMS files, there is an additional group that is added in addition to the real data. For example, if the groupName is set to "task_voltage", then there is an additional groupName called "task_voltage #1".

 

I suspect that this is because the program preallocate diskspace using the old filename for the pretriggered samples, but when the trigger happens and the samples are ready to be written into disk, an actual new file is opened and saved. The reason I think this might be the case is because, say each file would be 50kB and I already have 1 file triggered and saved, before the second trigger comes in, I can see that the file size of the first file is twice as much as it should be (100kB), but the file size will return to noraml (50kB) after the second trigger happens and a second file is created.

 

Does anyone know if this is really the case? Is there a way to configure the task so that this doesn't happen?

 

Another question I have is that the program currently set up so that the VI will wait until a trigger happens to return the values. However, this means that if a trigger doesn't happen, the VI waits indefintely, and the "stop" button in the while loop is useless. I have to use the "Abort Execustion" button on the tool bar to stop the VI. Is there a way to interrupt and stop the DAQmx task even if the trigger doesn't happen?

 

Thanks in advance for any help!

 

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

I will try to reproduce the file size discrepancy and let you know what I find

Applications/Systems/Test
National Instruments | AWR Group
0 Kudos
Message 2 of 6
(3,159 Views)

Thanks so much. Please let me know what you find!

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

I believe you are correct in regards to the TDMS file write. As for stopping your vi take a look at the link below, I believe this will solve your issue

 

http://www.ni.com/example/25432/en/ 

Applications/Systems/Test
National Instruments | AWR Group
0 Kudos
Message 4 of 6
(3,135 Views)

Thanks! Do you know then if there is anyway to take out the extra groupName in the TDMS file? It's just annoying to see NoValue in that empty group...

 

Also thanks for the link to the example. I will give this a try and report back. I am slightly worried about whether the user might be trying to trigger during the short time before the DAQmx is restarted. Do you know of any measure of this delay/gap?

 

Thanks a lot!

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

I don't believe there is a way to programmatically change/delete the group name in a TDMS file. What you can do however, is convert between TDMS and TDM using the VIs found in the Data Storage palette and then perform whatever modifications you need using the TDM utilities.

Applications/Systems/Test
National Instruments | AWR Group
0 Kudos
Message 6 of 6
(3,110 Views)