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 |
10002 |
AIO
driver can't be called |
15200 |
The value of CntChannel is outside the designated range of the function |
15201 |
Pointer
to CntStatus is NULL |
20001 |
This function can't be used by this device |
20003 |
Can
not use because another process is using the device |
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; |
Python |
Ret
= ctypes.c_long() |
See also