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

The text of a manual · part 17 of 29

1772 Mini PLC-2/05 Processor (Cat. No. 1772-LS, LSP) Programming and Operations Manual, pages 161 to 170

Pages 161 to 170 of 289

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 1772-LSP

Page 161

Chapter 14 Block Transfer

The boundary word data bits can be set to zero manually using bit manipulation. Use [SEARCH] 53 and insert zeros. A Get/Put transfer can be programmed assigning Get and Put instructions to the address immediately following the last block transfer data address (Figure 14.4). The value of the Get instruction is set to 000 when programmed. Figure 14.4 Defining the Data Address Area

Data Table 1

0

0

030

1

1

0

031

0

0

0

032

032 G

First word in accumulated area of data table

Last consecutive data address contains zeros to separate block transfer addresses from timer, counter and storage addresses

032 PUT 000

000

10663-I

Module Address The module address is stored in BCD by r = rack, g = module group and s = slot number. When a block transfer is performed, the processor searches the timer/counter accumulated area of the data table for a match of the module address. Block Length The block length is the number of words that the module will transfer. It depends on the type of module and the number of channels connected to it. The number of words requested by the instruction must be a valid number for the module: i.e. from 1 up to the maximum of 64. The maximum number is dependent on the type of module that is performing block transfer. The block length can also be set at the default value of the module, useful when programming bidirectional block transfers. For some modules, the default value allows the module to decide the number of words to be transferred. See the documentation for the module for for additional information. 14-6

Page 162

Chapter 14 Block Transfer

The block length heading of the instruction accepts any value from 00-63, whether or not the value is valid for a particular module. Enter 00 for the default value and/or a block length of 64. The block length is stored in binary in the byte corresponding to the module’s address in the output image table. Equal Block Lengths When the block lengths are set equal or when the default block length is specified by the programmer, the following considerations are applicable: Read and write instructions could and should be enabled in the same scan (separate but equal input conditions). Module decides which operation will be performed first when both instructions are enabled in the same scan. Alternate operation will be performed in a subsequent scan. Transferred data should not be operated upon until the done bit is set. Unequal Block Lengths Consult the user’s manual for the block transfer module of interest for programming guidelines when setting the block lengths to unequal values. ATTENTION: When the block lengths of bidirectional block transfer instructions are set to unequal values, the rung containing the alternate instruction must not be enabled until the done bit of the first transfer is set. If they are enabled in the same scan, the number of words transferred may not be the number intended, invalid data could be operated upon in subsequent scans, or analog output devices could be controlled by invalid data. Unexpected and/or hazardous machine operation could occur. Damage to equipment and/or personal injury could result. File Address The file address is the first word of the file to which (or from which) the transfer is made. The file address is stored 100 words above the data address of the instruction. When the file address is entered into the instruction block, the industrial terminal computes and displays the ending address based on the block length. When reserving an area for a block transfer file, select an appropriate address to ensure that block transfer data does not write over assigned timer/counter accumulated and preset values. The file address cannot exceed address 577708. 14-7

Page 163

Chapter 14 Block Transfer

Enable/Done Bit The read and write bits are the enable bits for block transfer modules. Either one (or both for a bidirectional transfer) is set on in the program scan when the rung containing the block transfer instruction is true. The done bit is set on in the I/O scan that the words are transferred, provided that the transfer was initiated and successfully completed. The done bit remains on for only one scan. A block transfer is requested in each program scan that the read and/or write bit remains on. The read and/or write bits are turned off when the rung containing the instruction goes false. Run-Time Errors Misuse and/or inadvertent changes of instruction data can cause run-time errors when: The module address is given a non-existent I/O rack number. A read transfer overruns the file into a processor work area or into user program by an inadvertent change of the block length code.

Block Transfer Read

Purpose: Block transfer reads data from an I/O module into the processor’s input image table in one I/O scan. Programmed as an output instruction. Block length depends on the type of module you are using. Request for transfer is made in the program scan. I/O scan is interrupted for the transfer. Done bit remains on for one scan after a valid transfer. Instruction requires two words of the data table. Figure 14.5 shows an example rung containing a block transfer read instruction and the data table areas used by the instruction.

14-8

Page 164

Chapter 14 Block Transfer

Figure 14.5 Data Table Locations for Bi-directional Block Transfer 010 Output Image Table

R 1

Data Table Block Length Code

012

Output image table byte contains read enable bit and block length in binary code.

017 027 1 Timer/ Counter Accumulated Area

2

1

Data Address contains module address in BCD.

060

First File Word

067

Last File Word

Block Transfer Data

110

R

Input Image Table

030

1

112

Input image table byte contains done bit.

117

0

Timer/ Counter Preset Area

6

0

130

Storage location of file address contains file address in BCD. R = Bit 17 = Read

113 02

Block Transfer Read Data Addr: Module Addr: Block Lengrth: File:

030 121 08 060-067

012 EN 17 112 DN 17

10225-I

14-9

Page 165

Chapter 14 Block Transfer

Keystrokes: In this example, you enter a block transfer read instruction.

[BLOCK XFER]

The screen does not change Block Xfer Read Data Addr: 030 Module Addr: 100 Block Length: 01 110- 110 File:

1

010 EN 07 110 DN 07

Note that the words BLOCK TRANSFER READ are flashing. Insert the following values. The cursor moves automatically through the instruction. The values are: DATA ADDRESS 040 MODULE ADDRESS 130 BLOCK LENGTH 05 FILE 070-074 The instruction should look like this: Block Xfer Read Data Addr: 040 Module Addr: 130 Block Length: 05 070- 074 File:

Block Transfer Write

110 DN 07

Purpose: A block transfer writes data from the processor’s output image table to an I/O module in one scan. Programmed as an output instruction. Block length depends on the type of module you are using. Request for transfer is made in the program scan. I/O scan is interrupted for the transfer. Done bit remains on for one scan after a valid transfer. Request requires two words of the data table.

14-10

010 EN 07

Page 166

Chapter 14 Block Transfer

Keystrokes: In this example, you enter a block transfer write instruction.

[BLOCK XFER]

The screen does not change Block Xfer Write Data Addr: 030 Module Addr: 100 Block Length: 01 110- 110 File:

0

010 EN 06 110 DN 06

Note that the words BLOCK TRANSFER WRITE are flashing. Insert the following values. The cursor moves automatically through the instruction. The values are: DATA ADDRESS 041 MODULE ADDRESS 130 BLOCK LENGTH 05 FILE 060-064 The instruction should look like this: Block Xfer Write Data Addr: 041 Module Addr: 130 Block Length: 05 060- 064 File:

Bidirectional Block Transfer

013 EN 06 113 DN 06

Purpose: Bidirectional block transfer is the sequential performance of both operations. The order of operation is generally determined by the module. Two rungs of user program are required, one containing the block transfer read instruction, the other containing the block transfer write instruction. When both instructions are given the same module address, the pair are considered as bidirectional block transfer instructions. Figure 14.6 shows an example rung containing a bidirectional block transfer instruction and the data table areas used by the instruction.

14-11

Page 167

Chapter 14 Block Transfer

Figure 14.6 Data Table Locations for Bidirectional Block Transfer 010 Data Table R W 1

1

Block Length Code

013

Output Image Table Low Byte

R W 1 1

1

3

0

040

1

3

0

041 060

Block Transfer Write File 070 Block Transfer Read File

1

1

113

0

7

0

140

0

6

0

141

Data Addresses

5 words of data table are to be written to the bidirectional block transfer 0508 module starting from word 5 words of data are to be read from the module and loaded into the data 0708 table starting at word

Input Image Table Low Byte

Storage Locations of File Addresses R = Bit 7 or 17 = Read W = Bit 6 or 16 = Write

013 Block Transfer Read Data Addr: Module Addr: Block Length: File:

070-

040 130 05 074

EN 07 113 DN 07 013

Block Transfer Write Data Addr: Module Addr: Block Length: File: 060-

041 130 05 064

EN 06 113 EN 06 10229-I

14-12

Page 168

Chapter 14 Block Transfer

Keystrokes: In this example, you enter a bidirectional block transfer instruction. First, enter the block transfer read instruction.

[BLOCK XFER]

The screen does not change Block Xfer Read Data Addr: 030 Module Addr: 100 Block Length: 01 110- 110 File:

1

010 EN 07 110 DN 07

Note that the words BLOCK TRANSFER READ are flashing. Insert the following values. The cursor moves automatically through the block transfer read instruction. The values are: DATA ADDRESS 040 MODULE ADDRESS 130 BLOCK LENGTH 05 FILE 070-074 The instruction should look like this: Block Xfer Read Data Addr: 040 Module Addr: 130 Block Length: 05 070- 074 File:

013 EN 07 113 DN 07

14-13

Page 169

Chapter 14 Block Transfer

Keystrokes: Now enter the block transfer write instruction.

[BLOCK XFER]

The screen does not change Block Xfer Write Data Addr: 030 Module Addr: 100 Block Length: 01 110- 110 File:

0

010 EN 06 110 DN 06

Note that the words BLOCK TRANSFER WRITE are flashing. Insert the following values. The cursor moves automatically through the block transfer write instruction. The values are: DATA ADDRESS 041 MODULE ADDRESS 130 BLOCK LENGTH 05 FILE 060-064 The completed bidirectional instruction should look like this: Block Xfer Read Data Addr: 040 Module Addr: 130 Block Length: 05 070- 074 File: Block Xfer Write Data Addr: 041 Module Addr: 130 Block Length: 05 060- 064 File:

Multiple Reads of Different Block Lengths from One Module

14-14

013 EN 07 113 DN 07 013 EN 06 113 DN 06

Under certain conditions, it may be desirable to transfer part of a file rather than the entire file. For example, a processor could be programmed to read the first two or three channels of an analog input module periodically but read all channels less frequently. To do this, use two or more block transfer read instructions: one for each desired transfer length starting at the same first word. The read instructions would have the same module address, data address and file address but different block lengths. The size of the file would equal the largest transfer.

Page 170

Chapter 14 Block Transfer

When two or more block transfer instructions have a common module address, program carefully to compensate for the following possible situations: First - During any program scan, data in the output image table byte can be changed by each successive block transfer instruction having a common module address. The enable bit can be turned on or off according to the true or false condition of the rungs containing these instructions. The on or off status of the last rung governs whether the transfer occurs. Second - The block length can be changed according to the block lengths of the enabled instructions. The block length of the last enabled block transfer instruction having a common module address governs the number of words transferred.

ATTENTION: When programming multiple writes (or reads) to the same module, it is possible that a desired transfer does not take place or the number of words transferred is not the number intended. Invalid data can be sent to a device (or can be operated upon in subsequent scans) resulting in unpredictable and/or hazardous machine operation. See the module user’s manual for any information unique to that module. The example in Figure 14.7 shows how multiple reads of different block lengths from one module can be programmed. When any one of the input switches is closed, the rung is enabled and the lock length is established. The last rung enables the block transfer instruction regardless of the previous changes in status of the enable bit. The Examine Off instructions prevent more than one of the block transfer instructions from being energized in the same scan. Important: The same discussion applies when programming multiple writes of different block lengths to one module.

14-15