DioSetCountEdge


Function

Sets the count edge.

Format

Ret = DioSetCountEdge ( Id , ChNo , ChNum , CountEdge )

Parameters

Id [C:short] [Python: ctypes.c_short]
Specifies the device ID retrieved from DioInit.

ChNo [C:short *] [Python: ctypes.POINTER(ctypes.c_short)]
Specifies the start address of the array that stores the channel numbers to get setting.

ChNum [C:short *] [Python: ctypes.POINTER(ctypes.c_short)]
Specifies the start address of the array that stores the channel numbers to get setting.

CountEdge [C:short *] [Python: ctypes.POINTER(ctypes.c_short)]
Specifies the start address of the array that stored the following edge settings by OR.

Definition

Value

[Dec]

Description

DIO_COUNT_EDGE_UP

1

Rising edge(0 -> 1)

DIO_COUNT_EDGE_DOWN

2

Falling edge(1 -> 0)

Return Value

Ret [C:long] [Python: ctypes.c_long]

Definition

Value

[Dec]

Description

DIO_ERR_SUCCESS

0

Normal complete

DIO_ERR_DLL_INVALID_ID

10001

Invalid ID is specified.

DIO_ERR_DLL_CALL_DRIVER

10002

Driver cannot be called (failed in ioctl).

DIO_ERR_DLL_BUFF_ADDRESS

10100

Invalid data buffer address.

DIO_ERR_SYS_NOT_SUPPORTED

20001

This function cannot be used for this device.

DIO_ERR_SYS_BOARD_EXECUTING

20002

It cannot perform because the device is executing.

DIO_ERR_SYS_CH_NO

20105

Channel No. is outside the setting range.

DIO_ERR_SYS_CH_NUM

20106

Channel number is outside the setting range.

DIO_ERR_SYS_CNT_EDGE

20700

Count edge is outside the setting range.

The other errors: (See also: Error code details)

Initial Value

The initial value of edge setting is rising.

Remarks

- It counts up at the timing when the specified edge is detected.
- It can be executed only before the counter starts.

Example

C

Ret = DioSetCountEdge( Id , &ChNo[0] , ChNum , &CountEdge[0] );
 

Python

Ret = cdio.DioSetCountEdge( Id , ChNo , ChNum , CountEdge )
 

See Also

DioGetCountEdge