Sunteți pe pagina 1din 5

Programmable Logic

Controllers
Ethernet-Based Communication
Setup and MSG Instruction Use

Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 12-1

Communications Setup
Assuming an RSLogix ladder logic program is
properly setup to use one of the PLCs on the
network, two additional data files need to be
created to support use of the MSG instruction
A MESSAGE data file
Will hold all information for configured MSG instructions

A ROUTING INFORMATION data file


Will hold routing information from configured MSG
instructions

Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 12-2

13-1

MESSAGE Data File


Select a valid file number,
usually the next available
integer after the last
configured data file
Type: Message
NAME: MESSAGE (optional)
Number of elements should
correspond to the maximum
unique number of MSG
instructions in your program
Use default values for all
other entries/selections
This example will create the
data file MG9 supporting 10
elements
Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 12-3

ROUTING INFORMATION Data File


The routing information (RI)
data file is used to hold
information for MSG
instructions when multi-hop
communication is used
Ethernet-based
communication uses this,
even on a local network
In general, there should be
one element in the routing
information data file for
every unique MSG instruction
Routing information is placed
in the RI data file when MSG
instructions are configured
and verified
Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 12-4

13-2

Sample Program with MSG


Consider a simple example where one PLC
will be programmed to write one word from
its input data file to the output data file on a
second PLC
We will use I:0.0 since this corresponds to the
word containing the input switch values on the
PLC trainer
O:0.0 corresponds to the pilot lamps on the PLC
trainer

Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 12-5

Example PLC Program

This simple program uses one bit (bit 8) from


the free running timer (word 4 in the status
data file) to control sending a message using
element MG9:0 in the message data file

Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 12-6

13-3

MSG Setup Screen (This Controller)


Select Channel 1 for Ethernet
communication on the
configured PLC network
Select the communication
command as 500CPU write
for writing data from the
source PLC to the target
device
Set the starting address for
the data to write in the Data
Table Address field
Size in elements: one word
in this example

Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 12-7

MSG Setup Screen (Target Device)


Set the starting destination
address for the data to write
in the Data Table Address
field
Local/Remote: Local
Routing Information (RI) File
Select a word from the
configured RI data file to hold
routing information for the MSG
instruction
A good practice would be to use
the same element number as
the MSG instruction you are
configuring

Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 12-8

13-4

MSG Setup Screen (Multihop Tab)


Configure the destination
PLC IP address in the
Multihop Tab
This information will be used
to automatically populate the
Routing Information data file
when the MSG instruction is
verified when the program is
verified

Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 12-9

Routing Information Data File

After verifying the MSG instruction (i.e. the


ladder program containing the MSG
instruction), the RI data file should be
configured as shown above
Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 12-10

13-5

S-ar putea să vă placă și