Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Write Data (Windows)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Adds a channel group or channel to a file you specify. You also can use this 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 file.

Examples

Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs

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.
    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.
  • 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.
PropertiesContains the following options:
  • User-defined—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.
    • 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 channelContains 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—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 file.
Note  The Storage 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 VI writes only the portion of the string before the first NULL character.
storage refnumSpecifies the refnum for the data object you want to access. After you wire a file refnum to this input, the label changes from storage refnum to storage refnum (file). After you wire a channel group refnum to this input, the label changes from storage refnum to storage refnum (channel group). If you wire a channel group to this input, this VI writes the channel to the channel group you specify.
append/replace (append data values)Contains the following options:
  • Append—Appends new values to the end of existing values.
  • Replace at index—Replaces values at the index you wire to index on the block diagram.
  • Replace—Replaces all existing values with new values.
indexSpecifies where to replace values in the waveform. The default is 0.
error inDescribes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.

Block Diagram Outputs

ParameterDescription
storage refnumReturns the refnum to the file the VI accessed. You can wire this refnum to another VI to complete another operation on the same file.
error outContains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces.

Examples

Refer to the following VIs for examples of using the Write Data VI:

  • Write TDM File VI: labview\examples\file\storage.llb
  • Write Channel Groups VI: labview\examples\file\storage.llb

Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit