The text of a manual · part 34 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 275 to 283
Pages 275 to 283 of 490, 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.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-LW /LWD, Allen-Bradley 1772-LWP, Allen-Bradley 1772-LX / LXP and Allen-Bradley 1772-LZP
Page 275
Chapter 18 Block Transfer
Keystrokes Enter a block transfer read (like this example) by performing the following steps.
BLOCK XFER 1
Block Transfer 0 appears in the lower left corner of the screen, above the processor’s current programming mode.
BLOCK X FER READ 030 DATA ADDR: 100 MODULE ADDR: 01 BLOCK LENGTH: 110- 110 FILE:
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 MODULE ADDRESS BLOCK LENGTH FILE
030 130 05 070-074 where the Data Address is the first possible timer/counter address; the Module Address is the rack, group, and slot number; the Block Length is the number of words to be transferred; and File is the address of the starting word to be transferred. The instruction should look like this: BLOCK X FER READ 030 DATA ADDR: 130 MODULE ADDR: 05 BLOCK LENGTH: 070- 074 FILE:
The Block Transfer enable bit is 01307; the done bit is 11307.
18-10
013 EN 07 113 DN 07
Page 276
Chapter 18 Block Transfer
Block Transfer Write
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. Keystrokes Enter a block transfer write (like this example) by performing the following steps.
BLOCK XFER 0
Block Transfer 0 appears in the lower left corner of the screen, above the processor’s current programming mode.
BLOCK X FER WRITE DATA ADDR: 030 MODULE ADDR: 100 BLOCK LENGTH: 01 FILE: 110- 110
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 MODULE ADDRESS BLOCK LENGTH FILE
031 130 05 060-064
The instruction should look like this: BLOCK X FER READ DATA ADDR: 031 MODULE ADDR: 130 BLOCK LENGTH: 05 FILE: 060- 064
013 EN 06 113 DN 06
The Block Transfer enable bit is 01006; the done bit is 11006.
18-11
Page 277
Chapter 18 Block Transfer
You can enter data directly into the block to be transferred. Position the cursor over the block transfer instruction and press [Display] [1]. See chapter 9.
Bi-Directional Block Transfer
Bi-directional block transfer is the sequential performance of both operations. The order of operation is generally determined by the module. Two data addresses must be used. In this example they are 030 and 031. Both contain the module address. For bi-directional operation, each data address word also contains an enable bit: bit 16 for a Write operation (in 031) bit 17 for a Read operation (in 030) Important: These bits are automatically set by the Block Transfer Read and Write instructions. When the processor searches the data addresses in the timer/counter accumulated area of the data table, it finds two consecutive data addresses both containing the same module address. The read bit and the write bit are set in two consecutive data addresses. When the processor finds a match of the module address and the read or write enable bit (read bit or write bit) for the desired direction of transfer, it then locates the file addresses to which (or from which) the data will be transferred. Figure 18.6 shows an example bi-directional block transfer.
18-12
Page 278
Chapter 18 Block Transfer
Figure 18.6 Data Table Locations for Bi-Directional Transfer 010 Data Table R W 1
1
Block Length Code
013
Output Image Table Low Byte R = Bit 7 or 17 = Read W = Bit 6 or 16 = Write
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 0608 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
013 Block Transfer Read Data Addr: Module Addr: Block Length: File:
040 130 05 070-074
EN 07 113 DN 07 013
Block Transfer Write Data Addr: Module Addr: Block Length: File:
041 130 05 060-064
EN 06 113 EN 06 10229-I
18-13
Page 279
Chapter 18 Block Transfer
Keystrokes Enter a bi-directional block transfer (like this example) by performing the following steps.
BLOCK XFER 1
Block Transfer 0 appears in the lower left corner of the screen, above the processor’s current programming mode.
BLOCK X FER READ DATA ADDR:
030
MODULE ADDR:
100
BLOCK LENGTH:
01
FILE:
110- 110
010 EN 07 110 DN 07
The Block Transfer enable bit is 01007; the done bit is 11007. Note that the words BLOCK TRANSFER READ are flashing. Insert the following values. The cursor will block automatically step through the block transfer write instruction. The values are: DATA ADDRESS MODULE ADDRESS BLOCK LENGTH FILE
030 142 05 060-064
The write instruction should look like this: BLOCK X FER READ DATA ADDR:
042
MODULE ADDR:
30
BLOCK LENGTH:
05
FILE:
18-14
070- 074
013 EN 07 113 DN 07
Page 280
Chapter 18 Block Transfer
BLOCK XFER 0
Block Transfer 0 appears in the lower left corner of the screen, above the processor’s current programming mode.
BLOCK X FER READ DATA ADDR:
030
MODULE ADDR:
100
BLOCK LENGTH:
01
FILE:
110- 110
010 EN 06 110 DN 06
Note that the words BLOCK TRANSFER WRITE are flashing. Insert the following values. The cursor will move automatically through the block transfer read instruction. The values are: DATA ADDRESS MODULE ADDRESS BLOCK LENGTH FILE
031 142 05 070-074
The read instruction should look like this: BLOCK X FER READ DATA ADDR:
042
MODULE ADDR:
130
BLOCK LENGTH:
05
FILE:
070- 074
BLOCK X FER READ DATA ADDR:
033
MODULE ADDR:
130
BLOCK LENGTH:
05
FILE:
060- 064
013 EN 07 113 DN 07 013 EN 06 113 DN 06
18-15
Page 281
Chapter 18 Block Transfer
Multiple Reads of Different Block Lengths
Under certain conditions, you might want 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 2 or more Block Transfer Read instructions: one for each desired transfer length. 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. 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 will not take place or the number of words transferred will not be the number programmed. Invalid data could be sent to a device (or could be operated upon in subsequent scans) resulting in unpredictable and/or hazardous machine operation.
The example in Figure 18.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 block length of the Block Transfer instruction is the same as the block length in that rung. The last rung sets (or energizes) the read bit of the block transfer instruction regardless of the previous changes in the 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.
18-16
Page 282
Chapter 18 Block Transfer
Figure 18.7 Programming Multiple Reads from One Module Inputs 1
2
3
BLOCK X FER READ DATA ADDR:
042
MODULE ADDR:
130
BLOCK LENGTH:
04
FILE: Inputs 1
2
3
BLOCK X FER READ DATA ADDR:
042
MODULE ADDR:
130
BLOCK LENGTH:
08
FILE: Inputs 1
Input 1 Input 2
2
3
160-163
160-167
BLOCK X FER READ DATA ADDR:
042
MODULE ADDR:
130
BLOCK LENGTH:
03
FILE:
160-162
013 EN 07 113 DN 07 013 EN 06 113 DN 06 013 EN 06 113 DN 06 014 17
Input 3
Buffering Data
Buffer block transfer data so you can validate it before you use it. Data that is read from the block transfer module and transferred to data table locations must be buffered. Data that is written to the module need not be buffered because block transfer modules perform this function internally. Buffer transferred data to ensure that both the transfer and the data are valid. As an example, readings from an open-circuited temperature sensor (invalid data) could have a valid transfer from an analog input module to the data table. Program the processor to examine data-valid and/or diagnostic bits contained in the transferred data to determine whether or not the data is valid. The block transfer done bit is set if the transfer is valid. The data-valid and/or diagnostic bits differ for each block transfer module. Some modules set one or both for the entire file of words transferred, while others set a data-valid diagnostic bit in each word. See the documentation for the block transfer module to determine the correct usage of the data valid and/or diagnostic bit(s). 18-17
Page 283
Chapter 18 Block Transfer
One technique of buffering data is to store the transferred data in a temporary buffer file. If the data in the buffer is valid, it is immediately transferred to another file in the data table where it can be used. If invalid, it is not transferred but written over in the next transfer. Another technique uses only one file. The technique prevents invalid data from being operated upon by preconditioning the rungs that would transfer data out of a file one word at a time. Diagnostic and/or data-valid bits are examined in these rungs. Data can be moved from the buffer word-by-word using Get/Put transfers, or the entire file can be moved at once using a File-to-File Move instruction. The choice depends on the kinds of diagnostic and/or data-valid bits and the objectives of the user program. Generally, when one diagnostic bit is contained in each word, a get/put transfer is used. When one is set for the entire file, a File-to-File Move instruction is used. In either case, the diagnostic bits are examined as conditions for enabling the file move or word transfer. The example in Figure 18.8 shows the memory map and ladder diagram rungs for buffering three words of data that are read from the block transfer module. The data is read and buffered in the following sequence:
18-18