ProSoft Technology MVI69-ADM User Manual

Page 168

Advertising
background image

Application Development Function Library - ADM API

MVI-ADM ♦ 'C' Programmable

Developer's Guide

'C' Programmable Application Development Module

Page 168 of 342

ProSoft Technology, Inc.

February 20, 2013

ADM_CheckTimer

Syntax

int ADM_CheckTimer(ADMHANDLE adm_handle, unsigned short *adm_tmlast, long
*adm_tmout)

Parameters

adm_handle

Handle returned by previous call to ADM_Open.

adm_tmlast

Starting time of timer returned from call to ADM_StartTimer.

adm_tmout

Timeout value in microseconds.

Description
ADM_CheckTimer checks a timer for a timeout condition. Each time the function
is called, ADM_CheckTimer updates the current timer value in adm_tmlast and
the time remaining until timeout in adm_tmout. If adm_tmout is less than 0, then
a 1 is returned to indicate a timeout condition. If the timer has not expired, a 0 will
be returned.

adm_handle must be a valid handle returned from ADM_Open.

Return Value
Timer not expired.

Timer expired.

Example
Check 2 timers.

ADMHANDLE adm_handle;
unsigned short timer1;
unsigned short timer2;
long timeout1;
long timeout2;
timeout1 = 10000000L; /* set timeout for 10 seconds */
timer1 = ADM_StartTimer(adm_handle);
/* wait until timer 1 times out */
while(!ADM_CheckTimer(adm_handle, &timer1, &timeout1))
timeout2 = 5000000L; /* set timeout for 5 seconds */
timer2 = ADM_StartTimer(adm_handle);
/* wait until timer 2 times out */
while(!ADM_CheckTimer(adm_handle, &timer2, &timeout2))

See Also
ADM_StartTimer (page 167)

Advertising