TDMS Write Function

LabVIEW 2018 Help


Edition Date: March 2018
Part Number: 371361R-01
View Product Info

DOWNLOAD (Windows Only)


LabVIEW 2016 Help
LabVIEW 2017 Help
LabVIEW 2018 Help
LabVIEW 2019 Help
LabVIEW 2020 Help

Owning Palette: TDM Streaming VIs and Functions

Requires: Base Development System

Copyright: (c) 2018 National Instruments. All rights reserved.

Streams data to the specified .tdms file. The data subset to write is determined by the values you identify in the group name in and channel name(s) in inputs.

Examples

data layout specifies the arrangement of the data that you want to stream to a .tdms file. You must use the same data layout for each channel under the same group.

0decimated (default)—Specifies that the input data prioritizes channels before samples. This arrangement first lists all samples from the first channel, then all samples from the second channel, and so on through the last channel. The following table shows a typical example of the decimated data layout.

Channel 0—Sample 1
Channel 0—Sample 2
...
Channel 0—Sample N
Channel 1—Sample 1
Channel 1—Sample 2
...
Channel 1—Sample N
Channel 2—Sample 1
Channel 2—Sample 2
...
Channel 2—Sample N
1interleaved—Specifies that the input data prioritizes samples before channels. This arrangement lists the first sample from every channel, then the second sample from every channel, and so on through the last sample from every channel. The following table shows a typical example of the interleaved data layout.

Channel 0—Sample 1
Channel 1—Sample 1
Channel 2—Sample 1
Channel 0—Sample 2
Channel 1—Sample 2
Channel 2—Sample 2
...
Channel 0—Sample N
Channel 1—Sample N
Channel 2—Sample N
tdms file specifies a reference number to the .tdms file on which to perform the operation. Use the TDMS Open function to open the refnum.
group name in specifies the channel group on which to perform the operation. The default is Untitled.
channel name(s) in indicates the channels on which to perform the operation. If you do not wire data to this input, LabVIEW names the channels automatically. If you wire waveform data to the data input, LabVIEW uses waveform names. The data type that the channel name(s) in input accepts can be a string or a 1D array of strings. The data type varies according to the data you wire to the data input.

String String or 1D Array of Strings 1D Array of Strings
Analog waveform

1D array of alphanumeric strings that do not contain null characters
1D array of:
  • Signed or unsigned integers
  • Floating-point numbers
  • Timestamps
  • Booleans
Note  If data layout is decimated and you wire a 1D array of strings to channel name(s) in, this VI uses the first element of the 1D array as the channel name.

If data layout is interleaved and you wire a string to channel name(s) in, this VI uses this string as the channel name of the first element in the 1D array and uses Untitled, Untitled1, Untitled2...as the channel names of the rest elements.
Digital waveform

Digital table

1D array of analog waveforms

2D array of:
  • Signed or unsigned integers
  • Floating-point numbers
  • Timestamps
  • Booleans
  • Alphanumeric strings that do not contain null characters


If the data input contains compressed digital data, you must enter the name of the compression channel as the first entry in the channel name(s) in array.
data is the data to write to the .tdms file. This input accepts the following data types:
  • Analog waveform or a 1D array of analog waveforms
  • Digital waveform
    Caution  When you write analog or digital waveforms to a new channel, LabVIEW includes the timestamp information in the waveforms. However, when you append analog or digital waveforms to an existing channel, LabVIEW might discard the timestamp information in the new waveforms.
  • Digital table
  • Dynamic data
  • 1D or 2D array of:
    • Signed or unsigned integers
    • Floating-point numbers, including the following specific data types:
      • Single-precision and double-precision floating-point numbers
      • Complex single-precision and double-precision floating-point numbers
      • (Windows) Extended-precision floating-point numbers
    • Timestamps
    • Booleans
    • Alphanumeric strings that do not contain null characters
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
tdms file out returns a TDMS file reference to the .tdms file on which you performed the operation.
group name out returns the name of the channel group on which you performed the operation.
channel name(s) out returns the channel name on which you performed the operation.
error out contains error information. This output provides standard error out functionality.

Examples

Refer to the following VIs for examples of using the TDMS Write function:

  • TDMS Write Events Data VI: labview\examples\File IO\TDMS\Standard Read and Write
  • TDMS Write Time Domain Data VI: labview\examples\File IO\TDMS\Standard Read and Write
  • TDMS Write Triggered Data VI: labview\examples\File IO\TDMS\Standard Read and Write
  • Concurrent Access to TDMS File VI: labview\examples\File IO\TDMS

WAS THIS ARTICLE HELPFUL?

Not Helpful