DioGetCountStatus


Function

Retrieves the count status.

Format

Ret = DioGetCountStatus ( Id , ChNo , ChNum , CountStatus )

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.c_short]
Specifies the number of channels specified in ChNo.

CountStatus [C:unsigned int *] [Python: ctypes.POINTER(ctypes.c_uint)]
Specifies the start address of the array that stores the status.

When using <CPSN-DI-16BCL>

Bit

Description

Value

0

Comparison match

0: Not matched
1: Matched (Clear when reading)

1

Carry

0: Carry undetection
1: Carry detection (Clear when reading)

31:2

Reserved

-

When using <DIO-0404LY-WQ>

Bit

Description

Value

0

Reserved

-

1

Carry

0: Carry undetection
1: Carry detection (Clear when reading)

2

Counter operation status

0: Stop
1: In operation

31:3

Reserved

-

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_CH_NO

20105

Channel No. is outside the setting range.

DIO_ERR_SYS_CH_NUM

20106

Channel number is outside the setting range.

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

Example

C

Ret = DioGetCountStatus( Id , &ChNo[0] , ChNum , &CountStatus[0] );
 

Python

Ret = cdio.DioGetCountStatus( Id , ChNo , ChNum , CountStatus )
 

See Also

DioSetCountMatchValue