Function
Sets the internal clock value.
Format
Ret = CntSetSamplingInternalClock ( Id , Clock , Unit )
Parameters
Id
[C: short] [Python: ctypes.c_short]
Specifies the device ID retrieved from CntInit.
Clock
[C: int] [Python: ctypes.c_int]
Specify the clock value. The result value of clock value and clock value
unit can be set in the following range with clock value unit.
Device |
Available Range |
CNT-3204IN-USB |
2us <= Clock <= 107sec (25ns unit) |
Unit
[C: short] [Python: ctypes.c_short]
Clock value unit
Definition |
Value |
Description |
CNTS_TIM_UNIT_S |
1 |
1sec unit |
CNTS_TIM_UNIT_MS |
2 |
1ms unit |
CNTS_TIM_UNIT_US |
3 |
1us unit |
CNTS_TIM_UNIT_NS |
4 |
1ns unit |
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_MEMORY |
20000 |
It failed in memory allocation for the object preparation. |
CNT_ERR_SYS_USING_OTHER_PROCESS |
20003 |
Cannot use because another process is using the device. |
CNT_ERR_SYS_CLOCK_VAL |
21009 |
The clock value is out of range. |
CNT_ERR_SYS_CLOCK_UNIT |
21010 |
The unit of clock value is out of range. |
The other errors: (See also: Details of Error Code)
Initial Value
USB device : 20us
Remarks
In order to make the application operation regular, must set the internal clock value when the internal clock is used. This function should be executed in the setting stage before sampling starts.
Example
C |
Ret = CntSetSamplingInternalClock
(Id, 500, 2); |
Python |
Ret = ccnt.CntSetSamplingInternalClock
(Id, 500, 2) |
See Also