AioGetCntStatus


Function

Retrieves the counter status.

Format

Ret = AioGetCntStatus ( Id , CntChannel , CntStatus )

Parameters

Id [ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the ID retrieved from AioInit.

CntChannel [ C, C++ : short ] [ Python : ctypes.c_short ]
Sets the channel of counter.

CntStatus [ C, C++ : long * ] [ Python : ctypes.POINTER(ctypes.c_long) ]
Specifies the address of the variable that stores the status.
CntStatus has the following meanings in bit

Status

Macro

Value

Counter in operation

CNTS_BUSY

00000001H

Comparison count match

CNTS_DATA_NUM

00000010H

Overrun

CNTS_ORERR

00010000H

Counter operation error

CNTS_ERR

00020000H

Return values

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

Return values

Content

0

Normality completion

7

Execute AioResetDevice function because the device has recovered from standby mode

10001

Invalid Id was specified
Use the Id retrieved from AioInit to specify the Id in this function.

10002

AIO driver can't be called
At first, perform AioInit function.

15200

The value of CntChannel is outside the designated range of the function

15201

Pointer to CntStatus is NULL
Specify the address of variable to parameter.

20001

This function can't be used by this device

20003

Can not use because another process is using the device
When another process is using the device, all functions except for those that support multi-process can not be performed.

25200

The value of CntChannel is outside the designated range of the device being used

Initial values

CntStatus = 0 for all devices

Remarks

After the action of counter was started, its status becomes ON when the comparison count match occurs.
The status is set back to OFF by performing the function AioResetCntStatus.

If the status of comparison count match is in ON, the overrun status becomes ON when the comparison count match occurs again.
The status is set back to OFF by performing the function AioResetCntStatus.
Even if the overrun status changes to ON, the counter operation isn't stopped.

If comparison count match occurs one after another in short time, the driver cannot process them in time.
In this case, the status of counter operation error changes to ON, the counter operation stops.

This function cannot be used on devices without counter functionality.
Even if the device is in operation, the function can be performed.

Example

Retrieves the counter status for channel 0.

C, C++

long Ret;
long CntStatus;
Ret = AioGetCntStatus ( Id , 0 , &CntStatus );
 

Python

Ret = ctypes.c_long()
CntStatus = ctypes.c_long()
Ret.value = caio.AioGetCntStatus ( Id , 0 , ctypes.byref(CntStatus) )
 

See also

AioResetCntStatus