flex_load_vs_pos

NI-Motion Functions

flex_load_vs_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 Vector Space Position

Usage

status = flex_load_vs_pos(u8 boardID, u8 vectorSpace, i32 xPosition, i32 yPosition, i32 zPosition, u8 inputVector);

Purpose

Loads the axis target positions for the next vector space move.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
vectorSpace u8 vector space to control
xPosition i32 x axis target position in counts or steps
yPosition i32 y axis target position in counts or steps
zPosition i32 z axis target position in counts or steps
inputVector u8 source of the data for this function

Parameter Discussion

vectorSpace is the vector space to control. Valid values are NIMC_VECTOR_SPACE1 through NIMC_VECTOR_SPACE15. On motion controllers that support fewer than thirty axes, configuring non-existent vector spaces returns error –70006 (NIMC_badResourceIDOrAxisError). Refer to Vector Spaces for vector space resource IDs.

xPosition, yPosition, and zPosition are the specified axis target positions for the next vector space 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 position is zero (0).

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

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 up to three axis target positions for the vector space specified. This function is identical to calling the Load Target Position function up to three times, one time per each axis in the vector space. Position values indicate the specified end location and direction of motion (target position).

Target positions are double-buffered so you can load them on the fly without affecting the move in process, and they take effect on the next Start Motion or Blend Motion function. When the target positions are loaded, they are interpreted as either absolute target positions, relative target positions, target positions relative to the last captured positions 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 axes in the vector space follows the programmed trajectory and end up at the absolute, relative, or modulo target positions.

Note  If you are doing onboard programming and are using inputVector  to get the data this function needs, note that this function reads the variables starting at the memory address pointed to by inputVector in the following order: xPosition, yPosition, zPosition.
Note  If the vector space contains less than three axes, the extra target position values are ignored.
Note  Refer to Function Execution Times for benchmark timing information about your controller.