next up previous
Next: DONODE prevents instruction execution Up: INSTRUCTIONS Previous: DISASSEMBLE disassembles assembled messages

DOEVENT permits instruction execution only once in the event

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.
When this instruction is executed, the <associated instruction> is only executed in the first scanning of the nodes during an event.
In a multiple node the effect occurs for all the nodes. See instruction DONODE (6.8).

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.



domingo c
Mon Mar 20 17:36:19 PST 2000