beautypg.com

Rockwell Automation RECOMM-IBUS Interbus Communications Module User Manual

Page 81

background image

Using Explicit Messaging (PCP Communications)

7-21

Figure 7.14 – LAD6 - PCP Write Subroutine (Continued)

N23:15 = Data word #1 to write (8-bit & 16-bit parameters, MSW of 32-bit parameters)
N23:16 = Data word #2 to write (LSW of 32-bit parameters)

N23:14 = Number of bytes to write ("1" for byte, "2" for 16-bit parameter and "4" for 32-bit parameter)

Data is contained in:

If only 1 byte is being written, it needs to be loaded into the high byte of Data word #1 (N23:15). The subroutine performs this
via the SWP instruction so the main program can work with a normal number (i.e. a "2" instead of a "0200" hex).

0004

B3:47

11

PCP Write
Routine
1-shot

COP

Copy File
Source

#N23:3

Dest

#N23:14

Length

3

COP

PCP Write
Command Msg
# Bytes of Data

EQU

Equal
Source A

N23:14

2<

Source B

1

1<

EQU

PCP Write
Command Msg
# Bytes of Data

SWP

Swap
Source

#N23:15

Length

1

SWP

Copy the PCP Write Command message to the scanner for transmission on the network.

0005

B3:47

11

PCP Write
Routine
1-shot

COP

Copy File
Source

#N23:10

Dest

#M0:1.0

Length

7

COP

The PCP Write Command 1-shot is used so the subroutine processes and sends the Command only once when called by the
MAIN PGM

0006

L

B3:47

11

PCP Write
Routine
1-shot

When the scanner acknowledges the PCP Write command, turn the Command word PCP Write bit OFF (originally comes from
N23:10 which was COPied to M0: above).

0007

M1:1.0

3

Status
PCP Write

U

M0:1.0

3

Command
PCP Write

When the scanner Status word indicates that a message is available, copy the message into an Interger file (N23:) for processing
and handshake with the scanner by turning the Command word Message Acknowledge bit ON.

0008

M1:1.0

15

Status
Message
Present

B3:47

12

PCP Write
Reply Msg
1-Shot

COP

Copy File
Source

#M1:1.0

Dest

#N23:20

Length

5

COP

PCP Write
Reply Msg
Status Word

L

M0:1.0

15

Command
Message
Acknowledge

When the scanner acknowledges the PCP Write command, turn the Command word PCP Write bit OFF (originally
comes from N23:10 which was copied to M0: above).