flex_read_target_pos_rtn

NI-Motion Functions

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

Usage

status = flex_read_target_pos_rtn(u8 boardID, u8 axis, i32* targetPosition);

Purpose

Reads the destination position of the current motion trajectory.

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)
axis u8 axis to read
targetPosition i32* destination position of the current motion trajectory in counts or steps

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.

targetPosition is the destination position of the current motion trajectory in counts (servo axes) or steps (stepper axes).

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.

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

Remarks

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

NI 73xx Controller Considerations

The following list includes considerations you must make when you are using this function with a 73xx motion controller:

  • 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.

NI SoftMotion Controller Considerations

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

  • The NI SoftMotion Controller returns the target position loaded regardless of whether the Start Motion function has been called.
  • The NI SoftMotion Controller returns the target position of individual axes, but does not return the target position loaded by the Load Vector Space Position function, even if the axis is configured as part of the vector space.

    The NI SoftMotion Controller does not support reading the target position of a vector space.