Writing TDMS Data From Multiple DAQmx Read Functions

Updated Nov 16, 2020

Environment

Software

  • Measurement & Automation Explorer (MAX)

Driver

  • NI-DAQmx

Since data is stored in a TDMS file based on the input channel name, all channel names must have a unique reference when you write data to a TDMS file. This can cause an issue when using multiple DAQmx Read functions, for example. There are two ways to resolve this issue. 

Renaming Task Channels

Give each channel in each task a unique name in Measurement & Automation Explorer.

  1. Open Measurement & Automation Explorer.
  2. Expand Data Neighborhood.
  3. Expand NI-DAQmx Tasks.
  4. Click on your task for card A.
  5. In the Channel Settings Tab, right-click on each channel and select rename.
  6. Add an 'a' to the end of each channel, as shown in the figure below.
  7. Save the task for card A.
  8. Click on your task for card B.
  9. In the Channel Settings Tab, right-click on each channel and select rename.
  10. Add a 'b' to the end of each channel.
  11. Save the task for card B.
  12. Now that the channel names are unique, all channels will write properly into your TDMS file.
 

Multiple TDMS Write Functions

Write to the same TDMS file with two write VIs, as shown below.  If this method is used, you must create a unique group name for each write VI, as shown below.  Since we have set the group names as 'Card A' and 'Card B,' the write to TDMS VI can now differentiate between same-named channels.