GxFpgaWaitOnEvent

Purpose

Waits until event received or timeout occurred.

Syntax

GxFpgaWaitOnEvent (nHandle, nEventType, lTimeout, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX3500 board.
nEventType
SHORT
Event type. Use the constant GT_EVENT_INTERRUPT (1). No other value is supported.
lTimeout
LONG
Timeout to wait in mill seconds.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The function suspends the current thread until an event occurred or until the specified timeout expired.

Example

The following example output whether an event received during 1 second:

 

GxFpgaInitialize (1, &nHandle, &nStatus);

GxFpgaSetEvent(nHandle, GT_EVENT_INTERRUPT, TRUE, NULL, (PVOID)1, &nStatus);

! wait up to 1000 ms for the event

GxFpgaWaitOnEvent(nHandle, GT_EVENT_INTERRUPT, 1000, &nStatus);

if (nStatus==0) ! success event occurred

    printf(“event occurred”);

else if (nStatus==GT_EVENT_WAIT_TIMEOUT)

    printf(“No event occurred (timeout)”);

else

    printf(“Event error”);

GxFpgaSetEvent(nHandle, GT_EVENT_INTERRUPT, FALSE, NULL, (PVOID)1, &nStatus);

 

See Also

GxFpgaInitialize, GxFpgaGetErrorString, GxFpgaSetEvent, GxFpgaDiscardEvents