11-17-2013 07:30 PM - edited 11-17-2013 07:39 PM
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!
11-18-2013 05:47 PM
I will try to reproduce the file size discrepancy and let you know what I find
11-18-2013 08:54 PM
Thanks so much. Please let me know what you find!
11-19-2013
05:00 PM
- last edited on
06-04-2025
10:15 AM
by
Content Cleaner
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/
11-19-2013 05:25 PM
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!
11-20-2013 04:17 PM
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.