flex_load_target_pos

NI-Motion Functions

flex_load_target_pos

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

Load Target Position

Usage

status = flex_load_target_pos(u8 boardID, u8 axis, i32 targetPosition, u8 inputVector);

Purpose

Loads the target position for the next axis move.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
axis u8 axis to control
targetPosition i32 target position in counts or steps
inputVector u8 source of the data for this function

Parameter Discussion

axis is the axis to control. Valid values are NIMC_AXIS1 through NIMC_AXIS30. On motion controllers that support fewer than thirty axes, configuring non-existent axes returns error –70006 (NIMC_badResourceIDOrAxisError). Refer to Axes for axis resource IDs.

targetPosition is the specified target position for the next axis move in counts (servo axes) or steps (stepper axes). Target positions can be anywhere within the 32-bit position range, –(231) to +(231–1). The default value for target position is zero (0).

Caution  Any single move is limited to ±(231–1) counts or steps. An error is generated if you exceed this limit by loading a target position too far from the current axis position.

inputVector indicates the source of the data for this function. Available input vectors include immediate (0xFF), variable (0x01 through 0x78), or indirect variable (0x81 through 0xF8). Refer to Input and Return Vectors for more detailed information.

Using This Function

This function loads a target position to the axis specified. Target positions can be for single axis moves, multi-axis coordinated moves, or vector space moves. Position values indicate the specified end location and direction of motion (target position).

Target position is double-buffered so you can load it on the fly without affecting the move in process, and it take effect on the next Start or Blend Motion function. When the target position is loaded, it is interpreted as either an absolute target position, a relative target position, a target position relative to the last captured position or with the effect of a position modulus, depending on the mode set with the Set Operation Mode function.

This means that if you set the operation mode to NIMC_RELATIVE_TO_CAPTURE, you must load the target position after the capture has occurred because the position is evaluated on load.

After you execute the start or blend, the axis or axes follows the programmed trajectory and end up at the absolute, relative, or modulo target position.

Note  Refer to Function Execution Times for benchmark timing information about your controller.