flex_read_vs_pos_rtn |
Read Vector Space Position Return
Usage
status = flex_read_vs_pos_rtn(u8 boardID, u8 vectorSpace, i32* xPosition, i32* yPosition, i32* zPosition);
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 |
xPosition | i32* | x axis position in counts or steps |
yPosition | i32* | y axis position in counts or steps |
zPosition | i32* | z axis position in counts or steps |
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.
xPosition, yPosition, and zPosition are the positions in quadrature counts (for servo axes) or steps (for stepper axes) of the three axes in the vector space. For vector spaces with less than three axes, zero (0) is returned on the unused axes.
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. |