AioGetCntEvent


Function

Retrieves the event factor of Window message notification relative to counter.

Format

Ret = AioGetCntEvent ( Id , CntChannel , hWnd , CntEvent )

Parameters

Id [ VB.NET : Short ] [ C, C++ : short ] [ C# : short ] [ Python : ctypes.c_short ]
Specifies the device ID retrieved from AioInit.

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

hWnd [ VB.NET : IntPtr ] [ C, C++ : HWND * ] [ C# : out IntPtr ] [ Python : ctypes.POINTER(ctypes.wintypes.HANDLE) ]
Specifies the address of the variable that stores Window handle.
If the handle needn't be retrieved, please set NULL to it.

CntEvent [ VB.NET : Integer ] [ C, C++ : long * ] [ C# : out int ] [ Python : ctypes.POINTER(ctypes.c_long) ]
Specifies the address of the variable that stores the event factor.
CntEvent has the following meanings in bit.

Event factor

Macro

Value

Event comparison count match

CNTE_DATA_NUM

00000010H

Event count overrun

CNTE_ORERR

00010000H

Event that counter operation error

CNTE_ERR

00020000H

Return value

Ret [ VB.NET : Integer ] [ C, C++ : long ] [ C# : int ] [ 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.

15090

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

15091

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

20001

This function can't be used by this device

20002

Can not use while by another device works
To use this function, counter operation must be stopped.

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.

25090

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

Initial value

CntEvent = 0 for all devices

Remarks

This function cannot be used devices without counter functionality.
If the device is in operation, the function cannot be performed.

Example

Retrieves the event factor of the message notification for channel 0.

VB.NET

Dim Ret As Integer
Dim hWnd As IntPtr
Dim CntEvent As Integer
Ret = AioGetCntEvent ( Id , 0 , hWnd , CntEvent )
 

C, C++

long Ret;
HWND hWnd;
long CntEvent;
Ret = AioGetCntEvent ( Id , 0 , &hWnd , &CntEvent );
 

C#

int Ret;
IntPtr hWnd;
int CntEvent;
Ret = aio.GetCntEvent ( Id , 0 , out hWnd , out CntEvent );
 

Python

Ret = ctypes.c_long()
handle = ctypes.windll.user32.FindWindowW(0, "Interrupt")
CntEvent = ctypes.c_long()
Ret.value = caio.AioGetCntEvent ( Id , 0 , ctypes.byref(handle) , ctypes.byref(CntEvent) )
 

See also

AioSetCntEvent