CntSetSamplingInternalClock


Function

Sets the internal clock value.

Format

Ret = CntSetSamplingInternalClock ( Id , Clock , Unit )

Parameters

Id [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specify the device ID retrieved from CntInit.

Clock [ VB.NET: Integer ] [ C, C++: unsigned long ] [ C#: uint ] [ Python: ctypes.c_ulong ]
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)

CNT32-8M(PCI)

CNT32-4MT(LPCI)

CNT-3204MT-LPE

CNT-3208M-PE

50ns <= Clock <= 107sec (25ns unit)

Unit [ VB.NET: Short ] [ C, C++: short ] [ 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 [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]

Definition

Value

Description

CNT_ERR_SUCCESS

0

Normality completion

CNT_ERR_SYS_RECOVERED_FROM_STANDBY

7

Execute the function CntResetDevice to return from the standby mode.

CNT_ERR_DLL_INVALID_ID

10001

Invalid ID was specified.

CNT_ERR_DLL_CALL_DRIVER

10002

CNT driver can't be called (Failed in the device I/O control).

CNT_ERR_SYS_MEMORY

20000

It failed in memory allocation for the object preparation.

CNT_ERR_SYS_NOT_SUPPORTED

20001

This function can't be used by this device.

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 others: (See also: Details of Error Code)

Initial Value

USB device : 20us
Other device : 1us

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

Sets the internal clock to 500msec.

VB.NET

Dim Ret As Integer
Ret = CntSetSamplingInternalClock ( Id , 500 , 2 )
 

C, C++

long Ret;
Ret = CntSetSamplingInternalClock ( Id , 500 , 2 );
 

C#

int Ret;
Ret = cnt.SetSamplingInternalClock ( Id , 500 , 2 );
 

Python

Ret = ctypes.c_long()
Ret.value = ccnt.CntSetSamplingInternalClock ( Id , 500 , 2 )
 

See Also

CntSetSamplingClockTrigger