AioGetAiEvent


Function

Retrieves the event factor of the message notification that is related to the analog input.

Format

Ret = AioGetAiEvent ( Id , hWnd , AiEvent )

Parameters

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

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

AiEvent [ 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.
AiEvent has the following meanings in bit.

The available event factor is based on whether the device buffer is used or whether the user buffer is used.

Event factor

Using Device buffer

Using User buffer

Macro

Value

Event that AD conversion start

Yes

Yes

AIE_START

00000002H

Event that repeat end

Yes

Yes

AIE_RPTEND

00000010H

Event that device operation end

Yes

Yes

AIE_END

00000020H

Event that the specified number of data are stored

Yes

No

AIE_DATA_NUM

00000080H

Event that the specified number of data are transferred

No

Yes

AIE_DATA_TSF

00000100H

Event that overflow

Yes

Yes

AIE_OFERR

00010000H

Event that sampling clock period error

Yes

Yes

AIE_SCERR

00020000H

Event that AD conversion error

Yes

Yes

AIE_ADERR

00040000H

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.

11390

Pointer to AiEvent 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, analog input 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.

Initial value

In all devices, AiEvent = 0

Remarks

This function cannot be used on devices without the analog input function.

Example

Retrieves the event factor of the message notification.

VB.NET

Dim Ret As Integer
Dim hWnd As IntPtr
Dim AiEvent As Integer
Ret = AioGetAiEvent ( Id , hWnd , AiEvent )
 

C, C++

long Ret;
HWND hWnd;
long AiEvent;
Ret = AioGetAiEvent ( Id , &hWnd , &AiEvent );
 

C#

int Ret;
IntPtr hWnd;
int AiEvent;
Ret = aio.GetAiEvent ( Id , out hWnd , out AiEvent );
 

Python

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

See also

AioSetAiEvent AioSetAiEventSamplingTimes AioGetAiEventSamplingTimes