ICC
86
8.3.3 SLC-5/05
Example:
Read a Register Block
This example program will show how to continuously read a block of registers from the inverter with a
single MSG instruction. Only one read request is outstanding at any given time.
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 117).
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 118. 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, and then click OK.
Refer to Figure 119.
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.
b)
Select the “XIO” instruction from the “Bit” classification, and then click OK. Refer to Figure
120.
Figure 117: Creating a Control File
Figure 118: Creating a Data File