CntSamplingSetBuffer


Function

Sets the sampling buffer.

Format

Ret = CntSamplingSetBuffer ( Id , Buffer , ChNum , ScanNum , IsRing )

Parameters

Id [C: short] [Python: ctypes.c_short]
Specify the device ID retrieved from CntInit.

Buffer [C: unsigned int *] [Python: ctypes.POINTER(ctypes.c_uint)]
Specify the base address of buffer.

ChNum [C: short] [Python: ctypes.c_short]
Specify the number of channels in buffer.

ScanNum [C: unsigned int] [Python: ctypes.c_uint]
Specify the scan number of buffer.

Device Name

Available Range

CNT-3204IN-USB

ChNum(number of channels) * ScanNum(number of data) * 4Byte(data unit) <= 64MByte

IsRing [C: short] [Python: ctypes.c_short]
Sets whether the buffer is used once per transfer, or is used as a ring buffer.

Definition

Value

Description

CNTS_WRITE_ONCE

0

Once transfer

CNTS_WRITE_RING

1

Infinite time transfer

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_DLL_BUFF_ADDRESS

10101

Invalid data buffer address.

CNT_ERR_SYS_MEMORY

20000

IIt 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_BUFFER

21100

Because the buffer was too large, it was not possible to secure it.

CNT_ERR_SYS_LOCK_MEMORY

21101

The memory cannot be locked.

CNT_ERR_SYS_SEQUENCE

21102

Execution procedure error

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

Remarks

Execute the buffer setting before transfer starts every time. Depending on the memory status of system, there is a possibility that 64MByte area can not be set.

The execution procedure error occurs when this function is executed in sampling. Execute it after confirming sampling was completed.

Example

C

Ret = CntSamplingSetBuffer ( Id , &Buffer[0] , 1 , 10000 , CNTS_WRITE_RING );
 

Python

Ret = ccnt.CntSamplingSetBuffer ( Id , Buffer , 1 , 10000 , ccnt.CNTS_WRITE_RING )
 

See Also

CntSamplingStart