Home
chm2web Web Online Help Prev Page Prev Page
NI-DAQmx C Reference Help
Additional Information
Troubleshooting
Related Documentation
Using Help
Conventions
Navigating Help
Searching Help
Printing Help File Topics
NI-DAQmx Concepts
NI-DAQmx C Functions
Task Configuration/Control
DAQmxAddGlobalChansToTask
DAQmxClearTask
DAQmxConfigureLogging
DAQmxCreateTask
DAQmxIsTaskDone
DAQmxLoadTask
DAQmxStartTask
DAQmxStartNewFile
DAQmxStopTask
DAQmxWaitUntilTaskDone
Events
DAQmxRegisterDoneEvent
DAQmxRegisterEveryNSamplesEvent
DAQmxRegisterSignalEvent
Advanced
DAQmxGetNthTaskChannel
DAQmxGetNthTaskDevice
DAQmxTaskControl
Channel Configuration/Creation
Create Analog Input Channels
DAQmxCreateAIAccelChan
DAQmxCreateAIBridgeChan
DAQmxCreateAICurrentChan
DAQmxCreateAICurrentRMSChan
DAQmxCreateAIForceBridgePolynomialChan
DAQmxCreateAIForceBridgeTableChan
DAQmxCreateAIForceBridgeTwoPointLinChan
DAQmxCreateAIForceIEPEChan
DAQmxCreateAIFreqVoltageChan
DAQmxCreateAIMicrophoneChan
DAQmxCreateAIPressureBridgePolynomialChan
DAQmxCreateAIPressureBridgeTableChan
DAQmxCreateAIPressureBridgeTwoPointLinChan
DAQmxCreateAIResistanceChan
DAQmxCreateAIRosetteStrainGageChan
DAQmxCreateAIRTDChan
DAQmxCreateAIStrainGageChan
DAQmxCreateAITempBuiltInSensorChan
DAQmxCreateAIThrmcplChan
DAQmxCreateAIThrmstrChanIex
DAQmxCreateAIThrmstrChanVex
DAQmxCreateAITorqueBridgePolynomialChan
DAQmxCreateAITorqueBridgeTableChan
DAQmxCreateAITorqueBridgeTwoPointLinChan
DAQmxCreateAIVelocityIEPEChan
DAQmxCreateAIVoltageChan
DAQmxCreateAIVoltageRMSChan
DAQmxCreateAIVoltageChanWithExcit
Position
DAQmxCreateAIPosEddyCurrProxProbeChan
DAQmxCreateAIPosLVDTChan
DAQmxCreateAIPosRVDTChan
Obsolete
DAQmxCreateAIDeviceTempChan
Create TEDS Analog Input Channels
DAQmxCreateTEDSAIAccelChan
DAQmxCreateTEDSAICurrentChan
DAQmxCreateTEDSAIBridgeChan
DAQmxCreateTEDSAIForceBridgeChan
DAQmxCreateTEDSAIForceIEPEChan
DAQmxCreateTEDSAIMicrophoneChan
DAQmxCreateTEDSAIPressureBridgeChan
DAQmxCreateTEDSAIResistanceChan
DAQmxCreateTEDSAIRTDChan
DAQmxCreateTEDSAIStrainGageChan
DAQmxCreateTEDSAIThrmcplChan
DAQmxCreateTEDSAIThrmstrChanIex
DAQmxCreateTEDSAIThrmstrChanVex
DAQmxCreateTEDSAITorqueBridgeChan
DAQmxCreateTEDSAIVoltageChan
DAQmxCreateTEDSAIVoltageChanWithExcit
Position
DAQmxCreateTEDSAIPosLVDTChan
DAQmxCreateTEDSAIPosRVDTChan
Create Analog Output Channel
DAQmxCreateAOCurrentChan
DAQmxCreateAOFuncGenChan
DAQmxCreateAOVoltageChan
Create Digital Input Channels
DAQmxCreateDIChan
Create Digital Output Channels
DAQmxCreateDOChan
Create Counter Input Channels
DAQmxCreateCICountEdgesChan
DAQmxCreateCIFreqChan
DAQmxCreateCIPeriodChan
DAQmxCreateCIPulseChanFreq
DAQmxCreateCIPulseChanTicks
DAQmxCreateCIPulseChanTime
DAQmxCreateCIPulseWidthChan
DAQmxCreateCISemiPeriodChan
DAQmxCreateCITwoEdgeSepChan
Position
DAQmxCreateCILinEncoderChan
DAQmxCreateCIAngEncoderChan
Timestamp
DAQmxCreateCIGPSTimestampChan
Create Counter Output Channels
DAQmxCreateCOPulseChanFreq
DAQmxCreateCOPulseChanTicks
DAQmxCreateCOPulseChanTime
Timing
DAQmxCfgBurstHandshakingTimingExportClock
DAQmxCfgBurstHandshakingTimingImportClock
DAQmxCfgChangeDetectionTiming
DAQmxCfgHandshakingTiming
DAQmxCfgImplicitTiming
DAQmxCfgPipelinedSampClkTiming
DAQmxCfgSampClkTiming
Triggering
Start Trigger
DAQmxCfgAnlgEdgeStartTrig
DAQmxCfgAnlgWindowStartTrig
DAQmxCfgDigEdgeStartTrig
DAQmxCfgDigPatternStartTrig
DAQmxDisableStartTrig
Reference Trigger
DAQmxCfgAnlgEdgeRefTrig
DAQmxCfgAnlgWindowRefTrig
DAQmxCfgDigEdgeRefTrig
DAQmxCfgDigPatternRefTrig
DAQmxDisableRefTrig
Advanced Trigger
DAQmxCfgDigEdgeAdvTrig
DAQmxDisableAdvTrig
DAQmxSendSoftwareTrigger
Read Functions
DAQmxReadAnalogF64
DAQmxReadAnalogScalarF64
DAQmxReadBinaryI16
DAQmxReadBinaryI32
DAQmxReadBinaryU16
DAQmxReadBinaryU32
DAQmxReadCounterF64
DAQmxReadCounterScalarF64
DAQmxReadCounterScalarU32
DAQmxReadCounterU32
DAQmxReadCtrFreq
DAQmxReadCtrFreqScalar
DAQmxReadCtrTicks
DAQmxReadCtrTicksScalar
DAQmxReadCtrTime
DAQmxReadCtrTimeScalar
DAQmxReadDigitalLines
DAQmxReadDigitalScalarU32
DAQmxReadDigitalU8
DAQmxReadDigitalU16
DAQmxReadDigitalU32
Advanced
DAQmxGetNthTaskReadChannel
DAQmxReadRaw
Write Functions
DAQmxWriteAnalogF64
DAQmxWriteAnalogScalarF64
DAQmxWriteBinaryI16
DAQmxWriteBinaryU16
DAQmxWriteCtrFreq
DAQmxWriteCtrFreqScalar
DAQmxWriteCtrTicks
DAQmxWriteCtrTicksScalar
DAQmxWriteCtrTime
DAQmxWriteCtrTimeScalar
DAQmxWriteDigitalLines
DAQmxWriteDigitalScalarU32
DAQmxWriteDigitalU8
DAQmxWriteDigitalU16
DAQmxWriteDigitalU32
Advanced
DAQmxWriteRaw
Export HW Signals
DAQmxExportSignal
Scale Configuration
DAQmxCalculateReversePolyCoeff
DAQmxCreateLinScale
DAQmxCreateMapScale
DAQmxCreatePolynomialScale
DAQmxCreateTableScale
Internal Buffer Configuration
DAQmxCfgInputBuffer
DAQmxCfgOutputBuffer
Advanced Functions
Real-Time
DAQmxWaitForNextSampleClock
Obsolete
DAQmxIsReadOrWriteLate
Switch Functions
DAQmxSwitchCloseRelays
DAQmxSwitchConnect
DAQmxSwitchConnectMulti
DAQmxSwitchCreateScanList
DAQmxSwitchDisconnect
DAQmxSwitchDisconnectAll
DAQmxSwitchDisconnectMulti
DAQmxSwitchFindPath
DAQmxSwitchGetMultiRelayCount
DAQmxSwitchGetMultiRelayPos
DAQmxSwitchGetSingleRelayCount
DAQmxSwitchGetSingleRelayPos
DAQmxSwitchOpenRelays
DAQmxSwitchSetTopologyAndReset
DAQmxSwitchWaitForSettling
Signal Routing
DAQmxConnectTerms
DAQmxDisconnectTerms
DAQmxTristateOutputTerm
Device Control
DAQmxResetDevice
DAQmxSelfTestDevice
Watchdog
DAQmxControlWatchdogTask
DAQmxCreateWatchdogTimerTask
Calibration
DAQmxAOSeriesCalAdjust
DAQmxESeriesCalAdjust
DAQmxGetAIChanCalCalDate
DAQmxGetAIChanCalExpDate
DAQmxGetExtCalLastDateAndTime
DAQmxGetSelfCalLastDateAndTime
DAQmxMSeriesCalAdjust
DAQmxPerformBridgeOffsetNullingCal
DAQmxPerformBridgeOffsetNullingCalEx
DAQmxPerformBridgeShuntCal
DAQmxPerformStrainShuntCal
DAQmxPerformThrmcplLeadOffsetNullingCal
DAQmxRestoreLastExtCalConst
DAQmxSCBaseboardCalAdjust
DAQmxSelfCal
DAQmxSetAIChanCalCalDate
DAQmxSetAIChanCalExpDate
DAQmxSSeriesCalAdjust
DAQmxXSeriesCalAdjust
External Calibration
DAQmxChangeExtCalPassword
DAQmxCloseExtCal
DAQmxInitExtCal
DSA Calibration
DAQmxAdjustDSAAICal
DAQmxAdjustDSAAICalEx
DAQmxAdjustDSAAICalWithGainAndCoupling
DAQmxAdjustDSAAOCal
DAQmxAdjustDSATimebaseCal
PXI-42xx Calibration
DAQmxAdjust4204Cal
DAQmxAdjust4220Cal
DAQmxAdjust4224Cal
SCXI Calibration
DAQmxAdjust1102Cal
DAQmxAdjust1104Cal
DAQmxAdjust1112Cal
DAQmxAdjust1122Cal
DAQmxAdjust1124Cal
DAQmxAdjust1125Cal
DAQmxAdjust1126Cal
DAQmxAdjust1141Cal
DAQmxAdjust1142Cal
DAQmxAdjust1143Cal
DAQmxAdjust1502Cal
DAQmxAdjust1503Cal
DAQmxAdjust1503CurrentCal
DAQmxAdjust1520Cal
DAQmxAdjust1521Cal
DAQmxAdjust153xCal
DAQmxAdjust1540Cal
DAQmxSetup1102Cal
DAQmxSetup1104Cal
DAQmxSetup1112Cal
DAQmxSetup1122Cal
DAQmxSetup1124Cal
DAQmxSetup1125Cal
DAQmxSetup1126Cal
DAQmxSetup1141Cal
DAQmxSetup1142Cal
DAQmxSetup1143Cal
DAQmxSetup1502Cal
DAQmxSetup1503Cal
DAQmxSetup1520Cal
DAQmxSetup1521Cal
DAQmxSetup153xCal
DAQmxSetup1540Cal
SC Express Calibration
DAQmxAdjust4300Cal
DAQmxAdjust433xCal
DAQmxAdjust4353Cal
DAQmxSetup433xCal
DAQmxAdjust4357Cal
DAQmxConnectSCExpressCalAccChans
DAQmxDisconnectSCExpressCalAccChans
DAQmxGetPossibleSCExpressCalAccConnections
DAQmxSetSCExpressCalAccBridgeOutput
C Series Calibration
Adjust C Series Calibration
DAQmxAdjust9201Cal
DAQmxAdjust9203GainCal
DAQmxAdjust9203OffsetCal
DAQmxAdjust9205Cal
DAQmxAdjust9206Cal
DAQmxAdjust9207GainCal
DAQmxAdjust9207OffsetCal
DAQmxAdjust9208GainCal
DAQmxAdjust9208OffsetCal
DAQmxAdjust9211Cal
DAQmxAdjust9213Cal
DAQmxAdjust9214Cal
DAQmxAdjust9215Cal
DAQmxAdjust9217Cal
DAQmxAdjust9219Cal
DAQmxAdjust9220Cal
DAQmxAdjust9221Cal
DAQmxAdjust9222Cal
DAQmxAdjust9223Cal
DAQmxAdjust9225Cal
DAQmxAdjust9227Cal
DAQmxAdjust9232Cal
DAQmxAdjust9234GainCal
DAQmxAdjust9234OffsetCal
DAQmxAdjust9263Cal
DAQmxAdjust9264Cal
DAQmxAdjust9265Cal
DAQmxAdjust9269Cal
Get C Series Calibration Adjustment Points
DAQmxGet9201CalAdjustPoints
DAQmxGet9203CalAdjustPoints
DAQmxGet9207CalAdjustPoints
DAQmxGet9208CalAdjustPoints
DAQmxGet9213CalAdjustPoints
DAQmxGet9214CalAdjustPoints
DAQmxGet9215CalAdjustPoints
DAQmxGet9217CalAdjustPoints
DAQmxGet9219CalAdjustPoints
DAQmxGet9220CalAdjustPoints
DAQmxGet9221CalAdjustPoints
DAQmxGet9222CalAdjustPoints
DAQmxGet9223CalAdjustPoints
DAQmxGet9225CalAdjustPoints
DAQmxGet9227CalAdjustPoints
DAQmxGet9232CalAdjustPoints
DAQmxGet9234CalAdjustPoints
DAQmxGet9263CalAdjustPoints
DAQmxGet9264CalAdjustPoints
DAQmxGet9265CalAdjustPoints
DAQmxGet9269CalAdjustPoints
Setup C Series Calibration
DAQmxSetup9219Cal
DAQmxSetup9263Cal
DAQmxSetup9264Cal
DAQmxSetup9265Cal
DAQmxSetup9269Cal
DAQmxCSeriesSetCalTemp
Storage
DAQmxDeleteSavedGlobalChan
DAQmxDeleteSavedScale
DAQmxDeleteSavedTask
DAQmxSaveGlobalChan
DAQmxSaveScale
DAQmxSaveTask
TEDS
DAQmxClearTEDS
DAQmxConfigureTEDS
DAQmxWriteToTEDSFromArray
DAQmxWriteToTEDSFromFile
Network DAQ Functions
DAQmxAddNetworkDevice
DAQmxDeleteNetworkDevice
DAQmxReserveNetworkDevice
DAQmxUnreserveNetworkDevice
cDAQ Sync Functions
DAQmxAddCDAQSyncConnection
DAQmxAreConfiguredCDAQSyncPortsDisconnected
DAQmxAutoConfigureCDAQSyncConnections
DAQmxGetAutoConfiguredCDAQSyncConnections
DAQmxGetDisconnectedCDAQSyncPorts
DAQmxRemoveCDAQSyncConnection
System Configuration
DAQmxGetAnalogPowerUpStates
DAQmxGetDigitalLogicFamilyPowerUpState
DAQmxGetDigitalPowerUpStates
DAQmxGetDigitalPullUpPullDownStates
DAQmxSetAnalogPowerUpStates
DAQmxSetDigitalLogicFamilyPowerUpState
DAQmxSetDigitalPowerUpStates
DAQmxSetDigitalPullUpPullDownStates
Error Handling
DAQmxGetErrorString
DAQmxGetExtendedErrorInfo
NI-DAQmx C Properties
List of Buffer Properties
List of Calibration Info Properties
List of Channel Properties
List of Device Properties
List of Export Signal Properties
List of Persisted Channel Properties
List of Persisted Scale Properties
List of Persisted Task Properties
List of Physical Channel Properties
List of Read Properties
List of Real-Time Properties
List of Scale Properties
List of Switch Channel Properties
List of Switch Device Properties
List of Switch Scan Properties
List of System Properties
List of Task Properties
List of Timing Properties
List of Trigger Properties
List of Watchdog Properties
List of Write Properties
Glossary
Important Information
Warranty
Copyright
Trademarks
Patents
Warning Regarding the Use of NI Products
Technical Support and Professional Services

DAQmxCreateCIAngEncoderChan

int32 DAQmxCreateCIAngEncoderChan (TaskHandle taskHandle, const char counter[], const char nameToAssignToChannel[], int32 decodingType, bool32 ZidxEnable, float64 ZidxVal, int32 ZidxPhase, int32 units, uInt32 pulsesPerRev, float64 initialAngle, const char customScaleName[]);

Purpose

Creates a channel that uses an angular encoder to measure angular position. You can create only one counter input channel at a time with this function because a task can include only one counter input channel. To read from multiple counters simultaneously, use a separate task for each counter. Connect the input signals to the default input terminals of the counter unless you select different input terminals.

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 to assign to the created virtual channel. 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.

Value Description
DAQmx_Val_X1 If 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_X2 Count the rising and falling edges of signal A.
DAQmx_Val_X4 Count the rising and falling edges of both signal A and signal B.
DAQmx_Val_TwoPulseCounting Increment the count on rising edges of signal A. Decrement the count on rising pulses of signal B.
ZidxEnable bool32 Specifies whether to enable z indexing for the measurement.
ZidxVal float64 The value, in units, to which to reset the measurement when signal Z is high and signal A and signal B are at the states you specify with ZidxPhase.
ZidxPhase int32 The states at which signal A and signal B must be while signal Z is high for NI-DAQmx to reset the measurement. If signal Z is never high while the signal A and signal B are high, for example, you must choose a phase other than DAQmx_Val_AHighBHigh.

When signal Z goes high and how long it stays high varies from encoder to encoder. Refer to the documentation for the encoder to determine the timing of signal Z with respect to signal A and signal B.
Value Description
DAQmx_Val_AHighBHigh Reset the measurement when both signal A and signal B are at high logic.
DAQmx_Val_AHighBLow Reset the measurement when signal A is at high logic and signal B is at low logic.
DAQmx_Val_ALowBHigh Reset the measurement when signal A is at low logic and signal B is at high logic.
DAQmx_Val_ALowBLow Reset the measurement when both signal A and signal B are at low logic.
units int32 The units to use to return angular position measurements from the channel.

Value Description
DAQmx_Val_Degrees Degrees
DAQmx_Val_Radians Radians
DAQmx_Val_Ticks Timebase ticks
DAQmx_Val_FromCustomScale Units 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 one of either A signal or B signal, not the total number of pulses on both signal A and signal B.
initialAngle float64 The starting angle of the encoder when the measurement begins. Specify this value in units.
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.
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)