nimcReadAxisStatus |
Read Axis Status
Usage
status = nimcReadAxisStatus(TnimcDeviceHandle deviceHandle, TnimcAxisHandle axisHandle, TnimcAxisStatus attribute, TnimcData* data);
Purpose
Reads the specified execution status information of an axis.
Parameters
Name | Type | Description |
---|---|---|
deviceHandle | TnimcDeviceHandle | assigned by Measurement & Automation Explorer (MAX) |
axisHandle | TnimcAxisHandle | axis to read |
attribute | TnimcAxisStatus | attribute to read |
data | TnimcData* | the value for the attribute you are reading |
Parameter Discussion
axisHandle is the axis to read with this function. Valid values are 1 through 30. On motion controllers that support fewer than thirty axes, reading non-existent axes returns error 70006 (NIMC_badResourceIDOrAxisError).
attribute is the attribute to read. The following are valid attributes:
- TnimcAxisStatusAxisActive
- TnimcAxisStatusMoveComplete
- TnimcAxisStatusProfileComplete
- TnimcAxisStatusBlendComplete
- TnimcAxisStatusFollowingErrorExceeded
- TnimcAxisStatusVelocityThresholdExceeded
- TnimcAxisStatusMoving
- TnimcAxisStatusDirectionForward
data is the value for the attribute you are reading in the following structure:
struct{
i32 longData;
u8 boolData;
f64 doubleData;
} TnimcData;
Based on the attribute, the correct member of TnimcData will be returned by the motion controller. The values of the other elements in the structure are undefined.
Read boolData in the TnimcData structure to retrieve the axis execution status.
Using This Function
Use this function to read the specified execution status information of an axis.
Note This function should not be used for event checking. Only use the information returned by this function for display purposes. Refer to Advanced Read Functions for more information. |
For TnimcAxisStatusAxisActive, TnimcTrue indicates that the motor is on and TnimcFalse indicates that the motor is off.
For TnimcAxisStatusMoveComplete, TnimcAxisStatusProfileComplete, and TnimcAxisStatusBlendComplete, TnimcTrue indicates that the move, profile, or blend is complete and TnimcFalse indicates that the move, profile, or blend is incomplete.
For TnimcAxisStatusFollowingErrorExceeded, TnimcTrue indicates that the axis exceeded the programmed following error limit and TnimcFalse indicates that the axis following error is below the programmed following error limit.
Note If you are running a contoured move or slave axis move with a stepper axis, it is possible that the contour velocity or the slave axis geared velocity exceeds the maximum step rate of the controller. In this case, the controller kills the axis and sets the following error status to true. Refer to the Specifications section of your controller user manual for the maximum step rate of your controller. |
For TnimcAxisStatusVelocityThresholdExceeded, TnimcTrue indicates that the absolute value of filtered axis velocity is above the threshold and TnimcFalse indicates that the velocity is below the threshold.
For TnimcAxisStatusMoving, TnimcTrue indicates that the axis is moving and TnimcFalse indicates that the axis is not moving.
For TnimcAxisStatusDirectionForward, TnimcTrue indicates that the axis is moving forward and TnimcFalse indicates that the axis is not moving forward.
Note Refer to Function Execution Times for benchmark timing information about your controller. |