Read Trajectory Status

NI-Motion VI

Read Trajectory Status

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

Details

Device Compatibility

DeviceCompatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Accelnet
Y
NI SoftMotion Controller for CANopen—Xenus
Y
Status Type is the selector for the type of trajectory status to read.

Value Definition
0 Run/Stop
1 Motor Off
2 Velocity Threshold
3 Move Complete
Board ID is a unique number assigned by Measurement & Automation Explorer (MAX) used to send and receive commands and data to or from a specific NI motion controller.
Axis or Vector Space selects axis, axis control, vector space, or vector space control for move complete, or axis or axis control for all other types.
Ret Vect indicates the destination for the return data generated by this VI. Available return vectors include return data to the host (0xFF), return data to a variable (0x01 through 0x78), return data to an indirect variable (0x81 through 0xF8), and do not return data (0). Refer to Input and Return Vectors for more detailed information.
error in (no error) describes error conditions that occur before this VI runs. The default input of this cluster is no error. If an error already occurred, this VI returns the value of error in in error out. The VI runs normally only if no incoming error exists. Otherwise, the VI passes the error in value to error out. The error in cluster contains the following parameters:
status is TRUE if an error occurred before this VI was called, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.
Status is the bitmap of multi-axis or vector space status.

For Run/Stop status:

Status 1—If true, axis is running. If false, axis has stopped.
Status 2—If true, axis is running. If false, axis has stopped.
Status 3—If true, axis is running. If false, axis has stopped.
Status 4—If true, axis is running. If false, axis has stopped.
Status 5—If true, axis is running. If false, axis has stopped.
Status 6—If true, axis is running. If false, axis has stopped.
Status 7—If true, axis is running. If false, axis has stopped.
Status 8—If true, axis is running. If false, axis has stopped.

For Motor Off status:

Status 1—If true, axis is off. If false, axis is on.
Status 2—If true, axis is off. If false, axis is on.
Status 3—If true, axis is off. If false, axis is on.
Status 4—If true, axis is off. If false, axis is on.
Status 5—If true, axis is off. If false, axis is on.
Status 6—If true, axis is off. If false, axis is on.
Status 7—If true, axis is off. If false, axis is on.
Status 8—If true, axis is off. If false, axis is on.

For Velocity Threshold status:

Status 1—If true, velocity is above the threshold. If false, velocity is below the threshold.
Status 2—If true, velocity is above the threshold. If false, velocity is below the threshold.
Status 3—If true, velocity is above the threshold. If false, velocity is below the threshold.
Status 4—If true, velocity is above the threshold. If false, velocity is below the threshold.
Status 5—If true, velocity is above the threshold. If false, velocity is below the threshold.
Status 6—If true, velocity is above the threshold. If false, velocity is below the threshold.
Status 7—If true, velocity is above the threshold. If false, velocity is below the threshold.
Status 8—If true, velocity is above the threshold. If false, velocity is below the threshold.

For Move Complete:

Status 1—If true, move is complete. If false, move is not complete.
Status 2—If true, move is complete. If false, move is not complete.
Status 3—If true, move is complete. If false, move is not complete.
Status 4—If true, move is complete. If false, move is not complete.
Status 5—If true, move is complete. If false, move is not complete.
Status 6—If true, move is complete. If false, move is not complete.
Status 7—If true, move is complete. If false, move is not complete.
Status 8—If true, move is complete. If false, move is not complete.
Bd ID Out is provided for flow control. You can string together NI-Motion VIs by wiring the Bd ID Out terminal of one VI to the Board ID terminal of the next VI.
Resource Output is the Axis, Vector Space, ADC, or Encoder you wired into the VI. Use Resource Output to pass the resource to another VI and/or to display information about the device.
error out contains error information. If error in indicates an error, error out contains the same error information. Otherwise, it describes the error status that this VI produces.
status is TRUE if an error occurred, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.

Using This VI

The Read Trajectory Status VI returns a multi-axis status bitmap of the status type selected. You can select one of the following three trajectory status types:

Run/Stop Status

Run/Stop status is updated based on filtered velocity and run/stop criteria set by the Load Run/Stop Threshold VI. 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 VI.

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 VI for more information.

Velocity Threshold Status

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

Move Complete

The Move Complete status indicates whether 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 VI 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 VI.

Example

To get Motor Off status, call the Read Trajectory Status VI with Axis or Vector Space = Axis Control and Status Type = Motor Off. Assume the returned Status is as follows.

Axis/VS 1  Axis/VS 2  Axis/VS 3  Axis/VS 4   Axis 5 Axis 6 Axis 7 Axis 8
True  False  False  True   False  False  False  False 

Axes 1 and 4 are Off.

For your programming convenience, two utility VIs—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 VIs return a simple true/false value indicating whether or not a move is complete.