flex_read_vs_pos

NI-Motion Functions

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

Usage

status = flex_read_vs_pos(u8 boardID, u8 vectorSpace, u8 returnVector);

Purpose

Reads the position of all axes in a vector space.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
vectorSpace u8 vector space to read
returnVector u8 destination for the return data

Parameter Discussion

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

inputVector indicates the source data for this function. Available input vectors include input 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 instantaneous positions of the axes in the specified vector space. For servo axes, it returns the primary feedback position in 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 function always returns the position of the primary feedback resource.