GetGroupPosition
Gets a group's position in the selected coordinate system of an axis group.
Syntax
KsError GetGroupPosition(
int Index,
McCoordSystem CoordSystem,
McSource Source,
int BufferLength,
double* Position
);
Parameters
Index [in]: the index of an axis group. Indexes are zero based. Aliases affect this parameter. You can have up to 32 groups.
CoordSystem [in]: a coordinate system. See the McCoordSystem type.
Source [in]: selects the group's position value to read. See the McSource type.
BufferLength [in]: the length of the Position array.
Position [out]: the current position of the group. It's the positions of the different axes.
Return value
If the function succeeds, it returns errNoError
, otherwise an error code. For more information about the error code, see the KsError list.
Example
VOID MoveAbsolute(INT Group, DOUBLE PositionX, DOUBLE PositionY) {
DOUBLE Position[2] = { PositionX, PositionY };
//Start an absolute move.
KsCommandStatus move = WaitForCommand(30, TRUE, MoveLinearAbsolute(Group, 2, Position,
3600, 36000, 36000, 3600000,
mcAxisCoordSystem, mcAborting, mcNone, NULL));
GetGroupActualPosition(Group, mcAxisCoordSystem, mcActualValue, 2, Position);
RtPrintf("Current Position: %d,%d\n", (int)Position[0], (int)Position[1]);
}
Requirements
RT | Win32 | |
---|---|---|
Minimum supported version | 4.0 | 4.0 |
Header | ksmotion.h | ksmotion.h |
Library | KsApi_Rtss.lib | KsApi.lib |
See also