flex_read_axis_status

NI-Motion Functions

flex_read_axis_status

Device Compatibility

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

Read per Axis Status

Usage

status = flex_read_axis_status(u8 boardID, u8 axis, u8 returnVector);

Purpose

Reads the motion status on a per-axis basis.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
axis u8 axis to read
returnVector u8 destination for the return data

Parameter Discussion

axis is the axis to read. Valid values are NIMC_AXIS1 through NIMC_AXIS30. On motion controllers that support fewer than thirty axes, reading non-existent axes returns error –70006 (NIMC_badResourceIDOrAxisError). Refer to Axes for axis resource IDs.

returnVector indicates the destination for the return data generated by this function. Available return vectors include return data to the host (0xFF), to a variable (0x01 through 0x78), to an indirect variable (0x81 through 0xF8), and return no data (0). Refer to Input and Return Vectors for more detailed information.

Note  The suffix _rtn on the function indicates that the data must be returned to the host. When this calling convention is used, no returnVector is required.

Using This Function

This function returns the trajectory and motion I/O status for the specified axis. It also returns the success or failure status of the most recent Find Reference sequences.

This function returns any one of the values shown in the bitmap in the Example section.

Note  This function returns undefined values for axes that are currently performing find reference moves.
Note  You also can read individual item status in a multi-axis format with NI-Motion functions like Read Axis Limit Status, Read Trajectory Status, and so on.

Example

Read per Axis Status is called on axis 4 and the function returns axisStatus = 0xBE02.

The returned value 0xBE02 corresponds to the following bitmap:

D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
MC BC Dir HSC IF HF BP VT Reserved S/W
Limit
Home Limit FE MOff PC R/S
1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0

The following list describes each of the bitmap elements:

D0 Run/Stop Status (R/S):
   1 = Axis running
   0 = Axis stopped

D1 Profile Complete (PC):
   1= Profile complete
   0 = Profile generation in process

D2 Motor Off (Moff):
   1 = Motor off (killed)
   0 = Motor on

D3 Following Error (FE):
   1 = Axis exceeded the programmed following error limit
   0 = 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.

D4 Limit Input (Limit):
   1 = Forward or reverse limit input active
   0 = Neither limit active

D5 Home Input (Home):
   1 = Home input active
   0 = Home input not active

D6 Software Limit (S/W Limit):
   1 = Forward or reverse software limit reached
   0 = Neither software limit reached

D7 Reserved

D8 Velocity Threshold (VT):
   1 = Velocity above threshold
   0 = Velocity below threshold

D9 Breakpoint (BP):
   1 = Breakpoint occurred
   0 = Breakpoint pending or disabled

D10 Home Found (HF):
   1 = Home found during last Find Home
   0 = Find Home sequence in process or home not found

D11 Index Found (IF):
   1 = Encoder Index found during last Find Index
   0 = Find Index sequence in process or index not found

D12 High Speed Capture (HSC):
   1 = High speed capture occurred
   0 = High speed capture pending

D13 Direction (Dir):
   0 = Reverse occurred
   1 = Forward

D14 Blend Complete (BC):
   1 = Blend is complete occurred
   0 = Blend is pending

D15 Move Complete (MC):
   1 = Move is complete occurred
   0 = Move is not complete