WAITANDRESET Statement

The WAITANDRESET statement suspends a program until a designated condition occurs.

<waitandreset statement>

── WAITANDRESET ──┬────────────────────────┬───────────────────────────► 
                  └─[ <wait option list> ]─┘                             
►─ ( ─<wait parameter list>─── )──┬─────────────────────────┬──────────┤ 
                                  └─ [ ──<start index>── ] ─┘     

The WAITANDRESET statement and the WAIT statement with a wait parameter list are identical, except for the state to which the caused event is set during the cause process. If a program is waiting on an event because of a WAITANDRESET statement, then the happened state of the event is set to FALSE (not happened). If a program is waiting on an event because of the WAIT statement, then the happened state of the event is set to TRUE (happened).

Generally, an IMPORTED EVENT or IMPORTED EVENT ARRAY element cannot be used as an event designator in an event list. However, an IMPORTED EVENT that is declared in a CONNECTION BLOCK can be used as an event designator if the compiler control option WAITIMPORT is set.