Btr and btw subroutines – Rockwell Automation 1403-NSC Smart Communication Card Instruction Sheet User Manual

Page 67

Advertising
background image

D–17

Sample Ladder Listing

Publication 1403-5.1

BTR and BTW Subroutines

The SLC-500 R I/O BTR and BTW subroutines mimic
the read and write block transfer examples listed in the
back of the Publication 1747–6.6, R I/O Scanner User
Manual
. The following rung descriptions and notes
pertain to modifications or additions to these examples.

1. The BTR and BTW subroutines use different files and

bits than those given in the R I/O Scanner Manual.
The substitutions are:

B3:0 – B3:5 are replaced by N15:0 – N15:4

B3:100 is replaced by the control word corresponding
to the sequencer’s output file ( N[N9:0]:0 ).

2. The file M0.1 is used for the BTW while file M0.2 is

used for the BTR routine.

3. The first rung of the block transfer examples in the

Publication 1747–6.6, R I/O Scanner User Manual is
not used in the BTR and BTW subroutines. This is
because the function performed by that rung,
initializing the control flags for the M file block
transfer, is done in the BTR or BTW subroutine at the
time the BTR and BTW block transfer are initiated.
These control flags, which are moved into the M file
control buffers at the block transfer initiation, are
initialized for each control file associated with block
transfer operations ( see Data Files Used section ).

BTR ( File 3 )

Rung 3:0
| Service BT Status |
| The BT |
| Status/ |
| BT |
| Pending |
| +SBR–––––––––––––––+ N15:5 +COP–––––––––––––––+ |
|–+SUBROUTINE +–+––––] [–––––+–––––––––––––––––––––+COPY FILE +–|
| +––––––––––––––––––+ | 0 | |Source #M1:2.100| |
| | | |Dest #N15:0| |
| | | |Length 4| |
| | | +––––––––––––––––––+ |
| | Check BT | |
| | Status | |
| | Until DN | |
| | or ER Bit | |
| | Is Off | |
| | N15:5 | |
| +––––] [–––––+ |
| 1 |
Rung 3:1
| Virtual Check BT |
| BT Done Status |
| Bit Until DN |
| or ER Bit |
| Is Off |
| N15:0 N15:5 |
|–+––––]/[–––––+–––––––––––––––––––––––––––––––––––––––––––––––––––––––(U)–––––|
| | 13 | 1 |
| | Virtual | |
| | BT Err | |
| | Bit | |
| | N15:0 | |
| +––––]/[–––––+ |
| 12 |

Rung 3:0

Copy the BTR status area to a
file which will be used
throughout the program. This
avoids addressing the M1 file
multiple times during each
program scan. Each time an
instruction containing an M1
file bit, word or file is scanned
by the processor, an immediate
data transfer to the module
occurs and therefore will impact
the overall processor time.

Rung 3:1

Unlatch the bit that continues to
check the BTR status. When a
BTR is complete, the done bit is
set. The ladder program must
unlatch the enable bit, then wait
for the SN module to turn off
the done bit before another BTR
to the same M-file location can
be initiated.

Advertising