18 using explicit messaging (pcp communications), Figure 6.3 lad5 - pcp read subroutine (continued) – Rockwell Automation 20-COMM-I Interbus Adapter User Manual

Page 80

Advertising
background image

6-18

Using Explicit Messaging (PCP Communications)

Figure 6.3 LAD5 - PCP Read Subroutine (Continued)

If the PCP Read Reply message indicates that the result was "not good" (N22:24 <> 0), then zero out the data area of the Reply
message (might contain leftover data from a previous successful PCP Read).

0010

M1:1.0

15

Status
Message
Present

B3:47

2

PCP Read
Reply Msg
1-Shot

NEQ

Not Equal
Source A

N22:24

0<
Source B

0

0<

PCP Read
Reply Msg
Result

MOV

Move
Source

0

0<
Dest

N22:26

325<

MOV

PCP Read
Reply Msg
Data Word #1

MOV

Move
Source

0

0<
Dest

N22:27

0<

MOV

PCP Read
Reply Msg
Data Word #2

The PCP Read Reply 1-shot is used so the subroutine processes the Reply message only once.

0011

M1:1.0

15

Status
Message
Present

L

B3:47

2

PCP Read
Reply Msg
1-Shot

When the Command / Status Message handshake is complete, reset the 1-shot bits and exit the PCP Read routine by turning the
"Execute PCP Read" bit off (B3:47/0)

0012

M0:1.0

15

Command
Message
Acknowledge

M1:1.0

15

Status
Message
Present

U

B3:47

0

Execute
PCP Read
Subroutine

U

B3:47

1

PCP Read
Routine
1-shot

U

B3:47

2

PCP Read
Reply Msg
1-Shot

U

M0:1.0

15

Command
Message
Acknowledge

0013

END

20COMM-UM007A-EN-P.book Page 18 Tuesday, January 22, 2002 10:52 AM

Advertising