flex_read_trajectory_status_rtn

NI-Motion Functions

flex_read_trajectory_status_rtn

Device Compatibility

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

Read Trajectory Status Return

Usage

status = flex_read_trajectory_status_rtn(u8 boardID, u8 axisOrVectorSpace, u16 statusType, u16* status);

Purpose

Reads the selected motion trajectory status of all axes or vector spaces.

Tip  Refer to the Remarks section for information about how the behavior of this function differs between controllers.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
axisOrVectorSpace u8 selects axis control or vector space control for move complete, or axis control for all other types
statusType u16 status selector
status u16* bitmap of selected status for all axes

Parameter Discussion

axisOrVectorSpace can select multiple axes (NIMC_AXIS_CTRL) or multiple vector spaces (NIMC_VECTOR_SPACE_CTRL). Refer to Axes and Vector Spaces for axis and vector space resource IDs.

status is the bitmap of multi-axis or vector space status.

For axisOrVectorSpace = NIMC_AXIS_CTRL:

D15 ...  D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Axis 15 ... Axis 10 Axis 9 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1 0

For axisOrVectorSpace = NIMC_VECTOR_SPACE_CTRL:

D15 ...  D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
VS 15 ... VS 10 VS 9 VS 8 VS 7 VS 6 VS 5 VS 4 VS 3 VS 2 VS 1 0

D1 through D15 (axes) or D1 through D15 (vector spaces):
   For NIMC_RUN_STOP_STATUS:
      1 = Axis running
      0 = Axis stopped

   For NIMC_MOTOR_OFF_STATUS:
      1 = Axis off
      0 = Axis on

   For NIMC_VELOCITY_THRESHOLD_STATUS:
      1 = Velocity above threshold
      0 = Velocity below threshold

   For NIMC_MOVE_COMPLETE_STATUS:
      1 = Move complete
      0 = Move not complete

Using This Function

This function returns a multi-axis status bitmap of the status type selected. You can select one of the following three trajectory status types:

NIMC_RUN_STOP_STATUS
Run/Stop status is updated based on the filtered velocity and run/stop criteria set by Load Run/Stop Threshold. The status is set when the axis is travelling fast enough to be considered running. The axis is considered to be running when the change in position per sample period exceeds the Run/Stop threshold set with the Load Run/Stop Threshold function.

NIMC_MOTOR_OFF_STATUS
A motor can be Off for two reasons. Either a kill stop was executed or the following error trip point was exceeded. A Motor Off condition also means that an enabled inhibit output is active. Refer to the Configure Inhibit Outputs function for more information.

NIMC_VELOCITY_THRESHOLD_STATUS
The Velocity Threshold status indicates if the axis velocity is above (True) or below (False) the programmed velocity threshold. Refer to the Load Velocity Threshold function for information about setting and using a velocity threshold.

NIMC_MOVE_COMPLETE_STATUS
The Move Complete status indicates if an axis or vector space is in the move complete state, which is the default when an axis or vector space is idle. While a move is in progress, the move complete status is false. For a move to be complete on a vector space, the move complete status must be true on all axes in the vector space.

During a vector space move, if one axis in a vector space trips out on a following error, that axis is killed, and the move complete status remains false. The other axes in the vector space decelerate to a stop, and the move complete status is true. For the vector space as a whole, the move complete status is false, because the move did not complete properly.

Use the Configure Move Complete Criteria function to change the conditions that cause a move to be evaluated as complete. For example, by changing the move complete criteria to be profile complete (default) OR motor off, the previous situation would result in a true move complete status when one of the axes in the vector space exceeded the programmed following error limit.

Note  You can get all four trajectory statuses for a single axis by calling the Read per Axis Status function.

Example
To get Motor Off status, call the Read Trajectory Status function with axisOrVectorSpace = NIMC_AXIS_CTRL and statusType = NIMC_MOTOR_OFF_STATUS. Assume the returned status = 0x0062. This corresponds to the following bitmap:

D15 ... D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Axis 15 ... Axis 10 Axis 9 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1 0
0 ... 0 0 0 0 1 1 0 0 0 1 0

For your programming convenience, two utility functions—Check Move Complete Status and Wait for Move Complete—are provided, which allow you to specify an axis, vector space, group of axes, or group of vector spaces, and find out if a move is complete, or wait until a move is complete. These functions return a simple true/false value indicating if a move is complete.

Remarks

This section includes information about how the behavior of this function differs among the controllers that support it.

NI SoftMotion Controller Considerations

The following includes considerations you must make when you are using this function with the NI SoftMotion Controller:

To read the trajectory status on axes sixteen through thirty, use the Read per Axis Status function.