07-17-2025 11:30 AM
I'm trying to do a simple DAQmx acquisition task w/ logging to a TDMS file. My program is basically identical to the 'Voltage - Continuous Input.vi' example; but with the addition of scanning at two separate rates. When configuring 'DAQmx Configure Logging (TDMS)' if I use 'Open or Create' I get the data from both scan rates in the TDMS file. However, if I use 'Create or Replace' I only get the data from the second scan rate in the TDMS file and the first scan rate data goes missing. - In both cases the vi is creating a new TDMS file, not opening an existing file.
I can work around this by doing some file manipulation ahead of calling DAQmx Configure Logging (TDMS), but seems like a bug or at least odd behavior that should be explained in documentation. - Took me a long time to figure out why sometimes I had data loss.
Can anyone explain this behavior from 'DAQmx Configure Logging (TDMS).vi'
Solved! Go to Solution.
07-17-2025 02:21 PM
Hi djb,
@djb wrote:
I'm trying to do a simple DAQmx acquisition task w/ logging to a TDMS file. My program is basically identical to the 'Voltage - Continuous Input.vi' example; but with the addition of scanning at two separate rates.
How can one DAQmx task scan at two different sample rates??? Maybe showing your code might help…
@djb wrote:
When configuring 'DAQmx Configure Logging (TDMS)' if I use 'Open or Create' I get the data from both scan rates in the TDMS file. However, if I use 'Create or Replace' I only get the data from the second scan rate in the TDMS file and the first scan rate data goes missing. - In both cases the vi is creating a new TDMS file, not opening an existing file.
In case you have two tasks then using "create or replace" the 2nd task might replace the TDMS file of the 1st one - just a possible explanation for the behaviour you see…
07-17-2025 03:12 PM
To answer the question asked by GerdW, I'm stopping a higher rate acquisition and then starting a slower rate one.
As suggested, I've uploaded a snippet of the code; and in the zip file is the VI itself along with the TDMS files it produced. The only difference between settings for the two TDMS file results is that in one case the operation input was set to 'Create or Replace' and in the other to 'Open or Create'; and as I mentioned earlier in both cases a new TDMS file was created.
07-18-2025 12:46 AM
Hi djb,
@djb wrote:
As suggested, I've uploaded a snippet of the code;
Thanks!
As I wrote before: with "Create or Replace" the TDMS file will be "created or replaced" (as requested by YOU) whenever you start the task using DAQmxStart!
Using the "Open or Create" mode will reuse an already existing TDMS file with the 2nd DAQmxStart call…
Why do you wonder about this behaviour?
07-21-2025 08:14 AM
What GerdW suggests, that the call to 'DAQmx Start Task.vi' initiates writing the TDMS file does appear to be the behavior. So calling it a second time initiates either a replacement or re-open depending on the option selected in 'DAQmx Configure Logging'.
I'd like to add that there is a the lack of documentation on this topic... The only help available for DAQmx Start Task.vi says basically sometimes you need it sometimes you don't...nothing more. Why can we get detailed help on things like the simple error handler, and zero detailed help or other documentation on any of the DAQmx vi's? Do I just not know where to look?
07-21-2025 08:17 AM - edited 07-21-2025 08:18 AM
Hi djb,
@djb wrote:
What GerdW suggests, that the call to 'DAQmx Start Task.vi' initiates writing the TDMS file does appear to be the behavior. So calling it a second time initiates either a replacement or re-open depending on the option selected in 'DAQmx Configure Logging'.
I'd like to add that there is a the lack of documentation on this topic...
The relevant help in with DAQmxConfigureLogging:
So "Create or replace" will replace the file when it already exists…