Table Of Contents

TDMS Write (G Dataflow)

Version:
    Last Modified: March 29, 2017

    Writes data to a .tdms file.

    When this node writes data to a .tdms file, the data waits in a buffer until the buffer fills up or until you close the reference to the file. After the buffer fills up or you close the reference to the file, this node writes data to the .tdms file.

    This node immediately writes data to a .tdms file if the disable buffering input of the TDMS Open node is True and NI_MinimumBufferSize is set to 0.

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

    connector_pane_image
    datatype_icon

    data layout

    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.

    Name Description
    non-interleaved

    Lists all samples from the first channel, then all samples from the second channel, and so on through the last channel.

    interleaved

    Lists the first sample from every channel, then the second sample from every channel, and so on through the last sample from every channel.

    Data Layout Examples

    The following table shows a typical example of the non-interleaved 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

    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

    Default: non-interleaved

    datatype_icon

    tdms file

    A reference to a .tdms file. Use the TDMS Open node to obtain the reference.

    datatype_icon

    group name in

    Channel group on which to perform the operation.

    datatype_icon

    channel name(s) in

    Channel or channels on which to perform the operation.

    channel name(s) in accepts a string or a 1D array of strings. The data type varies according to the data type of data. If you do not wire channel name(s) in, channels are named automatically.

    Determining the Data Type of channel name(s) in

    The following table shows how the data type of channel name(s) in varies according to the data type of data.

    data channel name(s) in Comments

    Analog waveform

    1D array of alphanumeric strings that do not contain null characters.

    String

    If you do not wire channel name(s) in and wire waveform data to data, channels use waveform names.

    1D array of:
    • Signed or unsigned integers
    • Floating-point numbers
    • Timestamps
    • Booleans
    String or 1D Array of Strings

    If data layout is non-interleaved and you wire a 1D array of strings to channel name(s) in, this node 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 node 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 of the 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
    1D Array of Strings

    If you do not wire channel name(s) in and wire waveform data to data, channels use waveform names.

    Writing Compressed Digital Data

    If data contains compressed digital data, you must enter the name of the compression channel as the first entry in the channel name(s) in array.

    datatype_icon

    data

    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
    • Digital table
    • 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
        • Extended-precision floating-point numbers
      • Timestamps
      • Booleans
      • Alphanumeric strings that do not contain null characters

    Writing Analog or Digital Waveforms

    When you write analog or digital waveforms to a new channel, this node includes the timestamp information in the waveforms. However, when you append analog or digital waveforms to an existing channel, this node might discard the timestamp information in the new waveforms.

    datatype_icon

    error in

    Error conditions that occur before this node runs.

    The node responds to this input according to standard error behavior.

    Standard Error Behavior

    Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

    error in does not contain an error error in contains an error
    If no error occurred before the node runs, the node begins execution normally.

    If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

    If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

    Default: No error

    datatype_icon

    tdms file out

    A reference to the .tdms file.

    datatype_icon

    group name out

    Channel group on which you performed the operation.

    If you do not specify a group name, this output returns Untitled.

    datatype_icon

    channel name(s) out

    Channel or channels on which you performed the operation.

    If you do not specify a channel name, this output returns Untitled.

    datatype_icon

    error out

    Error information.

    The node produces this output according to standard error behavior.

    Standard Error Behavior

    Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

    error in does not contain an error error in contains an error
    If no error occurred before the node runs, the node begins execution normally.

    If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

    If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

    File Buffering with TDMS Files

    When a TDMS node writes data to a .tdms file, the data waits in a buffer until the buffer fills up or until you close the file. Buffering holds more data values in memory and allows you to wait and flush data to disk once, rather than continuously writing data. This both improves performance and causes the .tdms file to have fewer segments and be less fragmented. Files with fewer segments are more compact and take less time to open.

    Buffering can occur at the channel layer, in the operating system (OS) file system, or in the TDMS disk cache. The layer at which buffering occurs depends on the property you set using the node. For example, the NI_MinimumBufferSize property determines the number of data samples to buffer at the channel layer. The disable buffering input of TDMS nodes determines whether to disable system buffering, which occurs in the OS. When the disable buffering input is True, this product disables system buffering and buffering occurs in the TDMS disk cache. The NI_DiskCacheSize property determines the amount of cache size in the TDMS disk cache to allocate for data. This property is valid only if the disable buffering input is True.

    To write all buffers directly to the TDMS file, use the TDMS Flush node.

    spd-note-note
    Note  

    The NI_MinimumBufferSize property and the NI_DiskCacheSize property do not apply to the Advanced TDMS nodes.

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics