The text of a manual · part 11 of 21
Remote I/O Scanner 1747-SN User Manual: RIO Block Transfer, pages 79 to 86
Pages 79 to 86 of 171, from Remote I/O Scanner 1747-SN User Manual
The original document is the PDF (1.1 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 1747-SN
Page 79
Chapter
5
RIO Block Transfer
This chapter contains the following information: • RIO block transfer theory of operation • RIO block transfer general functional overview • scanner’s block transfer buffer layout • detailed operation of RIO block transfer • RIO block transfer application considerations • steps for setting up a block transfer • quick reference for using status and control bits • block transfer control logic examples
RIO Block Transfer Theory of Operation
This section provides a conceptual overview of block transfer as it pertains to SLCs, RIO scanners, and remote devices. For specific functionality details, refer to Using Block Transfer Instructions (BTR and BTW) on page 5-5.
What Is RIO Block Transfer? RIO Block Transfer is a data transfer mechanism that allows you to control the transfer of up to 64 words of data to or from a remote device over the Allen-Bradley RIO link. A Block Transfer Read (BTR) is used when a remote device transfers data to the SLC. A Block Transfer Write (BTW) is used when an SLC processor writes data to a remote device. The diagrams on the following pages illustrate the concepts of how block transfers occur using an SLC processor, an RIO scanner, and a remote device. The first diagram illustrates the path a block transfer follows. The second and third diagrams illustrate in greater detail the theory of operation of a BTR and a BTW, respectively.
1
Publication 1747-UM013B-EN-P - January 2005
Page 80
5-2
RIO Block Transfer
RIO Block Transfer Theory of Operation - Path of Block Transfer Chassis Backplane SLC Processor (SLC 5/02 or above)
Refer to the diagrams on the following pages for more details on BTR and BTW sequence of operation.
RIO M Scanner Files
Block Transfer Write (BTW) data travels from the SLC processor across the chassis backplane via the scanner’s M files. The scanner then sends the data across the RIO link to the adapter or intelligent I/O module.
M Files I/O Image
RIO Link = path of a Block Transfer (BT)
Adapter or Intelligent I/O Module
Block Transfer Read (BTR) data travels from the adapter or intelligent I/O module over the RIO link to the scanner. The chassis backplane then transfers BTR data via the scanner’s M files to the SLC processor. The SLC control program processes the data once the SLC receives it from the scanner.
RIO Block Transfer Theory of Operation - Block Transfer Read (BTR) In this example, Logical Rack 0, Logical Group 0, Logical Slot 1 is used. One byte is consumed from the input and output image file for handshake purposes. Input Image Output Image Chassis Backplane SLC 5/02 Processor (or later)
M0 file M1 file
Logical Rack 0
1747 RIO Scanner M Files
I/O Image Logical Rack 3 RIO Link
Group 0 Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 Group 7 Group 0 Group 1
Word 0 Word 1 Word 2 Word 3 Word 4 Word 5 Word 6 Word 7 Word 8 Word 9
Group 7 Group 0 Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 Group 7
Word 23 Word 24 Word 25 Word 26 Word 27 Word 28 Word 29 Word 30 Word 31
= path of the BTR
Adapter or Intelligent I/O Module
Publication 1747-UM013B-EN-P - January 2005
Slot 0
Slot 0 Slot 1
Slot 1
Page 81
RIO Block Transfer
5-3
The steps below detail a successful Block Transfer Read (BTR). 1. The M0 file contains BTR control information which controls (initiates) the scanner BTR operation. (Refer to the Block Transfer Buffer Layout section for details on control information.) 2. The SLC control program initiates a block transfer read by commanding the scanner to perform the read operation. The adapter/intelligent I/O module sends BTR data across the RIO link to the RIO scanner. 3. The scanner writes the BTR data to a unique M1 file location that you specify. Also, one byte of the scanner’s I/O image file is used for “handshake” purposes between the scanner and the adapter/intelligent I/O module. Note that the SLC control program must never read or write to this “handshake” image space. 4. Using the M1 file and a COP instruction in the control program the scanner transfers the BTR data to the SLC processor via the chassis backplane. The M1 file also contains BTR status information. (See the Block Transfer Buffer Layout section for details on status information.) 5. The SLC control program processes the BTR information.
Publication 1747-UM013B-EN-P - January 2005
Page 82
5-4
RIO Block Transfer
RIO Block Transfer Theory of Operation - Block Transfer Write (BTW) In this example, Logical Rack 3, Logical Group 7, Logical Slot 1 is used.
Slot 0 Slot 1
Slot 0
Slot 1
Input Image Output Image Chassis Backplane SLC 5/02 Processor (or later)
M0 file M1 file
Logical Rack 0
1747 RIO Scanner M Files
I/O Image Logical Rack 3 RIO Link
Group 0 Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 Group 7 Group 0 Group 1
Word 0 Word 1 Word 2 Word 3 Word 4 Word 5 Word 6 Word 7 Word 8 Word 9
Word 23 Word 24 Word 25 Word 26 Word 27 Word 28 Word 29 Group 6 30 Word Group 7 Word 31
Group 7 Group 0 Group 1 Group 2 Group 3 Group 4 Group 5
= path of the BTW Adapter or Intelligent I/O Module
One byte is consumed from the input and output image file for handshake purposes.
The steps below detail a successful Block Transfer Write (BTW): 1. The user’s control program executes a MOV or COP instruction to the M0 file to initiate a BTW. The SLC processor sends BTW data (via the chassis backplane) to the scanner’s M0 block transfer control and write data file. (See the Block Transfer Buffer Layout section for details on control information.) 2. The scanner reads the BTW data and control data from the M0 file. One byte of the scanners’s I/O image file is used for handshake purposes. Note that the SLC user program must never read or write to this image space. 3. The M1 file contains BTW status information. (See the Block Transfer Buffer Layout section for details on the status information.) 4. The RIO scanner transfers BTW information across the RIO link to the adapter. 5. The adapter transfers the BTW information to the appropriate adapter or intelligent I/O module. Publication 1747-UM013B-EN-P - January 2005
Page 83
RIO Block Transfer
5-5
Block transfer instructions are supported by SLC 5/03 (OS302, Using Block Transfer Series C), SLC 5/04 (OS401, Series C) and SLC 5/05 (OS501, Series C) Instructions (BTR and BTW) and higher processors only. For application examples for block transferring with SLC 5/02 processors, refer to Appendix D. With block-transfer instructions, you can transfer up to 64 words to or from a remote device over an Allen-Bradley Remote I/O (RIO) link. A Block Transfer Read (BTR) is used to receive data from a remote device. A Block Transfer Write (BTW) is used to send data to a remote device. The RIO Series B scanner (1747-SN) and the back-up scanner (1747-BSN) perform block transfers via M0 and M1 file buffers.
BTR Block Transfer Read Rack Group Slot Control Block Data File Buffer File Requested Word Count Transmitted Word Count
BTW Block Transfer Write Rack Group Slot Control Block Data File Buffer File Requested Word Count Transmitted Word Count
EN 0 0 0 N10:140 N21:100 M1:1.3200 0 0
DN ER
EN 0 0 0 N10:10 N20:0 M0:1.100 0 0
A false-to-true rung transition initiates a BTW or BTR instruction. The BTW instruction tells the processor to write data stored in the BTW Data File to a device at the specified RIO rack/group/slot address. The BTR instruction tells the processor to read data from a device at the specified RIO rack/group/slot address and store it in the BT Data File. A total of 32 block transfer buffers are available; you can execute a maximum of 32 different block transfers. The processor runs each block transfer request in the order it is requested. When the processor changes to Program mode, all pending block transfers are cancelled. A BTR or BTW instruction writes information into its control structure address (a three-word integer Control Block) when the instruction is entered. The processor uses these values to execute the transfer.
DN ER
You must enter an M1 file address into BTR Instructions and an M0 file address into BTW Instructions. However, each instruction uses both the M0 and M1 file for that buffer number (1 through 32). For example, to use the first available buffer (1) for a BTR, enter M1:e.100 into the “Buffer File” field. However, M0:e.100 is also used by this BTR. So, the next BT instruction must use another M-file buffer (2 through 32).
RIO Block Transfer General Functional Overview The RIO scanner performs block transfers through control/status buffers allocated in the scanner’s M0 and M1 files. For BTW’s, the data stored in the File is copied into the M0 block transfer buffer, the M0 block transfer buffer is then transferred to the RIO device. The corresponding M1 block transfer buffer contains only BTW status information. For BTR’s, the M0 block transfer buffer contains only BTR control information. The actual data read from the remote device is received in the scanner’s M1 block transfer buffer. This data is then copied into the BTR Data File. A total of 32 block transfer control/status buffers exist in the M0 (output/control) and the M1 (input/status) files.
Publication 1747-UM013B-EN-P - January 2005
Page 84
5-6
RIO Block Transfer
Parameters for BTR and BTW The instructions have the following parameters: • Data File - The address in the SLC processor’s data file containing the BTW or BTR data. • BTR/BTW Buffer File - Block transfer buffer file address; i.e. M0: e.x00, where “e” is the slot number of the scanner and “x” is the buffer number. The range of the buffer number is from 1 to 32. Each BTR and BTW instruction uses both the M1 and M0 files for a specific buffer number. M0 is used for BTR and BTW control and for BTW data. M1 is used for BTR and BTW status and BTR data. • Control - The control block is an integer data file address that stores all the block transfer control and status information. The control block is three words in length. Note that these integer file addresses should not be used for any other instructions. You should provide the following information for the control structure. – Rack - The I/O rack number (0 to 3) of the I/O chassis in which you placed the target I/O module. – Group - The I/O group number (0 to 7) which specifies the position of the target I/O module in the I/O chassis. When using 1/2-slot addressing, only even group numbers are valid. – Slot - The slot number (0 or 1) within the group. When using 2-slot addressing, the 0 slot is the low (right) slot and the 1 slot is the high (left) slot within the group. When using 1-slot or 1/2-slot addressing, always select slot 0. – Requested Word Count - The number of words to transfer. If you set the length to 0, the processor reserves 64 words for block transfer data. The block transfer module transfers the maximum words the adapter can handle. If you set the length from 1 to 64, the processor transfers the number of words specified.
TIP
Publication 1747-UM013B-EN-P - January 2005
The three-word control block has the following structure. Before executing a block transfer, the BTR and BTW instructions clear all status bits and initialize word 2 to 0. See Table 5.1, “Control Block Structure,” for more information.
Page 85
RIO Block Transfer
5-7
. Table 5.1 Control Block Structure
Word 0
15
14
13
12
EN
ST
DN
ER
11
10
9
EW
8
7
6
TO
RW
Word 1
Requested word count
Word 2
Transmitted word count/Error code
5
4
3
2
Rack
1
Group
0 Slot
Control Status Bits To use the BTR and BTW instructions correctly, examine the instruction’s control and status bits stored in the control structure. These bits are mapped to bits in word 0 of the control block structure. Figure 5.1 Successful Block Transfer
Control Bits
Control Information
EN TO Status Information Status Bits EW ST ER DN
122
3
4
5
Publication 1747-UM013B-EN-P - January 2005
Page 86
5-8
RIO Block Transfer
Successful Block Transfer Read/Write The illustration on the previous page shows a successful BT operation. 1. The SLC control program copies new data to the data file (BTW only) and solves the BT rung true, which sets the enable (EN) bit. 2. The scanner detects that the EN bit is set, validates the control block information, puts the BT request on the RIO link successfully, and since no other BTs are pending for the same logical rack, sets the enable waiting (EW) and start (ST) bits. 3. The scanner receives a BT reply (with no errors) from the RIO link device, copies the received data to the data file (BTR only) and sets the done (DN) bit. 4. The SLC control program detects the DN bit, processes the BTR data and solves the BT rung false, which clears the enable (EN) bit. 5. The scanner detects that the SLC control program has completed processing (because the EN bit is clear) and clears the EW, ST and DN bits. At this point, the SLC control program could re-initiate the same BT operation by solving the BT rung true again.
TIP
IMPORTANT
Publication 1747-UM013B-EN-P - January 2005
Except for the time-out bit, TO (bit 08), do not modify any controller status bits while the block transfer is in progress.
The BTR/BTW instruction must be scanned (true or false) in order to update the control and status bits.