nimcReadAllAxisStatus

NI-Motion Functions

nimcReadAllAxisStatus

Device Compatibility

Device Compatibility
7330
N
7340
N
7344
N
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Xenus
N
NI SoftMotion Controller for CANopen—Accelnet
N

Read All Axis Status

Usage

status = nimcReadAllAxisStatus(TnimcDeviceHandle deviceHandle, TnimcAxisHandle axisHandle, TnimcAxisStatus* data);

Purpose

Reads the execution status of the selected axis.

Parameters

Name Type Description
deviceHandle TnimcDeviceHandle assigned by Measurement & Automation Explorer (MAX)
axisHandle TnimcAxisHandle axis to read
data TnimcAllAxisStatus* the data record containing axis execution information

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).

data is the data record containing axis execution information in the following structure:

struct {
   u32 size;
   u8 axisActive;
   u8 moveComplete;
   u8 profileComplete;
   u8 blendComplete;
   u8 followingErrorExceeded;
   u8 velocityThresholdExceeded;
   u8 moving;
   u8 directionForward;
   u8 indexCaptureOccurred;
   u8 positionCaptureOccurred;
   u8 positionCompareOccurred;
   u8 forwardLimitActive;
   u8 reverseLimitActive;
   u8 forwardSoftwareLimitActive;
   u8 reverseSoftwareLimitActive;
   u8 homeInputActive;
   u8 homeFound;
   u8 indexFound;
   u8 referenceFound;
} TnimcAllAxisStatus;

Using This Function

Use this function to read the execution status of the selected axis.

Caution  If this function uses reflective memory, it should not be used for event checking. In this case, only use the information returned by this function for display purposes. Refer to Reflective Memory Functions for more information.
Note  Refer to Function Execution Times for benchmark timing information about your controller.

The TnimcAllAxisStatus structure will return TnimcTrue or TnimcFalse based on the following criteria:

Element Status
axisActive TnimcTrue = motor is on
TnimcFalse = motor is off
moveComplete TnimcTrue = move complete
TnimcFalse = move not complete
profileComplete TnimcTrue = profile is complete
TnimcFalse = profile generation in process
blendComplete TnimcTrue = blend complete
TnimcFalse = blend pending
followingErrorExceeded TnimcTrue = axis exceeded the programmed following error limit
TnimcFalse = 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.
velocityThresholdExceeded TnimcTrue = axis velocity is above the programmed velocity threshold
TnimcFalse = axis velocity is below the programmed velocity threshold
moving TnimcTrue = axis is moving
TnimcFalse = axis is stopped
directionForward TnimcTrue = axis moving forward
TnimcFalse = axis moving in reverse
indexCaptureOccurred TnimcTrue = encoder index position capture occurred
TnimcFalse = encoder index position not captured
positionCaptureOccurred TnimcTrue = position capture (trigger) occurred
TnimcFalse = position capture (trigger) pending or disabled
positionCompareOccurred TnimcTrue = position compare (breakpoint) occurred
TnimcFalse = position compare (breakpoint) pending or disabled
forwardLimitActive TnimcTrue = forward limit active
TnimcFalse = forward limit inactive
reverseLimitActive TnimcTrue = reverse limit active
TnimcFalse = reverse limit inactive
forwardSoftwareLimitActive TnimcTrue = forward software limit active
TnimcFalse = forward software limit inactive
reverseSoftwareLimitActive TnimcTrue = reverse software limit active
TnimcFalse = reverse software limit inactive
homeInputActive TnimcTrue = home input active
TnimcFalse = home input inactive
homeFound TnimcTrue = home position found
TnimcFalse = home position not found
indexFound TnimcTrue = index position found
TnimcFalse = index position not found
referenceFound TnimcTrue = reference position found
TnimcFalse = reference position not found

Example

To call this function on axis 2, use the following syntax:

TnimcAllAxisStatus data;
data.size = sizeof(TnimcAllAxisStatus);
nimcReadAllAxisStatus(boardID, 2, &data);

Note  You must specify the value for the size element of data before calling this function. If you do not properly set the size element, the function will return error –70023 (NIMC_parameterValueError).