Rockwell Automation 1775-S5_SR5,D17756.5.5 User Manual PLC-3 FAMILY I/0 User Manual

Page 106

Advertising
background image

Programming DH and DH+

Message Procedures

Chapter 6

6-15

To execute a message procedure, enter the delimiter @ followed by the
procedure’s name. For example:

@FIRST_PROC

The scanner executes the procedure FIRST_PROC.

You can use procedure names anywhere that commands are used. This
way one procedure can execute (call) another procedure. This allows for
nesting of procedures. However, you cannot nest more than 3 layers deep.

The EXIT command terminates execution of the current message
procedure. If another procedure calls (executes) the current procedure, the
EXIT command returns control to the calling procedure at the line
following the execute statement.

The format for the EXIT command is the single letter E without any
modifiers or parameters.

Each main procedure and nested procedure must end with either an EXIT
command or a STOP command. The EXIT command is preferred because
the STOP command results in error 179 (see appendix B).

The commands in a message procedure normally execute sequentially.
The GOTO command can change the order of execution.

The parameter for a GOTO command is a label. Labels are signposts, or
tags, that mark a location within the message procedure.

To generate a label, enter it on any one of the lines in a message procedure.
For example:

LABEL_A:

Nothing else can appear on the same line with the label. The label itself
must conform to the same rules of construction as user symbols do.

Important: The trailing colon (:) is required when you first generate the
label, but do not use the colon any other time you refer to the label.

When a GOTO command executes, execution of the message procedure
resumes with the first command after the label specified in the GOTO
command. You cannot use the GOTO command to jump from one
procedure to another, even if the procedures are nested.

Execute Command

EXIT Command

GOTO Command

Advertising