TDMS Write Function

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.


icon

Inputs/Outputs

  • cenum.png data layout (0:decimated)

    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.

    0

    decimated (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
    1

    interleaved—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
  • cgnrn.png tdms file

    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.

  • cstr.png group name in (Untitled)

    group name in specifies the channel group on which to perform the operation. The default is Untitled.

  • c1dstr.png channel name(s) in (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.

    StringString or 1D Array of Strings1D 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.

  • c1dmsdt.png data

    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
  • cerrcodeclst.png error in (no error)

    error in describes error conditions that occur before this node runs. This input provides standard error in functionality.

  • ignrn.png tdms file out

    tdms file out returns a TDMS file reference to the .tdms file on which you performed the operation.

  • istr.png group name out

    group name out returns the name of the channel group on which you performed the operation.

  • i1dstr.png channel name(s) out

    channel name(s) out returns the channel name on which you performed the operation.

  • ierrcodeclst.png error out

    error out contains error information. This output provides standard error out functionality.

  • Examples

    Refer to the following example files included with LabVIEW.

    • labview\examples\File IO\TDMS\Standard Read and Write\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\Concurrent Access to TDMS File.vi