NI-DAQ™mx C Reference

DAQmxCreateCIAngVelocityChan

int32 DAQmxCreateCIAngVelocityChan (TaskHandle taskHandle, const char counter[], const char nameToAssignToChannel[], float64 minVal, float64 maxVal, int32 decodingType, int32 units, uInt32 pulsesPerRev, const char customScaleName[]);

Purpose

Creates a channel to measure angular velocity. With the exception of devices that support multi-counter tasks, you can create only one counter input channel at a time with this function because a task can contain only one counter input channel. To read from multiple counters simultaneously, use a separate task for each counter. Connect the input signal to the default input terminal of the counter unless you select a different input terminal.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task to which to add the channels that this function creates.
counter const char [] The name of the counter to use to create virtual channels.
nameToAssignToChannel const char [] The name(s) to assign to the created virtual channel(s). If you do not specify a name, NI-DAQmx uses the physical channel name as the virtual channel name. If you specify your own names for nameToAssignToChannel, you must use the names when you refer to these channels in other NI-DAQmx functions.
If you create multiple virtual channels with one call to this function, you can specify a list of names separated by commas. If you provide fewer names than the number of virtual channels you create, NI-DAQmx automatically assigns names to the virtual channels.
decodingType int32 Specifies how to count and interpret the pulses that the encoder generates on signal A and signal B. DAQmx_Val_X1, DAQmx_Val_X2, and DAQmx_Val_X4 are valid for quadrature encoders only. DAQmx_Val_TwoPulseCounting is valid only for two-pulse encoders.
DAQmx_Val_X2 and DAQmx_Val_X4 decoding are more sensitive to smaller changes in position than DAQmx_Val_X1 encoding, with DAQmx_Val_X4 being the most sensitive. However, more sensitive decoding is more likely to produce erroneous measurements if there is vibration in the encoder or other noise in the signals.
ValueDescription
DAQmx_Val_X1If signal A leads signal B, count the rising edges of signal A. If signal B leads signal A, count the falling edges of signal A.
DAQmx_Val_X2Count the rising and falling edges of signal A.
DAQmx_Val_X4Count the rising and falling edges of both signal A and signal B.
DAQmx_Val_TwoPulseCountingIncrement the count on rising edges of signal A. Decrement the count on rising pulses of signal B.
minVal float64 The minimum value, in units, that you expect to measure.
maxVal float64 The maximum value, in units, that you expect to measure.
units int32 Specifies in which unit to return velocity measurements from the channel.
ValueDescription
DAQmx_Val_RPMRevolutions per minute.
DAQmx_Val_RadiansPerSecondRadians per second.
DAQmx_Val_DegreesPerSecondDegrees per second.
DAQmx_Val_FromCustomScaleUnits a custom scale specifies. Use customScaleName to specify a custom scale.
pulsesPerRev uInt32 The number of pulses the encoder generates per revolution. This value is the number of pulses on either signal A or signal B, not the total number of pulses on both signal A and signal B.
customScaleName const char [] The name of a custom scale to apply to the channel. To use this parameter, you must set units to DAQmx_Val_FromCustomScale. If you do not set units to DAQmx_Val_FromCustomScale, you must set customScaleName to NULL.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.