By using events, it is possible to notify various states (conversion end, error occurrence, etc.) that occurred during device operation to application programs.
Depending on the parameters passed in the event notification, you can get what kind of event occurred, and you can sort the processing by event.
There are the following two ways to notify events.
This is a method of notifying a message to the application by executing
Win32 API's PostMessage function from the driver.
It is a commonly used event notification method.
How to create a handler to be called upon notification depends on the used
development language.
It can not be used in applications that do not have Window handle (such
as console application).
How to create an event message routine
Visual Basic .NET
Visual C#
Visual C++ (MFC)
A previously created callback function is registered, and the driver
calls the registered function directly when notifying.
It is necessary to handle pointers and function pointers, but the amount
of code is small and simple.
Callback function works faster than Windows message notification. And it
can also be used in applications that do not have Window handle (such
as console application).
How to create callback function
Visual Basic .NET
Visual C#
Visual C++ (MFC)
Python
Please keep the processing in the callback
function simple and return the processing to the OS immediately.
Especially when using a USB device, each status is not updated during callback
processing. Thank you in advance for your understanding.
Board devices | USB devices | |
Device status:
AioGetAiStatus AioGetAoStatus AioGetCntStatus |
Always updated | Status is not updated |
Error status:
|
Always updated | Status is not updated |
Sampling count:
AioGetAiSamplingCount AioGetAiSamplingData |
Always updated | Status is not updated |