Showing results for 
Search instead for 
Did you mean: 

DAQmx Read and/or TDMS problem

Go to solution



Recently I changed a series of Case Structures into a more efficient Event Structure. However, I  am no longer able to acquire voltage signals from 4 Analog Input terminals (NI-USB6251) with DAQmx Read and store them as a TDMS files. The code responsible for this is in Task 8 ("Start Current Scan") of the Event Structure of the code attached.


At first I thought I was calculating the "timeout" or "number of samples per ch" incorrectly. However, even when I set them to contant, large values DAQmx Read does not seem to run and upon stopping the program the TDMS File Viewer is empty. One thing I did change was moving TDMS Close into the Event Structure when it used to be outside of the large while loop previously. Could this be causing me trouble?





0 Kudos
Message 1 of 2
Accepted by topic author AlfredoT

Hello Alfredo,


You sure do have a lot of code here.  When you close the TDMS reference in your loop, the next loop iteration will have an invalid reference and so nothing will be written to file.  Make sure to always close your references outside of your loops.  

Field Engineer
0 Kudos
Message 2 of 2