omron — WAIT.EVENT program instruction

WAIT.EVENT program instruction WAIT.EVENT program instruction Syntax WAIT.EVENT mask, timeout Function Suspend program execution until a specified event has occurred, or until a specified amount of time has elapsed. Usage Considerations If a WAIT.EVENT instruction in an application program has execution suspended, the WAIT.EVENT can be canceled with the PROCEED monitor command. Parameters mask Optional real value, variable, or expression that specifies the events for which to wait. The value is interpreted as a sequence of bit flags, as detailed below.

(All the bits are assumed to be clear if no mask value is specified.) Bit 1 (LSB) Wait for I/O (mask value = 1) If this bit is set, the desired event is the completion of any input/output operation by the current task. timeout Optional real value, variable, or expression that specifies the number of seconds to wait. No time-out processing is performed if the parameter is omitted, or the value is negative or zero (see below for more details). Details This program instruction is used to suspend program execution until a specified event has occurred, or until a specified amount of time has elapsed in the timeout clock. The program waits efficiently.

When the program resumes execution after a WAIT.EVENT instruction, the GET.EVENT function can be used to verify that the desired event has actually occurred. This is the only way to distinguish between the occurrence of an event and a time-out (if one was specified). If the mask parameter has the value zero (or is omitted), this instruction becomes a very efficient way to suspend program execution for the time period specified by the timeout parameter. eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 562