beautypg.com

Pcp write subroutine (explicit messaging), Using explicit messaging (pcp communications) 6-19, Figure 6.4 lad6 - pcp write subroutine – Rockwell Automation 20-COMM-I Interbus Adapter User Manual

Page 81

background image

Using Explicit Messaging (PCP Communications)

6-19

PCP Write Subroutine (Explicit Messaging)

The PCP Write Subroutine is executed from the Main Program (Chapter
5) by turning on bit B3:47/10. Only one PCP Read or Write can be
performed at any one time. B3:47/10 will be turned off by the subroutine
when the reading is complete and signals that another read (or write)
cycle can take place.

Figure 6.4 LAD6 - PCP Write Subroutine

N23:10 = PCP Command Word (Set to "8" to cause a PCP Write: an "8" = bit 3 ON)

0000

B3:47

11

PCP Write
Routine
1-shot

MOV

Move
Source

8

8<
Dest

N23:10

8<

MOV

PCP
Command
Word

N23:11 = CR (The Communication Reference to write to. A unique CR is the established for each Station)
"2" = CR 2 = Station 1.0
"3" = CR 3 = Station 2.0

0001

B3:47

11

PCP Write
Routine
1-shot

MOV

Move
Source

N23:0

2<
Dest

N23:11

2<

MOV

PCP Write
Command Msg
CR

N23:12 = Index

N23:1 determines what area is to be written to:
0 = PowerFlex 70 (Host) parameter (N23:2 + 12288 decimal (3000h) = mapped parameter address)
1 = 20-COMM-I parameter (N23:2 + 12213 decimal (2FB5h) = mapped parameter address)

0002

B3:47

11

PCP Write
Routine
1-shot

EQU

Equal
Source A

N23:1

0<
Source B

0

0<

EQU

PCP Write
Parameter Area
to Write

ADD

Add
Source A

N23:2

107<
Source B

12288

12288 <
Dest

N23:12

12395 <

ADD

PCP Write
Command Msg
Index

EQU

Equal
Source A

N23:1

0<
Source B

1

1<

EQU

PCP Write
Parameter Area
to Write

ADD

Add
Source A

N23:2

107<
Source B

12213

12213 <
Dest

N23:12

12395 <

ADD

PCP Write
Command Msg
Index

N23:13 = Sub Index (Not used)

0003

B3:47

11

PCP Write
Routine
1-shot

MOV

Move
Source

0

0<
Dest

N23:13

0<

MOV

PCP Write
Command Msg
Sub Index

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