Function
Sets stop position of the motor(total number of output pulses).
Format
Ret = SmcWSetStopPosition( Id, AxisNo, Coordinate, StopPosition )
Parameters
Id [ C, C++: short ] [ Python: ctypes.c_short ]
Specify the device ID retrieved by SmcWInit function.
AxisNo [ C, C++: short ] [ Python: ctypes.c_short ]
Specify axis number.
Coordinate [ C, C++: short ] [ Python: ctypes.c_short ]
Set position coordinate.
0: Absolute coordinate
1: Relative coordinate
Valid value : 0, 1
StopPosition [ C, C++: int ] [ Python: ctypes.c_int ]
Set stop position.
Valid range:
Absolute coordinate: -134,217,728 to +134,217,727
Relative coordinate: -134,217,728 to +134,217,727 (except for 0)
Return Value
Ret [ C, C++: long ] [ Python: ctypes.c_long ]
0 |
Terminated normally |
Non-zero |
Terminated abnormally |
See also: Error code details
Remarks
Because movement distance is "0" when you specify absolute coordinate to Coordinate and specify the retrieved value by SmcWGetOutPulse to StopPosition, the return value is error completion.
If Coordinate is specified
to absolute coordinate, the position of [0] is as a datum point.
The coordinate is the value retrieved by SmcWGetOutPulse. And, it
can be preset by SmcWSetOutPulse.
For example, if the current position is as a datum point, preset to [0]
by SmcWSetOutPulse.
Example
The position (number of
total output pulses) where the motor of axis number 1 is stopped is set.
1000 pulses are set by relative coordinates.
C, C++
long Ret;
short Coordinate ;
int StopPosition ;
Coordinate = 1;
StopPosition = 1000;
Ret = SmcWSetStopPosition( Id , 1, Coordinate , StopPosition ) ;
Python
Ret = ctypes.c_long()
Coordinate = ctypes.c_short()
StopPosition = ctypes.c_int()
Coordinate.value = 1
StopPosition.value = 1000
Ret.value = csmc.SmcWSetStopPosition( Id , 1, Coordinate , StopPosition )
See Also