AioSetTmEvent


Function

Sets the event factor of window message notification relative to interval timer.

Format

Ret = AioSetTmEvent ( Id , TimerId , hWnd , TmEvent )

Parameters

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

TimerId [ VB.NET : Short ] [ C, C++ : short ] [ C# : short ] [ Python : ctypes.c_short ]
Specifies the timer ID.

hWnd [ VB.NET : IntPtr ] [ C, C++ : HWND ] [ C# : IntPtr ] [ Python : ctypes.wintypes.HANDLE ]
Specifies the window handle.

TmEvent [ 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.
TmEvent has the following meanings in bit, it can be specified by a combination of these bits.

Event factor

Macro

Value

Event that interval elapses

TME_INT

00000001H

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.

16000

The value of TimerId 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
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.

26000

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

Initial value

TmEvent = 0 (Not use event) for all devices

Remarks

The event factors set in this function are notified as the message to event message routine.
The type of message are as follows.

Timer message factor

Macro

Value

Event that interval elapses

AIOM_TME_INT

1060H

This function cannot be used on devices without timer functionality
If the device is in operation, the function cannot be performed.
It cannot be used with callback routine (AioSetTmCallBackProc).

Example

Sets the interval is satisfied by event to timer ID 0.

VB.NET

WndProc
Dim Ret As Integer
Ret = AioSetTmEvent ( Id , 0 , Handle , TME_INT)
 

C, C++

long Ret;
Ret = AioSetTmEvent ( Id , 0 , m_hWnd , TME_INT );
 

C#

WndProc
int Ret;
Ret = aio.SetTmEvent ( Id , 0 , Handle , (int)CaioConst.TME_INT);
 

Python

Ret = ctypes.c_long()
handle = ctypes.windll.user32.FindWindowW(0, "Interrupt")
Ret = ciao.AioSetTmEvent ( Id , 0 , handle , caio.TME_INT )
 



Event message routine

In Visual Basic .NET(WndProc)

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. High 2 bytes aren't use now.
m.LParam:The parameter peculiar to event is passed.

In Visual C#(WndProc)

[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. High 2 bytes aren't use now.
m.LParam:The parameter peculiar to event is passed.

Event message routine in Visual C++

LRESULT CVC6Dlg::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
message: Message ID is passed.
wParam: ID is passed in lower 2 bytes. The timer ID 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.

Message ID

Analog input message factor

Macro

Value

Event that interval elapses

AIOM_TME_INT

1060H

Parameter peculiar to event

Not use now.