Function
The operation set up information of the counter is acquired.
Format
Ret = SmcWGetCounterMode( Id, AxisNo, ClearCntLtc, LtcMode, ClearCntClr, ClrMode )
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 the axis number.
ClearCntLtc [ C, C++: short * ] [ Python: ctypes.POINTER(ctypes.c_short) ]
Specify the address of a variable to store the type of counter you want to clear when the LTC signal changes from OFF to ON.
0 |
Do not clear the counter |
1 |
Clear the output pulse counter |
2 |
Clear the encoder counter |
3 |
Clear the output pulse counter and encoder counter |
LtcMode [ C, C++: short * ] [ Python: ctypes.POINTER(ctypes.c_short) ]
Specify the address of a variable to store the type of counter you want to latch when the LTC signal comes in.
0 |
Do not use latch function |
1 |
Latch the output pulse counter |
2 |
Latch the encoder counter |
3 |
Latch the output pulse counter and encoder counter |
ClearCntClr [ C, C++: short * ] [ Python: ctypes.POINTER(ctypes.c_short) ]
Specify the address of a variable to store the type of counter you want to clear when the CLR signal changes from OFF to ON.
0 |
Do not clear the counter |
1 |
Clear the output pulse counter |
2 |
Clear the encoder counter |
3 |
Clear the output pulse counter and encoder counter |
ClrMode (Reserved) [ C, C++: short * ] [ Python: ctypes.POINTER(ctypes.c_short) ]
0 fixed.
Return Value
Ret [ C, C++: long ] [ Python: ctypes.c_long ]
0 |
Terminated normally |
Non-zero |
Terminated abnormally |
See also: Error code details
Initial Value
ClearCntLtc |
0H : Do not clear |
LtcMode |
0H : Do not use |
ClearCntClr |
0H : Do not clear |
ClrMode |
0 fixed |
Remarks
This function can be executed even if the device is in operation.
Example
The set up information of the encoder counter of axis number 1 is acquired.
C, C++
long Ret;
short ClearCntLtc ;
short LtcMode ;
short ClearCntClr ;
short ClrMode ;
Ret = SmcWGetCounterMode( Id , 1, &ClearCntLtc , &LtcMode , &ClearCntClr , &ClrMode );
Python
Ret = ctypes.c_long()
ClearCntLtc = ctypes.c_short()
LtcMode = ctypes.c_short()
ClearCntClr = ctypes.c_short()
ClrMode = ctypes.c_short()
Ret.value = csmc.SmcWGetCounterMode( Id , 1, ctypes.byref(ClearCntLtc) ,ctypes.byref(LtcMode) , ctypes.byref(ClearCntClr) , ctypes.byref(ClrMode) )
See Also