71
9.3.4 SLC-5/05 Example: Read Parameters
This example program will show how to continuously read a block of parameters from the inverter with a
single MSG instruction. This action is performed via the Typed Read (a.k.a. “PLC5 Read”) message
type. Only one read request is outstanding at any given time. Note that the steps for the MicroLogix and
PLC5E may vary slightly, but in general are similar.
1) Run RSLogix 500, and create a new configuration.
2) Create a control and a data file.
a)
Right click Data Files and
select New… The “Create
Data File” dialog box appears
(refer to Figure 68).
b)
To create a control file, enter a
file number (e.g. 20), set the
type to “Integer”, enter a
descriptive name (e.g.
“CONTROL”), and enter a
number of elements (e.g. 100).
Click OK to create the file. The
control file is used to store
configuration information
pertaining to the functionality of
the MSG instruction which will
perform the data read.
c)
Follow the same procedure to
create a data file. This file will
be used to store the incoming
data read from the interface
card. Enter a file number (e.g.
18), set the type to “Integer”,
enter a descriptive name (e.g.
“DATA”), and enter a number of
elements (e.g. 200). Refer to Figure 69. Click OK to create the file.
3) Add a MSG instruction to the program.
a)
If not already visible, double-
click “LAD2” under
Project…Program Files in the
controller organizer view to
bring up the ladder logic
program.
b)
Right click on the default rung
number on the left-hand side of
the LAD2 window and select
“Insert Rung”.
c)
Right click on the rung number
of the new editable rung and
select “Append Instruction”.
d)
Select the “MSG” instruction
from the “Input/Output”
classification, then click OK.
Refer to Figure 70.
4) Add an XIO element to the
program.
a)
Right click on the rung number
of the rung currently being
edited and select “Append
Instruction” again.
Figure 68: Creating a Control File
Figure 69: Creating a Data File