Write Data Express VI

Owning Palette: Storage/DataPlugin VIs

Requires: Base Development System (Windows)

Adds a channel group or channel to a file you specify. If you select Channel as the Object type in the configuration dialog box, this Express VI also creates a Signal block diagram input that enables you to add a signal to an existing channel. You also can use this Express VI to define properties for the channel group or channel that you want to add.

You also can use the Write To Measurement File Express VI to write data to a .tdm, .tdms, or .lvm file.

Example

Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs
 Add to the block diagram  Find on the palette

Dialog Box Options

ParameterDescription
SettingsContains the following options:
  • Object type—Specifies the type of object to add to the file. Contains the following options:
    • Channel group—Adds a channel group to the file.
    • Channel—Adds a channel to the file.
  • Always create new channel group/channel—Specifies whether to append existing channel groups or channels of the same name. If you do not want to append existing channel groups or channels, place a checkmark in this checkbox.

    When a channel name is repeated, LabVIEW appends an integer to the end of the names to enforce unique channel names. For example, if you provide the channel names sine, sine, square, square, and sine, LabVIEW updates these names to sine, sine 1, square, square 1, and sine 2, respectively.
PropertiesContains the following options:
  • TDM Properties—Use the TDM Properties tab to edit predefined properties and create user-defined properties for .tdm and .tdms files. Click the Insert button to add a new property to configure. Click the Delete button to remove the selected property. For predefined properties, you can edit only the Source and Value columns.
    • Source—Use the Source column to specify the input source of the property information. The Source column contains the following options:
      • Terminal—Select this option if you want to specify the property information on the block diagram.
      • Ignore—Select this option if you do not want to write any of the property information on the specified row to the file.
      • Value—Select this option if you want to specify the property information on the TDM Properties tab.
    • Name—Use the Name column to specify the property name. The property name cannot contain any spaces or special characters. LabVIEW automatically replaces spaces and special characters with an underscore. This column contains the following predefined property names:
      • Name—Specifies the name of the object you select in Object type.
      • Description—Specifies the description of the object you select in Object type.
      • Unit—Specifies the unit of the channel values. This property appears only if you select Channel in Object type.
      • Waveform length—Specifies the number of samples in the waveform. This property appears only if you select Channel in Object type.
      • Waveform x dimension—Specifies the name of the x dimension of the waveform. This property appears only if you select Channel in Object type.
      • Waveform x unit—Specifies the unit of the x dimension of the waveform. This property appears only if you select Channel in Object type.
      • Waveform timestamp—Specifies the time stamp of the first sample in the waveform. This property appears only if you select Channel in Object type.
      • Waveform offset—Specifies the starting point in the waveform. This property appears only if you select Channel in Object type.
      • Waveform increment—Specifies the time interval between every two adjacent samples in the waveform. This property appears only if you select Channel in Object type.
      • Waveform time mode—Specifies the time mode of the waveform. You can specify either an absolute or relative time mode. This property appears only if you select Channel in Object type.
    • Value—Use the Value column to specify the property value. The format of Value is determined by your selection in the Data Type column. The value in this column is not used if you selected the Terminal option in the Source column.
    • Data Type—Use the Data Type column to specify the data type of the Value column. The Data Type column contains the following options:
      • STR—Select this option to specify Value as a string.
      • DBL—Select this option to specify Value as a double-precision, floating-point number.
      • TIME—Select this option to specify Value as a timestamp value.
      • I32—Select this option to specify Value as a long integer number.
    • Insert—Inserts a new input at the top of the list.
    • Delete—Deletes the selected input from the list.
  • DAQmx—Use the DAQmx Properties tab to select and edit DAQmx property names for .tdm and .tdms files.
Measured data channelOptions in this section are available only if you select Channel as the Object type. Contains the following options:
  • Show terminals for data channel—Displays terminals for Signal, append/replace (append data values), and index on the block diagram.
  • Append/replace data values—Contains the following options:
    • Append—Appends new values to the end of existing values.
    • Replace all—Replaces all existing values with new values.
    • Replace at index—Replaces values at the index you wire to index on the block diagram.
Append/replace data valuesContains the following options:
  • Append—Appends new values to the end of existing values.
  • Replace all—Replaces all existing values with new values.
  • Replace at index—Replaces values at the index you wire to index on the block diagram.

Block Diagram Inputs

ParameterDescription
SignalSpecifies the signal to add to the an existing channel. This input appears only if you specify Channel as the Object type in the configuration dialog box.
Note  The Storage/DataPlugin VIs do not support strings that contain binary data. You must first convert the string to an unsigned byte array using the String to Byte Array function. If you do not convert the string, the Write Data Express VI writes only the portion of the string before the first NULL character.
error inDescribes error conditions that occur before this node runs.
append/replace (append data values)Specifies whether you want to append new values to the end of existing values, replace all existing values with new values, or replace values at the index you wire to the index input. This input appears only if you place a checkmark in the Show terminals for data channel check box in the configuration dialog box.
storage refnum (file)Specifies the reference number for the .tdm or .tdms file you want to access. You must wire a file refnum to this input.
indexSpecifies where to replace values in the waveform. The default is 0.

Block Diagram Outputs

ParameterDescription
error outContains error information. This output provides standard error out functionality.
storage refnum (file) outReturns a reference number for the .tdm or .tdms file this Express VI accesses. You can wire this refnum to another VI to complete another operation on the same file.
storage refnumReturns a reference number for the data object this Express VI accesses. You can wire this refnum to another VI to complete another operation on the same object.

Example

Refer to the TDM Event Data.lvproj in the labview\examples\File IO\DataPlugins\TDM\TDM Event Data directory for an example of using the Write Data Express VI.

 Open example  Find related examples