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.
© 2017 National Instruments. All rights reserved.
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
A reference to a .tdms file. Use the TDMS Open node to obtain the reference.
Channel group on which to perform the operation.
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. |
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 |
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.
Data to write to the .tdms file.
This input accepts the following data types:
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.
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.
Default: No error
A reference to the .tdms file.
Channel group on which you performed the operation.
If you do not specify a group name, this output returns Untitled.
Channel or channels on which you performed the operation.
If you do not specify a channel name, this output returns Untitled.
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.
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.
Where This Node Can Run:
Desktop OS: Windows
FPGA: This product does not support FPGA devices
Web Server: Not supported in VIs that run in a web application