Get Waveform Attribute Function

Owning Palette: Waveform VIs and Functions

Requires: Base Development System

Retrieves the names and values of all attributes or the value of a single attribute, depending on whether you wire the name parameter.

Attributes can be channel names. The connector pane displays the default data types for this polymorphic function.

Details  

 Add to the block diagram  Find on the palette
waveform is the waveform for which you want to retrieve an attribute(s) and value(s).
name is the name of the attribute whose value you want to retrieve. Do not wire this parameter if you want to retrieve all the attributes associated with the specified waveform. If you wire name, the names output changes to a Boolean output found, the array output values changes to an output called value of the same type as default value, and the function searches for only the specified attribute.
default value is a value and data type that you specify. If the function does not find the attribute specified in name, it returns the default value. If you wire default value, you must wire name.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
duplicate waveform is the waveform data you input in waveform.
names returns a 1D array containing the names of all attributes associated with the waveform. If you wire the name parameter, this output changes to a Boolean value found. found returns TRUE if the function finds the attribute that you specify in name.
values returns a 1D array containing the values associated with each attribute of the specified waveform in variant format. You must unflatten each attribute value to an appropriate data type. If you wire name, this output changes to a single variant value. If the function does not find the attribute that you specify in name, it returns the value passed to default value.
error out contains error information. This output provides standard error out functionality.

Get Waveform Attribute Details

This function has two modes of behavior depending on whether you wire the name parameter. By default, the function returns the names of all attributes and their corresponding values in 1D arrays. If you wire name, the names output changes to a Boolean output found, the values output changes to a variant output value, and the function searches for only the specified attribute. If the function does not find the specified attribute(s), or if it cannot convert the attribute(s) to the default value, found is FALSE, and value displays the contents of default value.

The following table lists the waveform attributes set by NI-DAQ.

NameAttributeData TypeAcceptable ValuesDescription
Hardware Device NumberNI_DeviceNumberStringAny value is acceptable for NI_DeviceNumber.NI_DeviceNumber is the device number of the hardware device producing the waveform.
Name of ChannelNI_ChannelNameStringAny value is acceptable for NI_ChannelName.NI_ChannelName is the name of the virtual channel producing the waveform.
Name of Digital Line(s)NI_LineNamesStringAny value is acceptable for NI_LineNames.NI_LineNames is the name of the digital line in the waveform.
Unit for DataNI_UnitDescriptionStringVolts, PSI, and so forth are acceptable values for NI_UnitDescription.NI_UnitDescription is the units of measure for the waveform.

The following table lists the waveform attributes set by Express VIs.

NameAttributeData TypeAcceptable ValuesDescription
Start TimestampNI_ExpStartTimeStampTime stampAny value is acceptable for NI_ExpStartTimeStamp.NI_ExpStartTimeStamp is the time stamp of the first sample in the first waveform. In Express VIs, this is set once per start of the VI and does not change, even if waveform data is generated in a loop. In Express VIs, NI_ExpStartTimeStamp is set according to the PC clock unless the waveform originates in NI-DAQ. When the waveform originates in NI-DAQ, NI-DAQ sets NI_ExpStartTimeStamp.
TimestampNI_ExpTimeStampTime stampAny value is acceptable for NI_ExpTimeStamp.NI_ExpTimeStamp is the time stamp of the first sample in the waveform. In Express VIs, NI_ExpTimeStamp is set according to the PC clock unless the waveform originates in NI-DAQ. When the waveform originates in NI-DAQ, NI-DAQ sets NI_ExpTimeStamp.
X DimensionNI_ExpXDimensionStringUse a single character for the NI_ExpXDimension value. Currently, only t for time and f for frequency are supported. The value for NI_ExpXDimension is case sensitive.If the value of NI_ExpXDimension is t, t0 and dt are unchanged. If the value of NI_ExpXDimension is f, Express VIs interpret t0 and dt as f0 and df. For all other values, Express VIs generically interpret t0 and dt as X0 and dX, but there is no effect otherwise.
Relative Time?NI_ExpIsRelativeTimeBooleanTRUE or FALSE are acceptable values for NI_ExpIsRelativeTime.If and only if NI_ExpXDimension is t, Express VIs set t0 as a relative/absolute time stamp value.
Note  Express VIs also use the attributes set by NI-DAQ. If the waveform does not originate in NI-DAQ, Express VIs add NI_ChannelName.