The text of a manual · part 12 of 21
Remote I/O Scanner 1747-SN User Manual: RIO Block Transfer, pages 87 to 94
Pages 87 to 94 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 87
RIO Block Transfer
5-9
Table 5.2 Control and Status Bit Descriptions Control/Status Bit
Description
Enable EN (bit 15)
Block Transfer Enabled - (EN = Enabled). The processor sets/resets this bit depending on the rung state (true/false). The processor sends the enable bit to the RIO scanner when the BTR/BTW instruction is scanned. If the BT is not waiting (EW set) and is not started (ST set), and the EN bit sees a false-to-true transition, the RIO scan triggers a BT.
Start ST (bit 14)
Block Transfer Started - (ST = Started). When the instruction is scanned (true or false), the processor reads this bit from the RIO scanner. The scanner sets this bit when the BT starts. The scanner resets this bit when the ladder logic (processor) clears the EN bit indicating the BT is finished.
Done DN (bit 13)
Block Transfer Successful - (DN = Done). When this bit is set, it indicates the successful completion of a block transfer operation. When the instruction is scanned (true or false), the processor reads the DN bit from the RIO scanner. The scanner clears the DN bit when the ladder logic (processor) clears the EN bit.
Error ER (bit 12)
Block Transfer Error - (ER = Error). When this bit is set, it indicates that the process detected a failed block transfer. When the instruction is scanned (true or false), the processor reads the ER bit from the RIO scanner. The scanner clears the ER bit when the ladder logic (processor) clears the EN bit.
Enable-waiting EW (bit 10)
Block Transfer Enabled and Waiting for Block Transfer to Start - (EW = Enable Waiting). When the EW bit is set and the ST bit is clear, this indicates that a block transfer operation is pending. When the instruction is scanned (true or false), the processor reads the EW bit from the scanner. The scanner clears the EW bit after the ladder logic (processor) clears the EN bit.
Time Out TO (bit 08)
Block Transfer Time-out (TO = Time-out). You can set this bit to cancel block transfer operation by forcing the BT to time out once the Enabled Waiting (EW) bit sets and before the RIO scanner’s internal four-second block transfer timer times out or the block transfer completes. Cancelling a block transfer causes an error (ER) bit to set and an error code of -9 to display in the control structure. Note that the Time-out (TO) bit must be cleared before initiating a new block transfer. The RIO scanner ignores a block transfer request if both TO and EN bits are set at the same time.
Read-Write RW (bit 07)
Block Transfer Type. This bit is controlled by the instruction type. A “0” indicates a write operation (BTW); a “1” indicates a read operation (BTR).
In addition to the control and status bits, the control block contains two other parameters the processor uses to execute the block transfer instructions.
Requested Word Count, Word 1 (RLEN) This is used to configure BTR/BTW length information (0 to 64). Length is the number of BTR/BTW words read from or written to the RIO device. If RLEN = 0 for a BTW instruction, 64 words are sent. If RLEN = 0 for a BTR instruction, the actual length is determined by the RIO device responding to the block transfer read request.
Publication 1747-UM013B-EN-P - January 2005
Page 88
5-10
RIO Block Transfer
Transmitted Word Count/Error Code, Word 2 (DLEN) Transmitted Word Count is the status of the actual number of BTW words sent or the number of BTR words received. The processor uses this number to verify the transfer. This number should match the requested word count (unless the transmitted word count is zero). If these numbers do not match, the processor sets the ER bit (bit 12). If there is an error, the processor gives the error code in Word 2 of the control structure in the form of a negative number. See Table 5.3, “BTR/BTW Error Codes,” for a list of error codes. Only one error code is stored at a time (a new error code overwrites the previous error code).
Table 5.3 BTR/BTW Error Codes
Publication 1747-UM013B-EN-P - January 2005
Error Code
Description
0
The block transfer completed successfully.
-6
Illegal block transfer length requested.
-7
Block transfer communication error occurred when block transfer request was initiated.
-8
Error in block transfer protocol.
-9
Block Transfer Time-out - Either the SLC user program cancelled the block transfer or the scanner’s block transfer timer timed out. Note that a time-out error occurs if a block transfer is attempted at a location that is not configured for block transfer operation (e.g., requesting a block transfer for a location that is an output module).
-10
No RIO channel configured.
-11
Attempted a block transfer either to a non-configured block transfer device (i.e., an invalid logical rack, group, or slot), or at a complementary device location where there is no corresponding primary image space allocated.
-12
Attempted a block transfer to an inhibited device.
Page 89
RIO Block Transfer
5-11
Instruction Operation 1. The scanner processes the BTR/BTW when it detects that the SLC control program rung, which contains the BTR/BTW, goes true. If the RIO scanner detects any problem at this point (such as invalid block transfer control field, or unconfigured device), the control structure word 2 fills with the error code and the ER bit (bit 12) is set. If no problems occur, the EW bit (bit 10) and ST bit (bit 14) are set in the control block.
TIP
The ST bit is not set if the scanner is already in the process of block transferring data to a location within the same logical RIO rack. The ST bit is set only after any previous pending block transfers to the same logical rack are completed and the block transfer request is scheduled on the RIO link.
The SLC control program can monitor the block transfer by examining bits in word 0 of the control block. They indicate when the scanner has started processing (EW and ST) the block transfer and whether the block transfer operation completed successfully (DN) or failed (ER). The SLC control program can take different actions based on these status bits. 2. When a block transfer completes successfully, the DN bit is set. This indicates that the block transfer control block has been updated with the actual transmitted word count. This is important for BTR instructions, because this indicates the number of valid data words received from the remote device. This data is stored in the BTR data file. 3. If the block transfer fails, the length field and the data file are not updated. The ER bit is set and the error code field indicates the problem. 4. The SLC control program must indicate to the scanner when it is done processing the status word in the control structure (because DN or ER was set) so the corresponding control bits can be reused for another block transfer operation. The SLC control program indicates that it is done processing the block transfer when it solves the BT rung false, which clears the EN bit in the control block.
Publication 1747-UM013B-EN-P - January 2005
Page 90
5-12
RIO Block Transfer
5. When the RIO scanner detects that the EN bit cleared, it then clears the EW, ST and DN or ER bits, as well as the Transmitted Word Count/Error Code. This ensures that the status bits in the control block are not reflecting the results of the previous block transfer operation. IMPORTANT
To prevent configuration conflicts, it is highly recommended that each M-file buffer (My:e.x00) should be used by only one block transfer instruction.
Programming Examples
Table 5.4 Block Transfer Programming Examples Figure 5.2, "Directional" on page 5-13 Figure 5.3, "Directional Repeating" on page 5-13 Figure 5.4, "Directional Continuous" on page 5-14 Figure 5.5, "Bi-directional Continuous" on page 5-14 Figure 5.6, "Bi-directional Alternating" on page 5-15 Figure 5.7, "Bi-directional Alternating Repeating" on page 5-15
Publication 1747-UM013B-EN-P - January 2005
Page 91
RIO Block Transfer
5-13
Figure 5.2 Directional
Figure 5.3 Directional Repeating
Publication 1747-UM013B-EN-P - January 2005
Page 92
5-14
RIO Block Transfer
Figure 5.4 Directional Continuous
Figure 5.5 Bi-directional Continuous
Publication 1747-UM013B-EN-P - January 2005
Page 93
RIO Block Transfer
5-15
Figure 5.6 Bi-directional Alternating
Figure 5.7 Bi-directional Alternating Repeating
Publication 1747-UM013B-EN-P - January 2005
Page 94
5-16
RIO Block Transfer
Comparison to the PLC-5 BTR and BTW Block Transfer Reads and Writes in SLC processors are quite similar to the instructions in the PLC-5. However, some differences exist between them, as shown in Table 5.5 on page 5-16.
Table 5.5 Block Transfer Comparison SLC
PLC-5
Control Block
3-element integer (N) type
5-element integer (N) type or 1-element block transfer (BT) type.
EN (Enable Bit)
Follow BT rung state.
Gets set when BT rung goes true. Remains set until the BT finishes or fails, and the BT rung goes false.
NR (No Response bit)
None
This bit is in control block word 0, bit 9.
CO (Continuous bit)
None
This bit is in control block word 0, bit 11.
FILE (File Number)
None
This word is control block word 3.
ELEM (Element Number)
None
This word is control block word 4.
Error Codes
7 error codes
11 error codes
BTR/BTW number limitation 32 for one scanner/channel
64
BT Status Bits
Can change at any point in the program scan.
IMPORTANT
Publication 1747-UM013B-EN-P - January 2005
Can only change when BT rung is scanned.
Do not manipulate the I/O image words of the RIO scanner for modules to which you are block transferring. These words are used by the RIO scanner and the remote device as block transfer handshake bits. Any manipulation of them by the user program while a block transfer is in progress causes the block transfer to fail.