Read Execution Data

NI-Motion VI

Read Execution Data

Reads position, velocity, and following error information on an axis or coordinate. You can use this polymorphic VI to read execution data of a single axis attribute, all execution data information from an axis, position information for all axes in a coordinate, or velocity or following error information for a coordinate.

Use the pull-down menu to select an instance of this VI.

Details

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 Axis Data

attribute is the attribute you want to read. The following are valid attributes:
  • position—Returns the position to the double element of the data cluster.
  • velocity—Returns the velocity to the double element of the data cluster.
  • following error—Returns the following error to the double element of the data cluster.
board in is a unique number assigned by Measurement & Automation Explorer used to send and receive commands and data to or from a specific NI motion controller.
axis in is the axis to read with this VI.
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.
data is a cluster of variables that contains the values for the selected attribute. Read the correct element of the cluster for the attribute. The values of the other elements in the cluster are undefined.
integer is 32-bit integer data.
double is 64-bit floating point data.
Boolean is Boolean data.
board out is provided for flow control. You can string together NI-Motion VIs by wiring the board out terminal of one VI to the board in terminal of the next VI.
axis out is provided for flow control. You can string together NI-Motion VIs by wiring the axis out terminal of one VI to the axis in terminal of the next VI.
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.

Read All Axis Data

board in is a unique number assigned by Measurement & Automation Explorer used to send and receive commands and data to or from a specific NI motion controller.
axis in is the axis to read with this VI.
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.
axis data is the data record containing axis execution data.
position contains axis position information.
velocity contains filtered velocity in counts/s (for servo axes) or steps/s (for stepper axes). The sign of velocity indicates direction of motion.
following error contains the instantaneous difference between the commanded trajectory position and the actual feedback position in counts for servo systems and steps for stepper systems.
encoder position contains the quadrature count value of the encoder mapped to the selected axis.
board out is provided for flow control. You can string together NI-Motion VIs by wiring the board out terminal of one VI to the board in terminal of the next VI.
axis out is provided for flow control. You can string together NI-Motion VIs by wiring the axis out terminal of one VI to the axis in terminal of the next VI.
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.

Read Coordinate Data

attribute is the attribute you want to read. The following are valid attributes:
  • velocity—Returns the velocity to the double element of the data cluster.
  • following error—Returns the following error to the double element of the data cluster.
board in is a unique number assigned by Measurement & Automation Explorer used to send and receive commands and data to or from a specific NI motion controller.
coordinate in is the coordinate to read with this VI.
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.
data is a cluster of variables that contains the values for the selected attribute. Read the correct element of the cluster for the attribute. The values of the other elements in the cluster are undefined.
integer is 32-bit integer data.
double is 64-bit floating point data.
Boolean is Boolean data.
board out is provided for flow control. You can string together NI-Motion VIs by wiring the board out terminal of one VI to the board in terminal of the next VI.
coordinate out is provided for flow control. You can string together NI-Motion VIs by wiring the coordinate out terminal of one VI to the coordinate in terminal of the next VI.
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.

Read Coordinate Position

board in is a unique number assigned by Measurement & Automation Explorer used to send and receive commands and data to or from a specific NI motion controller.
coordinate in is the coordinate to read with this VI.
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.
positions is the array containing the coordinate position information.
board out is provided for flow control. You can string together NI-Motion VIs by wiring the board out terminal of one VI to the board in terminal of the next VI.
coordinate out is provided for flow control. You can string together NI-Motion VIs by wiring the coordinate out terminal of one VI to the coordinate in terminal of the next VI.
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

Caution  If this VI uses reflective memory, it should not be used for event checking. In this case, only use the information returned by this VI for display purposes. Refer to Reflective Memory VIs for more information.
Note  Because of the way the controller updates information, the values returned are not guaranteed to all be sampled in the same time slice.

Axis Data Instances

The single axis versions of this VI return execution data on the selected axis.

For open-loop stepper axes, the VI returns position information in number of steps generated. For closed-loop stepper axes, it converts the primary feedback position from counts to steps and then returns the value in steps. Closed-loop stepper axes require you to correctly load values of steps per revolution and counts per revolution to function correctly.

Note  For closed-loop axes, this VI always returns the position of the primary feedback resource. Refer to the Read Coordinate Position instance of this VI for an easy way to read the positions of all axes in a coordinate in one call.

For axis velocity, this VI returns filtered velocity in counts/s (for servo axes) or steps/s (for stepper axes). The sign of velocity indicates direction of motion.

For axis following error, this VI returns the instantaneous difference between the commanded trajectory position and the actual feedback position in counts for servo systems and steps for stepper systems.

Encoder position data is in quadrature count value of the encoder mapped to the selected axis.

During axis setup, you can operate the closed-loop stepper axis in open-loop mode and use this VI to directly measure the counts per revolution and steps per revolution for the axis. These values must be loaded before for subsequent closed-loop operation. Refer to the Load Counts/Steps per Revolution VI for more information.

You also can use encoder position to return a finer reading of position in cases where the encoder resolution greatly exceeds the step resolution of the closed-loop stepper axis.

Coordinate Data Instances

For the coordinate versions of this VI, data is returned on all axes in the specified coordinate.

For velocity, this VI returns the filtered coordinate velocity for the coordinate move. The velocity is calculated using the root-mean-square of the filtered velocities of the individual axes that make up the coordinate.

For following error, this VI returns the instantaneous difference between the commanded trajectory position and the actual feedback position in counts for servo systems and steps for stepper systems. The coordinate following error is calculated using the root-mean-square of the following errors for the individual axes that make up the coordinate.

For servo axes, this VI returns the primary feedback position in quadrature counts. For open-loop stepper axes, it returns the number of steps generated. For closed-loop stepper axes, it converts the primary feedback position from counts to steps and then returns the value in steps. Closed-loop stepper axes require correctly loaded values of steps per revolution and counts per revolution to function correctly.

Note  For closed-loop axes, this VI always returns the position of the primary feedback resource.
Note  Refer to VI Execution Times for benchmark timing information about your controller.