Function
Sets the operation mode. (Number of phases, Clear, Multiplier)
Format
Ret = CntSetOperationMode ( Id , ChNo , Phase , Mul , SyncClr )
Parameters
Id
[ C, C++ : short] [Python: ctypes.c_short]
Specifies the device ID retrieved from CntInit.
ChNo
[ C, C++ : short] [Python: ctypes.c_short]
Specifies the channel number which you want to set.
Phase
[ C, C++ : short] [Python: ctypes.c_short]
Specifies the number of phases. Select the number of phases from the following
defined values.
Definition |
Value |
Description |
CNT_MODE_1PHASE |
0 |
1-phase |
CNT_MODE_2PHASE |
1 |
2-phase |
CNT_MODE_GATECONTROL |
2 |
Gate control |
Mul
[ C, C++ : short] [Python: ctypes.c_short]
Specifies the multiplier. Select the multiplier from the following defined
values.
Definition |
Value |
Description |
CNT_MUL_X1 |
0 |
1X |
CNT_MUL_X2 |
1 |
2X |
CNT_MUL_X4 |
2 |
4X |
SyncClr
[ C, C++ : short] [Python: ctypes.c_short]
Specifies synch clear/async clear. Select it from the following defined
values.
Definition |
Value |
Description |
CNT_CLR_ASYNC |
0 |
Async clear |
CNT_CLR_SYNC |
1 |
Synch clear |
Return Value
Ret [ C, 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_DLL_MODE |
10100 |
Invalid mode setting. |
CNT_ERR_SYS_MODE |
20100 |
Invalid mode setting. |
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
Specifies the mode for the specified channel. The setting in this function is effective after the counter starts.
Example
C, C++ |
Ret = CntSetOperationMode(Id,
ChNo, Phase, Mul, SyncClr); |
Python |
Ret = ccnt.CntSetOperationMode(Id,
ChNo, Phase, Mul, SyncClr) |
See Also