NI-DAQmx Custom Scales can be created and applied in Measurement & Automation Explorer (MAX), the DAQ Assistant, or programmatically in LabVIEW or LabWindows™/CVI™. In LabVIEW, custom scales created in NI MAX can be applied in two ways:
DAQmx Create Virtual Channel
The DAQmx Create Virtual Channel VI may have a terminal where custom scale names can be provided. This VI is polymorphic, so whether this terminal is present or not depends on the channel type. If the terminal is not present, custom scales are not applicable to the channel type. If a custom scale is used, the Units must be specified as From Custom Scale.
DAQmx Channel Property Node
DAQmx Channel Property Nodes may also be used to implement a custom scale. As with DAQmx Create Virtual Channel, units must be specified as From Custom Scale
Applying custom scales in LabWindows™/CVI™ is very similar. To apply a custom scale while creating a channel, specify the Units argument as From Custom Scale and specify your custom scale name in the Custom Scale Name argument. To apply a custom scale with properties, use DAQmx GetChanAttribute to set the Custom Scale Name property to your custom scale name and to set the Units property to From Custom Scale.
Custom scales can also be created and applied programmatically.
Custom scales can be applied to both input and output channels:
The scale takes pre-scaled analog signal values and converts them to the scaled units specified by the custom scale. For example, a scale could convert a voltage to a linear position. When you read samples from a channel associated with a scale, the samples are in scaled units.
The scale takes the specified unit values as an input and outputs a corresponding analog signal value to write to the output channel. For example, a scale could convert a linear position to a voltage. When you write samples to a channel associated with a scale, the samples are in scaled units.
You can also use scales to calibrate samples read or written so that the final scaled units are identical to the pre-scaled units of the channel. After a scale is assigned to a channel, the scale applies to all attributes normally expressed in the pre-scaled units of the channel. This includes the maximum and minimum values assigned to the channel. For example, if a custom scale, which converts volts to meters, is assigned to a voltage channel, the channels minimum and maximum attributes are expressed in meters.