D - sample ladder listing, Ladder program description, Plc-5 r i/o operation – Rockwell Automation 1403-NSC Smart Communication Card Instruction Sheet User Manual

Page 51: Slc-500 r i/o operation, Appendix, Sample ladder listing

Advertising
background image

Appendix

D

Publication 1403-5.1

Sample Ladder Listing

Ladder Program Description

Appendix D contains sample ladder programs that
interface to the Powermonitor II for PLC-5 R I/O,
SLC-500 R I/O and SLC-500 RS-232. Because of the
similarities of these three programs, only the PLC-5
R I/O example operation is discussed in detail, and the
differences in operation for the SLC-500 R I/O and
SLC-500 RS-232 are noted. Rung-by-rung descriptions
are given for all three.

PLC-5 R I/O Operation

There are three modes of operation:

Configuration

Setpoint

Run

Each mode uses a single Sequencer Output Instruction in
order to process the required block transfers. There are
only two block transfers required. These two block
transfers are repeated until each mode is completed
successfully. For Run mode, the number of block
transfers processed by the sequencer is variable. Because
there is only one sequencer to be used for three modes,
the sequencer’s input file must be updated at the
beginning of each new mode. The numbers
corresponding to the block transfers required for each
mode are contained in three separate files. The content
of each file is moved to the sequencer’s input file at the
beginning of its corresponding mode.

Configuration Mode

During initialization of Configuration mode, the
sequencer input file is loaded with the two numbers.
These numbers correspond to the configuration table
BTW and the diagnostic table BTR. The sequencer
length is set to 2. After completion of the configuration
data BTW, a diagnostic table BTR is performed to verify
that the BTW was successful. If the configuration table
BTW is successful, the Configuration mode bit is
unlatched and the setpoint mode bit is latched. If the
BTW is not successful, the configuration table BTW and
diagnostic table BTR sequence continues until the
problem is corrected. This most likely requires a change
in the configuration table data.

Setpoint Mode

During initialization of Setpoint mode, the sequencer
input file is loaded with the two numbers. These
numbers correspond to the setpoint data table BTW and
the diagnostic data table BTR. The sequencer length is
set to 2. Also, the number of setpoints is written to a
counter which is used to determine the address of the user
populated setpoint data tables. After the completion of
the setpoint BTW, a diagnostic table BTR is performed to
verify the BTW was successful. If it was not successful,
further setpoints will not be written until the setpoint data
table that caused the error is corrected. If all the
setpoints are written correctly, the Setpoint mode bit is
unlatched, and the Run mode bit is latched.

Run Mode

During initialization of Run mode, the sequencer input
file is loaded with the numbers corresponding to the
block transfers to be performed. Once Run mode has
begun, the ladder program will remain in this mode.

Note:

The speed with which the processor performs
the block transfers may be altered by
rearranging or changing the size of the block
transfer sequence. However, the availability of
new data values is controlled by the
Powermonitor II table update rate.

SLC-500 R I/O Operation

The SLC-500 R I/O requires more attention. BTW and
BTR instructions subroutines have been developed for
implementation of the SLC-500 R I/O sample ladder.
The BTR and BTW subroutines are patterned after the
block transfer examples shown in the R I/O Scanner User
Manual ( Cat. No. 1747-SN, Publication 1747-6.6 –
February 1995), pp. 5-23 to 5-28. Refer to this manual
for a more detailed description of how these block
transfer routines work.

In addition to the two files that contain the BTR and
BTW subroutines, there is a third subroutine file. This
file executes a small amount of initialization ladder
before each block transfer subroutine.

Advertising