Count = from_bcd ($d:12), D:12 = to_bcd (27) – Rockwell Automation 1775-S5_SR5,D17756.5.5 User Manual PLC-3 FAMILY I/0 User Manual

Page 108

Advertising
background image

Programming DH and DH+

Message Procedures

Chapter 6

6-17

If an error occurs in a command line that is not associate with an
ON_ERROR command, the procedure stops executing. See “Recovery
from Erros,” page 7-1.

Refer to Appendix B for a listing of the error conditions.

The STOP command terminates execution of the message instruction in the
ladder program. This means that the STOP command stops execution of
the current procedure and all procedures nested together with the
current one.

The format of the STOP command is the single letter S without any
modifiers or parameters.

Each main procedure and nested procedure must end with either an EXIT
or a STOP command. The STOP command is a extreme means of
terminating a message procedure, so you should only use it when no other
action is possible. The normal means of terminating a procedure is the
EXIT command. The STOP command generates error code 179 (see
Appendix B).

In addition to containing commands and nested procedures, a message
procedure can also contain functions. You can use the following functions
anywhere expressions are used (Figure 6.4):

TO_BCD
FROM_BCD

The TO_BCD and FROM_BCD perform opposite conversion functions.

Figure 6.4

Example Command Lines Using the TO_BCD and FROM_BCD Functions

COUNT = FROM_BCD ($D:12)

11245

Destination of

Assignment Command

Function

$D:12 = TO_BCD (27)

Resulting Value

Function Parameter

STOP Command

Using Functions

Advertising