flex_read_target_pos

NI-Motion Functions

flex_read_target_pos

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 Target Position

Usage

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

Purpose

Reads the destination position of the current motion trajectory.

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 destination position of the motion trajectory currently in process. If the axis is stopped, it returns the target position of last trajectory completed.

Loading a new target position with Load Target Position does not affect the value read until a start motion occurs. When calling Blend Motion, the value read does not reflect the last target position loaded until after the blend occurs.

This function differs from the Read Position function in that it returns the commanded target (destination) position rather than the actual feedback position.