On_error command – Rockwell Automation 1775-KA PLC-3 Communication Adapter Module User Manual User Manual

Page 86

Advertising
background image

Message Procedure Commands

Chapter 6

6Ć8

the value of the expression is false (0), the embedded command is not
executed. The embedded command may be any of the available
commands except another IF or an ON_ERROR.

Figure 6.1 demonstrates the combination of a label, a GOTO command,
and an IF command to construct a simple loop that assigns the integers 0
through 7 to successive words in binary file 50.

Figure 6.1

Example of Looping

NUM = 0

LOOP: $B50:(NUM) = NUM

NUM = (NUM +1)

IF (NUM .LE. 7) GOTO LOOP

10027-I

The ON_ERROR command specifies what action should be taken if an
error is encountered during execution of the message procedure. The
ON_ERROR command is not executed sequentially in the procedure; it is
executed only when an error occurs.

Table 6.A illustrates the format of the ON_ERROR command. The
ON_ERROR command contains an embedded command that is executed
when an error occurs.

The ON_ERROR command applies to all other commands between itself
and the next ON_ERROR command. For example, consider the following
sequence:

ON_ERROR Command

Advertising