Function
Gets the operation mode. (Number of phases, Clear, Multiplier)
Format
Ret = CntGetOperationMode ( Id , ChNo , Phase , Mul , SyncClr )
Parameters
Id
[ C: short ] [ Python: ctypes.c_short ]
Specifies the device ID retrieved from CntInit.
ChNo
[ C: short ] [ Python: ctypes.c_short ]
Specifies the channel number which you want to get for.
Phase
[ C: short * ] [ Python: ctypes.POINTER(ctypes.c_short) ]
Specifies the address of the variable that stores the number of phases.
As for the number of phases, one of the following defined values is returned.
Definition |
Value |
Description |
CNT_MODE_1PHASE |
0 |
Mono-phase |
CNT_MODE_2PHASE |
1 |
2-phase |
CNT_MODE_GATECONTROL |
2 |
Gate control |
Mul
[ C: short * ] [ Python: ctypes.POINTER(ctypes.c_short) ]
Specifies the address of the variable that stores the multiplier. As for
multiplier, one of the following defined values is returned.
Definition |
Value |
Description |
CNT_MUL_X1 |
0 |
1X |
CNT_MUL_X2 |
1 |
2X |
CNT_MUL_X4 |
2 |
4X |
SyncClr
[ C: short * ] [ Python: ctypes.POINTER(ctypes.c_short) ]
Specifies the address of the variable that stores synch clear/async clear
As for clear, either of the following defined values is returned.
Definition |
Value |
Description |
CNT_CLR_ASYNC |
0 |
Async clear |
CNT_CLR_SYNC |
1 |
Synch clear |
Return Value
Ret [ C: long ] [ Python: ctypes.c_long ]
Definition |
Value |
Description |
CNT_ERR_SUCCESS |
0 |
Normal Complete |
CNT_ERR_DLL_INVALID_ID |
10001 |
Invalid ID is specified. |
CNT_ERR_DLL_CALL_DRIVER |
10002 |
Driver cannot be called (failed in ioctl). |
CNT_ERR_SYS_CH_NO |
20201 |
Channel number is outside the range. |
The other errors: (See also: Details of Error Code)
Initial Value
2-phase, 1X, Async clear
Remarks
Gets the mode for the specified channel.
Example
C |
Ret
= CntGetOperationMode(Id, ChNo, &Phase, &Mul, &SyncClr); |
Python |
Ret
= ccnt.CntGetOperationMode(Id, ChNo, ctypes.byref(Phase), ctypes.byref(Mul),
ctypes.byref(SyncClr)) |
See Also
CntSetOperationMode