Function
Sets limit signal to valid/invalid.
Format
Ret = SmcWSetLimitMask( Id, AxisNo, LimitMask, LimitMaskEnable )
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.
LimitMask [ C, C++: short *] [ Python: ctypes.POINTER(ctypes.c_short) ]
Set limit signal to valid/invalid.
(It is changed for the bit specified in LimitMaskEnable)
[ 0 | 0 | 0 | 0 | 0 | 0 | ALM | SD ]
Meaning of signal
SD |
Deceleration stop limit |
ALM |
Alarm/urgent stop limit |
Setting value
0 |
limit valid |
1 |
limit invalid |
LimitMaskEnable [ C, C++: short *] [ Python: ctypes.POINTER(ctypes.c_short) ]
Sets the bit which you want to change limit signal.
[ 0 | 0 | 0 | 0 | 0 | 0 | ALM | SD ]
Meaning of signal
SD |
Stop limit of negative direction deceleration |
ALM |
Alarm/urgent stop limit |
Setting value
0 |
Do not change |
1 |
Change |
Return Value
Ret [ C, C++: long ] [ Python: ctypes.c_long ]
0 |
Terminated normally |
Non-zero |
Terminated abnormally |
See also: Error code details
Remarks
It can not be executed while motor is already in motion.
Example
Set to invalid of all limit mask of axis number 1.
C, C++
long Ret;
short LimitMask;
short LimitMaskEnable;
LimitMask = 0;
LimitMaskEnable = 0x3;
Ret = SmcWSetLimitMask( Id , 1, LimitMask, LimitMaskEnable ) ;
Python
Ret = ctypes.c_long()
LimitMask = ctypes.c_short()
LimitMaskEnable = ctypes.c_short()
LimitMask.value = 0
LimitMaskEnable.value = 0x3
Ret.value = csmc.SmcWSetLimitMask( Id , 1, LimitMask, LimitMaskEnable )
Set to valid of all limit mask of axis number 1
C, C++
long Ret;
short LimitMask;
short LimitMaskEnable ;
LimitMask = 0x3;
LimitMaskEnable = 0x3;
Ret = SmcWSetLimitMask( Id , 1, LimitMask, LimitMaskEnable ) ;
Python
Ret = ctypes.c_long()
LimitMask = ctypes.c_short()
LimitMaskEnable = ctypes.c_short()
LimitMask.value = 0x3
LimitMaskEnable.value = 0x3
Ret.value = csmc.SmcWSetLimitMask( Id , 1, LimitMask, LimitMaskEnable )
See Also