Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 12 of 19

Classic 1785 PLC-5 Programmable Controllers User Manual (1785-LT, -LT2, -LT3, -LT4), pages 111 to 120

Pages 111 to 120 of 186

The original document is the PDF (1.4 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Allen-Bradley 1785-LT2, Allen-Bradley 1785-LT3, Allen-Bradley 1785-LT4 and Allen-Bradley 1785-LT B

Page 111

Chapter 8 Transferring Discrete and Block-Transfer Data

Transferring Data Using Scanner Mode

A PLC-5 processor, in scanner mode, transfers discrete-transfer and block-transfer data with processor-resident local and remote I/O chassis. If you have your processor configured for scanner mode, refer to the following sections for more information on how a PLC-5 processor transfers data in scanner mode. Also, the following sections provide information on how to handle I/O rack faults for processor-resident local and remote I/O (in scanner mode).

Programming Discrete Transfer in Scanner Mode

The processor scans processor-resident local I/O synchronously and sequentially to the program scan. The processor:

I/O Image Table

Read Inputs Write Inputs

Data Exchange Processor- Resident Rack

Housekeeping scans discrete-transfer data in the processor-resident local I/O chassis synchronously and sequentially to the program scan.

performs housekeeping once per program scan: 3 ms maximum; typically 1.5 ms Logic Scan

Program Scan

8-16 scans discrete-transfer data in remote I/O chassis asynchronously to the program scan. The remote I/O scan discrete-transfers I/O data between remote I/O adapters in I/O chassis and the remote I/O buffer in the processor.

Page 112

Chapter 8 Transferring Discrete and Block-Transfer Data

Programming Block Transfer in Scanner Mode

The processor block transfers data to and from its processor-resident local and remote I/O chassis when operating in scanner mode. The processor performs block transfers asynchronously to the program scan. The processor also interrupts the program scan asynchronously to momentarily access BTW and BTR data files. The processor performs one remote block transfer per addressed rack per remote I/O scan in classic PLC-5 systems.

Queued Block-Transfer Requests If your ladder program requests more than one block transfer to or from the same I/O chassis in the same program scan, the processor queues the requests. The PLC-5/12, -5/15, and -5/25 processors can handle up to 17 requests per rack address. After the processor queues the requests, a PLC-5/12, -5/15, or -5/25 processor runs the block transfers in the order they are requested. The only exception is a block-transfer request in a fault routine. The processor has an active buffer. The processor places a block transfer in the active buffer when the processor takes the request off the queue. The processor places a block-transfer request directly in the active buffer only if the queue is empty. When the processor is changed to program mode, the block-transfer instructions still in the buffer are cancelled.

Block Transfers to Processor-Resident Local I/O Block transfers to processor-resident local I/O follow these procedures. Block-transfer requests are queued for the addressed processor-resident local I/O rack. The active buffer handles all block-transfer modules whose blocktransfer instructions were enabled in the program scan continuously via the queue scan in the order the requests were queued. The processor momentarily interrupts program scan when the active buffer performs a block-transfer request to access the block-transfer data file. Block transfers of I/O data can finish and the done bit can be set anytime during the program scan. The processor runs all enabled block transfers of I/O data to processorresident local I/O continuously as each block-transfer request enters the active buffer. The processor does not wait for the I/O scan to queue the requests.

8-17

Page 113

Chapter 8 Transferring Discrete and Block-Transfer Data

Block Transfers of Remote I/O Data Block transfers of I/O data to remote I/O follow these procedures. block-transfer requests are queued for each addressed remote I/O rack Each active buffer transfers one data block per remote I/O scan. The processor momentarily interrupts program scan when the active buffer performs a block-transfer request to access the block-transfer data file. If program scans are two or three times longer than remote I/O scans, the processor can run two or three remote block transfers per program scan and interrupt the program scan two or three times. Important: If you split remote rack numbers between scanner channels, block transfers to lower priority scanner channels do not work. Discrete transfers function properly. Scanner channels have priority according to the following order: 1A, 1B, 2A, then 2B. If you configure channels 1B and 2A as remote scanners and split rack #2 between them, for example, block transfers will work to 1B (the higher priority channel) but will not work to the second half of rack #2 (2A, the lower priority channel).

Block Transfers in Fault Routines (STIs) If the processor runs a fault routine that contains block-transfer instructions, the processor performs these block transfers immediately upon completing any block transfers currently in the active buffer, ahead of block-transfer requests waiting in the queue. The block transfers in a fault routine should only be between the processor and processor-resident local I/O.

ATTENTION: The program scan stops when the PLC-5/15 or -5/25 processor runs a fault routine with a block-transfer instruction to a remote chassis. The delay for a block transfer could be unacceptable for your application.

8-18

Page 114

Chapter 8 Transferring Discrete and Block-Transfer Data

Block-Transfer Sequence Figure 8.11 shows the sequence the processor follows to run a block transfer. Figure 8.11 Block-Transfer Sequence

1, 7 Ladder Program

6 STI Data Files

2 Q17 Buffer for 17 BT Requests

Request

Priority Request 3a, 3b, 5 Active BT area

Data Data

Acknowledgement and Incoming Data

Request and Outgoing Data

4a, 4b I/O Chassis 1.

Ladder logic enables the block transfer.

2.

The processor places the block-transfer request in the queue, or in the active buffer if the queue is empty. If the queue is full, the request is ignored until the next scan.

3.

If the block transfer is a: BTW: The processor interrupts the program scan momentarily to transfer data from the BTW file to the active buffer. The active buffer transfers the request and outgoing data to the processor-resident local I/O module or to the remote I/O adapter. BTR: The active buffer sends the block-transfer request to the processor-resident local I/O module or remote I/O adapter. In the same local block-transfer update or in the next remote I/O scan, the active buffer receives the block-transfer acknowledgement and incoming data.

4.

Important: The processor interrupts the program scan momentarily to transfer incoming data to the BTR file one word at a time; therefore, some ladder logic could execute in between word transfers to the BTR file. We recommend that you buffer your BTR data with a file-to-file move or a copy instruction using a BTR done bit to condition the rung if you need file integrity of the data. If the block transfer is to: Processor-Resident Local I/O: The processor continuously runs block-transfer requests for all processor-resident local I/O modules in the order the processor queues the requests. Remote I/O: The processor runs one block-transfer request for one block-transfer module per rack address per remote I/O scan.

5.

The processor clears the active buffer and the active buffer accepts the next request after the buffer receives a confirmation of a valid read or write.

6.

When the processor enables a fault routine or STI, the processor runs any block-transfer program in the fault routine or STI ahead of any block-transfer requests in the queue, as soon as the active buffer completes any block transfer currently in the active buffer. The program scan is stopped until the STI or fault routine block transfer is complete.

7.

The block-transfer process runs asynchronously to the program scan, so data can change during program scan.

8-19

Page 115

Chapter 8 Transferring Discrete and Block-Transfer Data

Block-Transfer Sequence with Status Bits The following explanations describe how the ladder logic and the I/O scanner handle block transfers with status bits: Ladder logic: detects that the rung containing a block transfer is enabled sets the enable .EN bit (15) detects the status of the read/write .RW bit (07) places the block transfer in the active buffer if the queue is empty; the processor sets the start .ST bit (14) and begins the transfer places the block transfer in the queue if the active buffer is not empty; the processor sets the enabled waiting .EW bit (10) If the queue is full, block-transfer requests may not occur in the order the ladder logic requests the transfers. The processor sets the enabled waiting .EW bit (10) when the request enters the queue. The I/O scanner: transfers the request to or from the I/O chassis after the request reaches the active buffer detects whether the module responds; if the module does not respond, the processor sets the no response .NR bit (09) If there is no response and the timeout .TO bit (08) is reset, the processor re-queues the request until the watchdog timer times out (4 seconds). If there is no response and the .TO bit is set, the scanner retries the request one more time before setting the .ER bit. If the request is a: - BTW, the processor transfers the data to the module - BTR, the processor moves data from the module to the BTR data file one word at a time sets the done .DN bit (13) on completion of a valid transfer; sets the error .ER (12) bit if there were errors checks the status of the continuous .CO bit (11); if set and no error occurred, the scanner re-queues the block transfer notifies the active buffer to accept the next request For a list of block-transfer error codes, see the block-transfer instructions chapter in the programming software documentation. 8-20

Page 116

Chapter 8 Transferring Discrete and Block-Transfer Data

Programming Considerations

In a distributed control system where your process is controlled by several independent programmable controllers, make sure that your program considers the status of the PLC processors and the integrity of the communication link by using the status bits that the supervisory and adapter mode processor provide for each other. For example, consider how your process should respond if: there is an incremental degradation of the systems control due to the loss of one of the programmable controllers the supervisory processor is in program mode and someone manually activates a valve normally controlled by the supervisory processor the adapter-mode processor faults The adapter-mode processor can monitor the status of the supervisory processor by examining the status bits in the first word of the the data being transferred from the supervisory processor. The supervisory processor can monitor the status of the adapter-mode processor by examining the status bits in the first word of the data being transferred from the adapter-mode processor. The supervisory processor can also monitor the rack fault bits for the rack the adapter is emulating to determine the integrity of the remote I/O communications between the supervisor and the adapter-mode processors. For more information on rack fault bits, see the faults chapter in the programming software documentation.

General Considerations for Block-Transferring I/O Data The following are general programming considerations when you are block-transferring I/O data. When performing block transfers (processor-resident local, extendedlocal, or remote I/O) in any PLC-5 processor clear the output image table corresponding to the block-transfer module rack location before changing to RUN mode. If you do not clear the output image table, then you encounter block-transfer errors because unsolicited block transfers are being sent to the block-transfer module (i.e. if a block-transfer module is installed in rack 2, group 4, clear output word O:024 to 0. Do not use the word for storing data). If you use remote block-transfer instructions and have the timeout bit (.TO) set to 1, then the processor disables the 4 sec timer and requests additional block transfers anywhere from 0-1 sec before setting the error (.ER) bit.

8-21

Page 117

Chapter 8 Transferring Discrete and Block-Transfer Data

Considerations for Processor-Resident Local Racks The following are programming considerations when you are blocktransferring data in a processor-resident local rack. Within the processor-resident local rack, limit the number of continuous-read block transfers to 16 transfers of 4 words each or 8 transfers of 64 words each. If you attempt to exceed this block-transfer limit, a checksum error (error code -5) occurs. Block-transfer instructions to any of the following modules residing in the processor-resident local rack result in frequent checksum errors. - 1771-OFE1, -OFE2, and -OFE3 modules, all versions prior to series B, revision B. - 2803-VIM module, all versions prior to series B, revision A - IMC-120, all versions To eliminate the checksum errors, replace your modules with the current series and revision. If replacement is not possible then: 1.

Using 6200 Series PLC-5 Programming Software release 4.11/4.12 or later, go to the Processor Status screen.

2.

With the processor in PROG mode, set user control bit 4 to 1. The User Control Bit word is S:26.

3.

Change the processor mode from PROG to RUN.

Do not program IIN or IOT instructions to a module in the same physical module group as a BT module unless you know a block transfer is not in progress. If you must do this, then use an XIO instruction to examine the EN bit of the block-transfer instruction to condition the IIN and IOT.

8-22

Page 118

Chapter

9

Calculating Program Timing

Chapter Objectives

This chapter provides information to help you determine the program timing for your PLC-5 programmable controller system. If you want to read about:

Go to page:

PLC-5 processor scan time

9-1

I/O update timing: Transfer discrete data Transfer block data Instruction timing and memory requirements: Bit and word instructions File instructions

9-5 9-5 9-7 9-8 9-11

Program constants

9-13

Direct and indirect elements

9-15

System Design Determined

Choosing Hardware

Selecting Interrupt Routines

Placing System Hardware

Transferring Discrete and Block Data

Assigning Addressing Mode, Racks, and Groups

Calculating Program Timing

Choosing Communication Planning Your System Programs

Introduction to Classic PLC-5 Processor Scanning

The basic function of a programmable controller system is to read the status of various input devices (such as pushbuttons and limit switches), make decisions based on the status of those devices, and set the status of output devices (such as lights, motors and heating coils). To accomplish this, the PLC-5 processor performs two primary operations: program scanning - where - logic is executed - housekeeping is performed I/O scanning - where input data is read and output levels are set

Logic Scan Housekeeping

Program Scanning The program scan cycle is the time it takes the processor to execute the logic scan once, perform housekeeping tasks, and then start executing logic again. The processor continually performs logic scanning and housekeeping. You can monitor the program scan time using the processor status screen. Housekeeping activities for most PLC-5 processors includes: 9-1

Page 119

Chapter 9 Calculating Program Timing processor internal checks updating the input image table with processor-resident I/O input status updating processor-resident local I/O output modules with data from the output image table updating the input image table with remote I/O input status as contained in the remote I/O buffer updating the remote I/O buffer with output data from the output image table If no change in input status occurs and the processor continues to execute the same logic instructions, the program scan cycle remains consistent (in our example, at 25 ms). In real systems, however, the program scan cycle fluctuates due to the following factors: false logic executes faster than true logic different instructions execute at different rates different input states cause different sections of logic to be executed interrupt programs affect program scan times Effects of False versus True Logic on Scan Time The rung below - which changes states from one program scan to the next - changes your program scan time by about .25 ms. MVM MASKED MOVE Source N7:0 Mask 1100110011001100 Dest N7:2

I:000 00

If I:000/00 is:

Then the rung is:

On

True and the processor executes the masked-move instruction. A masked-move instruction takes 258 µs to execute (see appendix A of the PLC-5 Programming Software Instruction Set Reference, publication 6200-6.4.11).

Off

False and the processor scans the rung but does not execute it. It takes only 1.4 microseconds to just scan the rung.

Other instructions may have a greater or lesser effect. Effects of Different Instructions on Logic Scan Time Some instructions have a much greater effect on logic scan time than others based on the time it takes to execute that instruction. Program scan time is also affected by the basic construction of your ladder rungs. The sizes of rungs and the number of branches in each can cause the scan time to fluctuate greatly.

9-2

Page 120

Chapter 9 Calculating Program Timing

Effects of Different Input States on Logic Scan Time You can write your logic so that it executes different rungs at different times, based on input conditions. The different amounts of logic executed in the logic scans causes differences in program scan times. For example, the simple differences in rung execution in the following example cause the logic scan times to vary. I:000

20 JMP rung 1

02

B3:0 00 20 LBL rung 2

MVM rung 3

MVM rung 4

If I:000/02 is:

Rungs 2 and 3 are:

On Off

Skipped Executed

O:013 JMP 02

If you use subroutines, program scan times can vary by the scan time of entire logic files.

I/O Scanning The remote I/O scan cycle is the time that it takes for the processor (configured as a scanner) to communicate with all of the entries in its rack scan-list once. The remote I/O scan is independent of and asynchronous to the program scan. The scanner processor keeps a list of all of the devices connected to each remote I/O link. An example system would look like this: PLC-5/25 DH+ Rem I/O Rack 1

Rack Address 1 2 3

I/O Status Rack I/O Range Size Full IO 010/00 to 017/17 IO 020/00 to 023/17 1/2 IO 030/00 to 037/17 Full

Rack 2 Rack 3

In this example, the remote I/O channel continually scans the three racks in its scan list and places the data in the remote I/O buffer in the processor. The processor updates its own buffer and the I/O image table. During housekeeping, the two buffers are updated by exchanging the input and output data with each other.

9-3