CntSetPresetRegister


Function

Sets the preset register. Supports multi-processing.

Format

Ret = CntSetPresetRegister ( Id , ChNo , PresetData , Reserved )

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.

PresetData [ C, C++ : unsigned int] [Python: ctypes.c_uint]
Specify the preset value.
Allowable setting range:
0h <= PresetData <= FFFFFFFFh

Reserved [ C, C++ : short] [Python: ctypes.c_short]
Specify 0.

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_SYS_CH_NO

20201

Channel number is outside the range.

The other errors: (See also: Details of Error Code)

Remarks

The value specified by this function is set in the preset register, and used when a given hardware condition occurs. To set a counter to a given value immediately, use the CntPreset function rather than this function.

Example

C, C++

Ret = CntSetPresetRegister (Id, 0, 10000, 0);
 

Python

Ret = ccnt.CntSetPresetRegister (Id, 0, 10000, 0)
 

See Also

CntSetCountMatchHardwareEvent