Syntax:
DOEVENT <associated instruction>;DOEVENT is used to avoid repeated executions of an instruction or a set of instructions caused by repeated scanning of the network.
<associated instruction>
is only executed in the first
scanning of the nodes during an event. This instruction can be used in any type of node.
Example:
MainGate (G) :: DOEVENT N := 0; IF Apt AND (IL(EL_Work) < 10) THEN BEGIN SENDTO(Work); N := N + 1; STOPSCAN END;Messages in the EL of
MainGate
with the field A = TRUE
are sent to Work
, one in each revision of the node (because
of the STOPSCAN procedure. see 7.21). This is
made so to check the length of the IL_Work
. The number of
messages sent in the event is registered in the variable N
.
The DOEVENT avoids repeated initializations to 0 in the
successive sending.