Count = 0 ; initialize counter – Rockwell Automation 1775-S5_SR5,D17756.5.5 User Manual PLC-3 FAMILY I/0 User Manual

Page 110

Advertising
background image

Programming DH and DH+

Message Procedures

Chapter 6

6-19

You can add comments to any command line in a message procedure. To
do this, enter a semicolon (;) after the command. Then enter your
comment after the semicolon (Figure 6.5).

Figure 6.5

Format for Adding Comments to Command Lines

COUNT = 0 ; INITIALIZE COUNTER

11246

Command

Comment Delimiter

Comment

Anything that appears between a semicolon and the end of the command
line is a comment. Comments can be any length. The end of the command
line, and therefore the end of your comment, is delimited by the
carriage-return and line-feed pair of characters.

Figure 6.6 and Figure 6.7 provide examples of DH or DH+ message
procedures that monitor the state of a status bit in a remote station.

Figure 6.6

Example Message Procedure that Executes Read and Write Commands

over a DH or DH+

Procedure - @DATA

A = 10

B = $N0:0 ;procedural user symbol
IF ($10:012/017) $D2:0 = #H011$D6:0 ;read word D6:0 from station 11 into word D2:0
IF ($10:012/016) #H011$D6:1 = $D2:1 ;write word D2:1 into word D6:1 of station 11
IF (A .EQ. B) GOTO LABEL
EXIT
LABEL:

$D7 = #H011$D3 ;note that the destination file must be

the source

file

#H011$N3:5 = $N2:4,10 ;write 10 words starting at word N2:4 into

;station 11 starting at word N3:5

Adding Comments to Your

Message Procedure

Programming Examples for

a Message Procedure

Advertising