Monitor Status

After the conversion starts, various operation status of the device can be monitored.

Status

You can monitor the device status with the function AioGetCntStatus.

Ret = AioGetCntStatus ( Id , CntChannel , CntStatus )

Sets the channel number of counter in the CntChannel.

Specifies the address of the variable that stores the status in the CntStatus.
Because CntStatus has meanings in bit, in order to check the state of a certain status, please retrieve whether the corresponding bit is ON or OFF.

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

00010001H

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.

 

Retrieves the current count value

You can retrieve the current count value by executing the function AioGetCntCount.

Ret = AioGetCntCount ( ID , CntChannel , Count )

Sets the channel number of counter in the CntChannel.

Specifies the address of the variable that stores the current count value in the Count.