Sets the event factor of Window message notification relative to counter.
Ret = AioSetCntEvent ( Id , CntChannel , hWnd , CntEvent )
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
]
Specifies the channel of counter.
hWnd
[ VB.NET : IntPtr ] [ C, C++ : HWND ] [ C# : IntPtr ] [ Python : ctypes.wintypes.HANDLE
]
Specifies Window handle.
CntEvent
[ VB.NET : Integer ] [ C, C++ : long ] [ C# : int ] [ Python : ctypes.c_long
]
Event factor is specified from the following range in the macro or numerical
value.
CntEvent has the following meanings in bit, it can be specified by a combination
of these bits.
Event factor |
Macro |
Value |
Comparison count match event |
CNTE_DATA_NUM |
00000010H |
Count overrun event |
CNTE_ORERR |
00010000H |
Counter operation error |
CNTE_ERR |
00020000H |
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 |
10002 |
AIO
driver can't be called |
15080 |
The value of CntChannel is outside the designated range of the function |
20001 |
This function can't be used by this device |
20002 |
Can
not use while by another device works |
20003 |
Can
not use because another process is using the device |
25080 |
The value of CntChannel is outside the designated range of the device being used |
CntEvent = 0 (Not use event) for all devices
The event factor set in this function are
notified as message to event message routine.
The message type are as follows.
Message factor of counter |
Macro |
Value |
Comparison count match event |
AIOM_CNTE_DATA_NUM |
1042H |
Count overrun event |
AIOM_CNTE_ORERR |
1043H |
Count operation error event |
AIOM_CNTE_ERR |
1044H |
This function cannot be used on devices without
counter functionality.
If the device is in operation, the function cannot be performed.
It cannot be used with callback routine (AioSetCntCallBackProc).
Sets the comparison count match event for channel 0.
VB.NET |
WndProc |
C, C++ |
long
Ret; |
C# |
WndProc |
Python |
Ret
= ctypes.c_long() |
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
m.Msg:Message ID is passed.
m.WParam:ID is passed in lower 2 bytes. The channel number of counter in that the event occurred is passed in higher 2 bytes.
m.LParam:The parameter peculiar to event is passed.
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")]
protected override void WndProc (ref Message m)
m.Msg:Message ID is passed.
m.WParam:ID is passed in lower 2 bytes. The channel number of counter in that the event occurred is passed in higher 2 bytes.
m.LParam:The parameter peculiar to event is passed.
LRESULT CVC6Dlg::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
message: Message ID is passed.
wParam: ID is passed in lower 2 bytes. The channel number of counter in that the event occurred is passed in higher 2 bytes.
lParam: The parameter peculiar to event is passed.
3 arguments are passed to the Event Message Routine: Message ID, ID, and Parameter peculiar to event.
Message ID and Parameter peculiar to event are as shown in the following table.
Counter message factor |
Macro |
Value |
Comparison count match event |
AIOM_CNTE_DATA_NUM |
1042H |
Count overrun event |
AIOM_CNTE_ORERR |
1043H |
Count operation error event |
AIOM_CNTE_ERR |
1044H |
The current counter value is passed.
When the comparison count match event occurs, the value specified by AioSetCntComparisonReg is passed.