The text of a manual · part 27 of 45
Enhanced and Ethernet PLC-5 Programmable Controllers User Manual: Chapter 13 - Programming Considerations, pages 219 to 226
Pages 219 to 226 of 388, from Enhanced and Ethernet PLC-5 Programmable Controllers User Manual
The original document is the PDF (5.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 1785-L20B and Allen-Bradley 1785-L40B
Page 219
Chapter
13
Programming Considerations
Using This Chapter For Information About
Go to Page
Forcing
13-1
Extended forcing
13-2
Using special programming routines
13-10
Priority scheduling for interrupts and MCPs
13-11
Defining and programming interrupt routines 13-15
Forcing
Forcing I/O lets you turn specific input and output bits on or off for testing purposes. Forcing bits on or off or forcing SFC transitions lets you simulate operation or control of a device. IMPORTANT
Forcing inputs lets you force the bits in the input image file. Forcing output lets you force the actual output module, leaving the output image table file in its original state. Forces are held by the controller (and not the personal computer). Forces remain even if the personal computer is disconnected
ATTENTION
When anything is forced on or off, keep personnel away from the machine area. Forcing can cause unexpected machine motion that could injure personnel.
Forcing Inputs and Outputs You can forces bits directly from the ladder editor or the force monitor screens in your programming software. After you configure which bits to force, you must enable forces before the forces take effect. You can only force live I/O points, which are bits in an input or output word that are physically attached to and configured for your system.
1
Publication 1785-UM012D-EN-P - July 2005
Page 220
13-2
Programming Considerations
With the controller-resident local rack set for 1/2-slot addressing, you cannot force the input bits for the upper word of any slot that is empty or that has an 8-point or 16-point I/O module. For example, if you have an 8-point or a 16-point I/O module in the first slot of your local rack (words 0 and 1 of the I/O image table, 1/2-slot addressing), you cannot force the input bits for word 1 (I:001) on or off. You can’t force: • output addresses on input instructions • input addresses on output instructions • other bit addresses other than inputs and outputs, such as N, B, T, C, etc. addresses
Forcing SFC Transitions When you monitor an SFC through your programming software, you can force transitions on or off. This lets you override the flow of your SFC for troubleshooting purposes.
Extended Forcing
Extended forcing is useful when using the 1771-SDN module because it allows you to force discrete I/O on a DeviceNet network. Extended forcing is also useful for forcing analog I/O. With series E, revision B and later Enhanced, Ethernet, and ControlNet PLC-5 controllers, you gain the capability to force a total of 1,024 block-transfer data words. These words can be either integer, binary, ASCII, or hexadecimal/BCD data type. To use the extended forcing feature, you select the block-transfer files that contain words or bits you want to force. You then use your programming software to enter this data along with the associated force values in the extended force configuration table. Once you do this, you can force all data you send or receive via block-transfer instructions. Extended forcing works with the following block-transfer instructions: • block-transfer read (BTR) • block-transfer write (BTW) • 1771 read command type of the CIO instruction • 1771 write command type of the CIO instructions
Publication 1785-UM012D-EN-P - July 2005
Page 221
Programming Considerations
13-3
The 1771 read command type of the CIO instruction operates in the same manner as the BTR instruction; the 1771 write command type of the CIO instruction operates in the same manner as the BTW instruction. For simplicity, the following descriptions and examples of extended forcing refer to the BTR instruction (for BTR and 1771 read command type of CIO instructions) and the BTW instruction (for BTW and 1771 write command type of CIO instructions). You program block-transfer instructions in the same manner, regardless of whether you configure the data file in the extended for configuration table. The following figure shows how block-transfer data table files are updated during housekeeping. BTR instruction execution
BTR Data File
BTR Data Buffer
BTR Module each housekeeping period BTW Data File
BTW Data Buffer
BTW Module
BTW instruction execution
When you use extended forcing, you affect the way your programmable controller system operates, Before you begin to use this forcing feature, read this entire section to understand the effects. ATTENTION
ATTENTION
Any block-transfers or data table locations included in the extended force configuration table will be affected regardless of whether forces are enabled.
Do not use BTR data tables files to store non-block-transfer data. All non-block-transfer data that you include in the extended force configuration table as read data will be forced to zero during housekeeping at the end of each program scan. If your ladder program expects values other than zero for this data, unpredictable machine operation could result.
Publication 1785-UM012D-EN-P - July 2005
Page 222
13-4
Programming Considerations
For BTR instructions using non-configured data tables, the .DN bit indicates when data is valid in the BTR data file. When you configure files in the extended force configuration table, the .DN bit indicates that the data is in the BTR data buffer. The BTR data is not forced and moved into the BTR data file until the next housekeeping period. Delay using the BTR data until the scan after the .DN bit is set. For BTW instructions using non-configured data tables, the data that is in the BTW data file when the block-transfer is enabled is transferred. When you configure files in the extended force configuration table, the data that in the BTW data buffer when the block-transfer is enabled is transferred. Any new data in the BTW data file is not forced or moved into the BTW data buffer until the next housekeeping period. Delay enabling the BTW instruction until the scan after the BTW data file is updated.
Increased Program Scan Time When you use the extended forcing feature, program scan time increases proportionately to the number of words you configure in the extended force configuration table. The amount of increase depends on whether you enable or disable forces. Typical increases in program scan time when you configure data table files in the extended force configuration table are: When Forces are
Scan Time Increases by this Much Per Word
Per 1000 Words enabled
0.003 ms
3.0 ms disabled
0.0015 ms
1.5 ms
I/O Force Privileges The I/O forcing privilege lets you enable, disable, or clear all forces in the controller. This privilege now includes extended forcing. Extended forcing reads force data in a read data file; extended forcing writes force output data, leaving the write data file in its original state. IMPORTANT
Publication 1785-UM012D-EN-P - July 2005
Forces are held by the controller (and not the personal computer). Forces remain even if the personal computer is disconnected.
Page 223
Programming Considerations
13-5
Using Protected Controllers If you are using a PLC-5 protected controller, you must configure forcing online since, by their design, protected controllers cannot download forcing operations. This protects controller operation from possible force operations programmed in offline mode. For more information about protected controllers, see the PLC-5 Protected Controller Supplement, publication 1785-6.5.13.
Using Selectable Timed Interrupts (STIs) and Controller Input Interrupts (PIIs) We recommend that you do not use forcible block-transfer data table files within STIs or PIIS due to the unique data flow of forcible block-transfer data. Block-transfer data that is written out or read in is never valid within the interrupt program file execution itself. Any necessary additional program scan time may defeat the purpose for programming the STI or PII.
Setting Up and Using Extended Forcing
Use your programming software to set up and use the extended forcing feature. The following table lists the software requirements for the extended forcing feature. With the Programming Software Package
You Need this Software Release
RSLogix5
2.0 or later
6200
5.3 or later
A.I. 5
8.03 or later
WinLogic 5
3.22 or later
To set up and use the extended forcing feature, you need to: 1. Select the group of data you want to force. 2. Use the programming software to enter or edit the data you want to force in the extended force configuration table. 3. Use the programming software to enter force values for the specified data table files. 4. Enable or disable the forces.
Publication 1785-UM012D-EN-P - July 2005
Page 224
13-6
Programming Considerations
Step 1 - Select Which Group of Data You Want to Force IMPORTANT
Group the data in the extended force configuration table so that you separate read date from write data. If you do not separate read and write data, you encounter error code -3 if: • program a BTW instruction using a data file that you configured in the extended force configuration table as a read application • program a BTR instruction using a data file that you configured in the extended force configuration table as a write application
You also encounter this error if you try to transfer block-transfer data that crosses the forcible range you configured in the extended force configuration table. When you select the group of data you want to force, you must select and configure data that corresponds to an entire “chunk” or multiple “chunks” of block-transfer data. For example: You want to force some data associated with block-transfer read #2 and with block-transfer read #4. To select the data, you could: • Select all of data file N11
Data Table File N11
Word
• Select N11 beginning at word 20 for 60 words (i.e., beginning at the start of BTR #2 and ending at the end of BTR #4)
0
• Make two selections, one beginning at the start of BTR #2 with the size of BTR #2 (N11:20 for 12 words), and one beginning at the start of BTR #4 with the size of BTR #4 (N11:55 for 25 words).
20
BTR #1
BTR #2 32
BTR #3 55 BTR #4 80
Publication 1785-UM012D-EN-P - July 2005
Page 225
Programming Considerations
13-7
Step 2 - Use the Programming Software to Enter or Edit the Data You Want to Force in the Extended Force Configuration Table The extended force configuration table lets you specify as many as four groups of block-transfer data words to force. Each group can contain as many as 256 words of block-transfer data. When you plan your forcing, you can group together multiple block-transfer instructions until you reach the 256-word maximum for each group. Keep in mind that the data in each group should be all read data or all write data. Specify each group by entering the address of the first block-transfer instruction in that group in the extended force configuration table. Use the programming software‘s edit function on the extended force configuration table to clear entries, modify entries, or change block-transfer instructions. Use your programming software to edit the extended force configuration table: 1. Choose the software option that lets you modify entries in the extended force configuration table. 2. Enter the file number and starting element. 3. Enter the file size (1-256 words). 4. Enter the direction of the instruction (R=read; W=write). Forced data table files must be of type B, A, N, or D or this error appears: FORCES MUST BE OF TYPE B, A, N, OR D
Data files are automatically created and their size automatically increased if necessary. To delete or reduce the size of a data file, you must use the memory map function of the programming software. If you configure a file using the extended force configuration table, you must delete the file from the extended force configuration table before you can delete it from the memory map.
Publication 1785-UM012D-EN-P - July 2005
Page 226
13-8
Programming Considerations
Step 3 - Use the Programming Software to Enter Force Values for the Specified Data Table Files The block-transfer forcing screens include a function that lets you change the radix among binary, octal, HEX/BCD, and ASCII. If you select the binary radix, the display is similar to the I/O forcing display. The programming software displays forces differently, depending on the selected radix: Radix
Force
Screen Display binary no force
. (period)
off
0 on
1 no force
. (period)
all bits forced value some bits
BINARY other
(use binary radix to view the forced bits)
If you enter a force value on the block-transfer force screen, you force the entire word to the value you enter, even if the word was only partially force before.
Step 4 - Enable or Disable the Forces Enabling and disabling extended block-transfer forces is similar to enabling and disabling I/O forces. For more information, see page 13-1.
Using Extended Forcing with Time-Critical Applications For many applications in which you execute multiple block-transfers on a continuous basis, you do not need any additional programming when using extended forcing. When you configure extended forcing, block-transfer instructions only move data between the block-transfer modules and the block-transfer data buffers. Data is forced and moved during housekeeping. In applications in which you perform a single block-transfer or in which new block-transfer data must be completely transferred in every block-transfer instruction, you must include additional programming to make sure that you are using valid, updated data.
Publication 1785-UM012D-EN-P - July 2005