EtherCAT Programming Guide General Operation of Motion Axis
March, 2017 8-17
8
8.13 _ECAT_Slave_Motion_Get_Position
Syntax
U16 PASCAL _ECAT_Slave_Motion_Get_Position(U16 CardNo, U16 AxisNo, U16 SlotNo, I32
*Position)
Purpose
This is for acquiring the current position of the axis.
When applying the function of enabling virtual position (_ECAT_Slave_CSP_Virtual_Set_Enable)
in section 9.29, users can acquire the master’s virtual position with this API. The virtual position
here signifies the master’s position before compensation, which is the machine’s actual target
position desired by users.
Parameter
Name Data type Property Description
CardNo U16 Number Card No.
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
Position I32* Value Get the current position of the axis.
Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0;
I32 Position=0;
Status = _ECAT_Slave_Motion_Get_Position (CardNo, AxisNo, SlotNo, &Position);