The text of a manual · part 35 of 59
Mini-PLC-2/02, 2/16, 2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual: 18 - Block Transfer, pages 285 to 293
Pages 285 to 293 of 492, from Mini-PLC-2/02, 2/16, 2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual
The original document is the PDF (2.5 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-LX / LXP
Page 285
Chapter 18 Block Transfer
Figure 18.8 Buffering Data
R 1 1
0
Block Length Code
4
0
Block Transfer Data (Buffer)
Data in the buffer file 050-052 will be moved to 150-152 when:
030
A. Done Bit 114/07 is set (Valid transfer)
050
B. Diagnostic Bit is TRUE for each word to be moved in rungs 5-7 (valid data)
052
R 1
0
014
0
5
Block Transfer Data (Valid)
114
0
130 150 152
Rung 1 111
Block Transfer Read Data Addr: 030 Module Addr: 140 Block Length: 03 File: 050- 052
11
07 010 02 010 02 010 07
050 G 111
Rung 2
051 G 222
Rung 3
052 G 333
Rung 4
Diagnostic Bit
014 EN 114 DN
07
07
150 PUT 111 151 PUT 222 152 PUT 333 10228-I
1.
When rung 1 is true, bit 014/07 (the block transfer enable bit) is turned on and block transfer is requested.
2.
Block transfer is enabled during the program scan. The transfer is performed during an interruption of the next I/O scan. Data from the 18-19
Page 286
Chapter 18 Block Transfer module is loaded into words 050-052. When block transfer is complete, done bit 114/07 is set in the input image table byte. This indicates the block transfer was successfully performed. The processor then continues with the I/O scan and program scan. 3.
Two Get Method
In rung 2, bit 114/07 is still on and a diagnostic bit is examined to ensure the data read from the module is valid. Assuming the data is valid, the diagnostic bit is on and the data is transferred from word 050 to 150. In rungs 3 and 4, the data in words 051 and 052 is transferred to words 151 and 152 if the appropriate diagnostic bits are on.
If you are using a 1770-T1 or -T2 industrial terminal to program a processor and you want to perform block transfer, you must use the two Get method. The Block Transfer rung must be programmed in a certain format (Figure 18.9). It consists of condition instructions that are optional, two Get instructions and an Output Energize instruction. Figure 18.9 Block Transfer Rung WYZ G RGS
0RGST
XYZ G ABC optional conditions
10389–I
Here is an explanation of the optional conditions:
18-20
This Condition:
Examine the:
WYZ
First timer/counter address (accumulated area).
XYZ
Timer/counter address 1008 higher than WYZ (preset area).
RGS
Location of the block transfer module (I/O rack, module group. and module slot. S is a zero for the left slot and a 1 for the right slot. For a 2-slot module, S is always zero.
ABC
Starting address where data in transferred to/from.
0RGST
Output energize initiates Block Transfer. 0 = output byte R = rack G = module group S = module slot T = 6 for write operation; 7 for read operation
Page 287
Chapter 18 Block Transfer
First Get Instruction The first Get instruction (Figure 18.9) identifies the rack location of the block transfer module. The location must be stored in the first available address in the timer/counter accumulated value area of the data table, starting with 030. When more than one block transfer module is used, consecutive addresses must be assigned in this area. As its “data,” the first Get instruction stores the location of the block transfer module with the first digit as the rack number, the second as the I/O group number, and the third as the slot number. The processor searches the timer/counter accumulated area for a match of the module’s rack, group, and slot number. Important: Place a 2-slot module in a complete group. Do not overlap a module group when using 2-slot addressing. Second Get Instruction The second Get instruction (Figure 18.9) must be assigned an address in the timer/counter preset area of the data table, 1008 words above the first Get address. As its “data,” the second Get instruction stores a data table address that designates the beginning of the file area reserved for block transfer data. During a read operation, data is loaded into consecutive word locations starting with the designated file address. During a write operation, data is sent to the module from consecutive word locations starting with the designated file address. Important: When you reserve an area for block transfer data, select an appropriate address to ensure all block transfer data is located in one 100 word (octal) accumulated data storage area or preset area (Figure 18.10). If you select an address so the block transfer data cannot be located in a single 100 word (octal) area, the processor jumps 1008 words to the next preset or accumulated area. If you have timers or counters in these areas, the block transfer writes over these values which may cause undesirable operation.
18-21
Page 288
Chapter 18 Block Transfer
Figure 18.10 Selecting Block Transfer Data Area 010 013
Output Image Table
1
1
Timer/ Counter AC Area
3
1
060
Block Transfer Data
067
Analog input module (8 bit) located in Rack 1 Module Group 3, Slot 1
110
Input Image Table 0
6
Timer/ Counter PR Area
030 G 131
027 030
130 G 060
0
127 130
013 17 10382-I
Output Energize Instruction The Output Energize instruction (Figure 18.9) initiates the block transfer. It is given an address that indicates the module location and the type of block transfer operation. The first digit of the address is always 0 for output byte, even though an input or output block transfer module can be used. The next three digits identify the module location by rack, group, and slot. The last digit is either a 6 to enable a write or a 7 to enable a read. When the block transfer is successfully completed, the Read or Write done bit is set in the corresponding Input Image Table byte. Bi-Directional Block Transfer A bi-directional operation requires one rung for a read operation and one rung for a write operation. Consecutive addresses in the timer/counter area of the data table should be selected for the Get instructions (Figure 18.11). For example, the first Get instruction of both rungs should be assigned consecutive word addresses such as 030 and 031. Both will have the same “data” to identify the module location.
18-22
Page 289
Chapter 18 Block Transfer
Figure 18.11 Data Table Location for Bi-Directional Block Transfer R W 1 1
013
RW 1
2
3
0
1
2
3
0
Block Transfer Write
030 031
030 G 130 031 G 130
130 G 050 131 G 060
06 013 07 030 16
050 060
Block Transfer Read
013
031 17
1
1
113
0
5
0
0
6
0
130 131
5 words of data are to be written to the bi-directional block transfer module starting from word 0508. 5 words of data are to be read from the module and loaded into the data table starting at work 0608 Bit 6 or 7 is set if a successful block transfer occurred
10383-I
The second Get instruction of both rungs will be assigned addresses 1008 words above the first Get instructions. As “data,” they will store the starting address for block transfer data such as 050 and 060. The Output Energize instruction is addressed for a write operation in rung 1 and a read operation in rung 2. To let the processor know whether a read or write operation is to be performed, bit 16 or 17 of the first Get instructions must be set On (Figure 18.11). This can be done by programming an Output Energize or Output Latch instruction unconditionally. For example, in Figure 18.11 bit 16 of word 030 is set on to indicate a write operation. Bit 17 of word 031 is set on to indicate a read operation.
Support Rungs
There are additional techniques that can be used to support the block transfer operation: Loading Zeros Setting the number of words to be transferred
18-23
Page 290
Chapter 18 Block Transfer
Of these support rungs, buffering data must be programmed to ensure the block transfer data is valid. Other techniques, such as an Immediate Output instruction or a scan monitor, can also be programmed. The IOT instruction requests a block transfer more than once per scan by assigning it the output word address corresponding to the module’s location. Program the IOT rung immediately following the block transfer rung. A scan monitor monitors the number of scans that occurred between each block transfer operation. For programming information on the scan monitor, see the documentation for the block transfer module. Also, if the number of words to be transferred or the location of block transfer data must change at different times, special programming techniques must be used. Loading Zeros One rung that can be programmed is a Get/Put transfer (Figure 18.12). It loads zeros into the timer/counter accumulated word, immediately following the last block transfer Get address that identifies the module location. The Get/Put transfer is programmed by selecting an unused storage word for the Get instruction and entering zeros for its BCD value. When a block transfer is requested, the processor starts at the first timer/counter address and searches the timer/counter area until it finds the module’s rack, group, and slot number or timer/counter address with all zeros. By loading zeros into this consecutive Timer/Counter word following the last Block Transfer instruction, the processor will not search the remaining timer/counter area. In addition, the processor will not find another BCD value that may, by chance, be the same number as the rack, group or slot number.
18-24
Page 291
Chapter 18 Block Transfer
Figure 18.12 Loading Zeros
R 1
W 011 012
1 1
1
0
030
1 0
2 0
0 0
031 032
Block Transfer Data (Read)
050 060
Block Transfer Data (Write)
111
1 1
070 G 000 030 G 110 031 G 120
112
0
5
0
130
0
6
0
131
Bit 6 of 7 if a successful block transfer occurred.
032 PUT 000 130 G 050 131 G 060
011 07 012 06
10384-I
18-25
Page 292
Chapter 18 Block Transfer
Setting the Number of Words to Transfer Each block transfer module has a default value that specifies the maximum number of words that can be transferred. Either the default value or some lesser value can be selected. For bi-directional block transfers, use the default value of the module. The default value varies from one kind of module to another, consult the appropriate module documentation for specifics. When you what fewer words, set the number of words to be transferred by programming support rungs. The number of words is stored in the upper or lower Output Image Table byte that corresponds to the module’s location in the I/O rack. The appropriate bits must be set On to specify a binary value that equals the number of words to transfer (Figure 18.13). These bits can be set On by programming unconditional Output Energize or Output Latch instructions. Figure 18.13 Setting the Number of Transfer Words Read 5 words from module
1
0
0 0
4
1
0
1 0
0
0
030
050
Block Transfer Data
1
1 014
054
1 0 1 114
5
0
# Words To Transfer Default
Bit Pattern 7 6 5 4 3 2 1 0 0 0 0 0 0 0
1
0 0 0 0 0 1
2
0 0 0 0 1 0
3
0 0 0 0 1 1
4
0 0 0 1 0 0
5
0 0 0 1 0 1
62
1 1 1 1 1 0
63
1 1 1 1 1 1
64
0 0 0 0 0 0
Bit 6 of 7 if a successful block transfer occurred.
130
10385-I
18-26
Page 293
Chapter 18 Block Transfer
For example, 5 words can be transferred by setting bits 00 and 02 high unconditionally in output image table word 014. The binary equivalent of 5, as stated in the look-up table, is 000101.
18-27