TimStartTimer


Function

Starts an Interval Timer.

Format

Ret = TimStartTimer(TimerId, Microseconds, hWnd)

Parameters

TimerId [ VB.NET: Short ] [ C, C++: short *] [ C#: out short ]

Returns an ID that is the Interval Timer identifier.

 

Microseconds [ VB.NET: Integer ] [ C, C++: unsigned long] [ C#: uint ]

Interval of Timer [us]

 

Available Range

Onboard System Timer

1 to 1,073,741,823 (us) *1

System Timer

1,000 to 4,294,967,295 (us)

 

*1 When using DIO-32DM3-PE, the setting range is as follows.
      1 to 107,374,182 (us)

 

hWnd [ VB.NET: Short ] [ C, C++: HWND ] [ C#: int ]

Specifies the window handle to receive the timer message. The window handle can be retrieved by m_hWnd in VC.

Specify it to 0 when you want to use callback function but not window message.

 

Please use CMessage.OCX offered by our company in VB6. CMessage.Window is used as the window handle.

We will encourage the use of bundled ActiveX control "CONTEC ACX Timer Control" in VB6.

Because all the message processings etc. are made concealment when this control is used, it is possible to use it by a similar sense to the timer control of VB.

Return Value

Ret [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ]

Definition

Value

Description

TIM_ERR_SUCCESS

0

Normal completed

TIM_ERR_DLL_INVALID_ID

10001

Invalid ID specified.

Please confirm whether the initialization function has completed normally.

TIM_ERR_DLL_NOT_INITIALIZED

10010

It is not initialized. Please confirm whether the initialization function has completed normally.

TIM_ERR_DLL_HWND

10200

Window handle beyond the limit.

Error occurred in message notification function. It is possible that the window handle is invalid when the function is executing. Please adjust the timing for calling the function.

TIM_ERR_DLL_OVER_MAX_TIMER

10553

Timer beyond the available maximum number.

The others (See also:Details of Error Code)

Initial Value

None

Remarks

Notifies that the specified time passes to applications.

The maximum number of used Interval Timer is 256.

 

When the specified time passes, the message of TIMM_INTERVAL = 8900H is notified to the specified window handle.

 

The parameters of the message are wParam and lParam containing the following information respectively.

LOWORD(wParam) = TimerId retrieved by this function

LOWORD(lParam)  = Not use

HIWORD(lParam)   = Not use

 

* HIWORD indicates the high-order word. LOWORD indicates the low-order word. For details about message handling, please refer to the sample programs of each language.

See Also

TimTimerCallBackProc, TimStopTimer