The text of a manual · part 23 of 29
1772 Mini PLC-2/05 Processor (Cat. No. 1772-LS, LSP) Programming and Operations Manual, pages 221 to 230
Pages 221 to 230 of 289
The original document is the PDF (1.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-LSP
Page 221
Chapter 18 Programming Techniques
Table 18.A Completed Sequencer Steps
This table outlines sequencer steps. Sequencer Input Instruction Step 1 - Automation begins. NOTE: This process is fully automated, therefore each block in each step is filled.
Sequencer Output Instruction Step 2 - Conveyor motor is started, and the forward motion begins.
Step 2 - A photocell detects a bottle.
Step 3 - Fill the motor and its forward motion begins. The conveyor motor is on, but not moving forward.
Step 3- The fill tube extension begins closing limit switch 1.
Step 4 - The fill tube begins filling the bottles, bit 17 of the timer is set.
Step 4 - Bit 15 of the timer is set.
Step 5 - Filling is completed.
Step 5 - The fill tube retracts closing limit switch 2.
Step 6 - A solenoid moves the bottles to the next operation; the conveyor moves forward.
Step 6 - The process is left in automation waiting for more bottles
Step 1 - The conveyor moves forward
Task 4: Processor Instruction Program Figure 18.11 is an example of a program rung that represents your worksheets. Figure 18.11 Program Rung Example Sequencer Input 200 Counter Addr: 001 Current Step: 006 Seq Length: 2 Words Per Step: 400- 413 File: 070- 071 Mask:
Sequencer Output Counter Addr: 200 Current Step: 001 Seq Length: 006 Words Per Step: 2 File: 600- 613 Mask: 075- 076
Input Words 1: 110 2. 201 3: 4:
Output Words 1: 012 2. 013 3: 4:
200 EN 17 200 DN 15
Task 5: Programming Your Processor Module Enter the program written for Task 4.
Chapter Summary
We showed you several programming techniques. The next chapter describes special troubleshooting techniques.
18-13
Page 222
Chapter
19
Program Troubleshooting
Chapter Objective
This chapter describes special troubleshooting technique: run time errors bit monitor/manipulation contract histogram force functions temporary end instruction ERR message for an illegal opcode
Run Time Errors
What are Run Time Errors? Run time errors are errors that occur while the processor executes your program, and are only apparent during this time. These errors result from improper programming techniques. For example, it is possible to program a series of instructions in which the processor cannot properly perform the operation. Or it is possible to program paired instructions, such as a Jump/Label, with improper syntax. In remote test mode, if a run-time error occurs, your processor module halts program operation. The RUN/FAULT indicator illuminates red. In the run/program mode, you get no indication. Diagnosing a Run Time Error The following steps help you diagnose rung time errors: 1.
Connect your industrial terminal to the processor.
2.
Turn on the industrial terminal and notice the message, RUN-TIME ERROR. If the industrial terminal is already connected, then your ladder diagram is replaced by the display showing the run-time error message.
3.
Press 11 to display the instruction that caused the error.
4.
Correct the run time error by editing your program
19-1
Page 223
Chapter 19 Program Troubleshooting
Table 19.A Possible Causes of Run Time Errors Instruction Jump
Jumping from the main program into the subroutine area or vice versa. Jumping backwards. Omitting the label instruction corresponding to the jump instruction. Jumping over a temporary end instruction.
Label
Multiple placement of the same label identification number. Removing a label instruction but leaving its reference, the jump or jump to subroutine instructions.
Jump to subroutine
To begin your main program. To jump forward in your main program. Use in the subroutine area. Omitting a return instruction. Omitting a corresponding label instruction. Jumping over a temporary end instruction.
Return
Processor does not find a return instruction from the subroutine area. Using a return instruction outside the subroutine area.
Files
AC>PR Duplicating counter's address. Manipulating the counter's accumulated value by means of external programming equipment or data highway hardware.
Sequencer
File address is out of range. Preset value equals 0.
Block transfer
Giving the module address a non-existent I/O rack number. Incorrect block length value.
5.
Bit Monitor/Manipulation
Cause
Restart your processor.
Bit Monitor Function Bit monitor allows the status of all 16 bits of any data table word to be displayed. It can function when the processor is operating in any mode. By pressing [SEARCH]53<word address>, the status of all 16 bits of the desired word is displayed. While the cursor is in the word address field, you can use the [1] and [0] keys to change address digits. The status of the 16 bits in the next highest or next lowest word address can be displayed by pressing the [↑] or [↓] keys, respectively. Also, you can use bit monitor to display the status of force conditions. Bit Manipulation Function Bit manipulation allows image table bits to be selectively changed. It is useful in setting initial conditions in the data of word instructions. Bit manipulation can function when the processor is operating in the program
19-2
Page 224
Chapter 19 Program Troubleshooting mode. When in remote test, or run/program, the program can override the bit status in the next scan. Use the [←] and [→] keys to cursor over to any bit. With the cursor on the desired bit, you can change its status by pressing 1,0. To terminate this function, press [CANCEL COMMAND].
ATTENTION: If it is necessary to change the status of any data table bit, be sure that the consequences of the change are thoroughly understood. If not, unpredictable machine operation could occur directly or indirectly as a result of changing the bit status. Damage to equipment and/or injury to personnel could result.
Contact Histogram
The contact histogram function displays the on or off history of a specific data table bit. You can monitor this function on the industrial terminal. It can also be printed by a peripheral printer. If you use a peripheral device, set the baud for channel C of the industrial terminal. Data table bits, excluding those in the processor work areas, can be accessed by the contract histogram command. The on/off status of the bit and the length of time the bit remained on or off (in hours, minutes and seconds) is displayed. The seconds are displayed within 0.01 second (10 ms) resolution. There are two operating modes for the contact histogram, shown in Table 19.B:
19-3
Page 225
Chapter 19 Program Troubleshooting
Table 19.B Contact Histogram Functions Function Continuous contact histogram
Paged Contact histogram
Key Sequence
Mode
[SEARCH][6] (Bit Address) [DISPLAY]
Any
[SEARCH][7] (Bit Address) [DISPLAY]
Any
Description Provides a continuous display of the on/off history of the addressed bit in hours, minutes and seconds. Can obtain a hardcopy printout of contact histogram by connecting a peripheral device to Channel C and selecting proper baud rate before indicated key sequence.
[DISPLAY]
Displays 11 lines on/off history of the addressed bit in hours, minutes and seconds. Displays the next 11 lines of contact histogram. Can obtain a hard copy printout of contact histogram by connecting peripheral device to Channel C and selecting proper baud rate.
Either
[CANCEL COMMAND]
To terminate.
Continuous: Accessed by pressing [SEARCH] 6. The user command displays the histogram from that instant. Paged: Accessed by pressing [SEARCH]7. The user command displays the histogram one page at a time and requires operator action to continue the histogram once the screen is filled. After pressing [SEARCH] 6 or [SEARCH] 7, enter the bit address to be monitored. Bit addresses larger than 5 digits do not require leading zeros or the EXPAND ADDR key. After pressing [DISPLAY], the data of the histogram is displayed on every other line with 5 frames of data per line. Each frame of data contains the on/off status and the length of time in the format shown in Figure 18.1. Figure 18.1 Contact Histogram Display hr.mn.sec. -OFF or ON 00:00'00.00- -ON 00:00:00.00-OFF 00:00:00.00-ON 00:00:00.00- On Time
Off Time
On Time
If the bit is changing states faster than can be printed or displayed, a buffer stores these changes. If the buffer becomes full, all monitoring stops and a BUFFER FULL message is displayed. Subsequent changes in the on/off status of the device are lost until the histogram function finishes printing
19-4
Page 226
Chapter 19 Program Troubleshooting out or displaying the data in the buffer. Then a BUFFER RESET message is displayed and the histogram function resumes. The industrial terminal screen can display up to 11 lines of data at one time. In the continuous mode, the screen automatically displays a new page of data when the screen is full. In the paged mode, 11 lines fill the screen and the histogram stops. The buffer stores the subsequent changes until you press [DISPLAY] again. One page of data stored in the buffer is displayed. To terminate the contact histogram, press [CANCEL COMMAND]. Data table words and program words are counted and displayed.
Force Functions
There are two types of force functions: force on force off What are Force Functions? You can use force functions to selectively force an input bit or output on or off. Forcing is used only with real I/O. The processor must be operating in either the remote test or run/program mode. Force functions determine the on/off status of input and output bits by overriding the I/O scan. You can force an input bit on or off regardless of the actual state of the corresponding input device. However, forcing an output causes the corresponding output device on or off regardless of the rung logic or the actual status of the output image table bit. When you attempt forcing, the processor I/O scan slows down to do the forcing. When forcing is terminated, the processor automatically switches back to the faster I/O scan mode. Important: When in remote test mode, the processor holds outputs off regardless of attempts to force them on, even though the output bit instructions are intensified.
19-5
Page 227
Chapter 19 Program Troubleshooting
Using a Force Function You can apply forcing functions in either of two ways using: bit manipulation/monitor display of an I/O word ladder diagram display of user program By pressing [SEARCH] 53 <address>, the bit status and force status of the 16 corresponding input bits or output terminals of the desired word is displayed. use the [<-] and [->] keys to cursor to the desired bit. Or, in the ladder diagram display, you can apply forcing by placing the cursor on an examine or energize instruction. In either case, after you position the cursor, you can use any one of the following key sequences for placing or removing a forced condition: [FORCE ON][INSERT] [FORCE OFF][INSERT] [FORCE ON][REMOVE] [FORCE OFF][REMOVE] You can remove all force on or all force off functions at once in ladder diagram display by pressing either of the following key sequences: [FORCE ON][CLEAR MEMORY] [FORCE OFF][CLEAR MEMORY] The on/off status of a forced bit appears beneath the bit instruction in the rung. In all operating modes, the terminal displays a “FORCED I/O” message near the bottom of the screen when the processor forces the bits on or off. In every mode except the program mode, the terminal displays forced status “ON” or “OFF” below each forced instruction. Important: The terminal displays the on/off status of Latch/Unlatch instructions below the instruction. However, the terminal displays status only in program mode. All force functions are cleared when: you disconnect the industrial terminal from the processor the processor or industrial terminal loses ac power you press [MODE SELECT] ATTENTION: When an energized output is being forced off, keep personnel away from the machine area. Accidental removal of force functions may instantly change the state of the output device. Injury to personnel near the machine could result.
19-6
Page 228
Chapter 19 Program Troubleshooting
Forced Address Display The industrial terminal displays a complete lists of bit addresses that are forced on or off by pressing: [SEARCH][FORCE ON] [SEARCH][FORCE OFF] If all bits forced on or off cannot be displayed at one time, use the [SHIFT][] and [SHIFT][] keys to display additional forced bits. Press [CANCEL COMMAND] to terminate this display.
Temporary End Instruction
You can use the temporary end instruction to test or debug a program up to the point where it is inserted. The temporary end instruction acts as a program boundary because instructions below it in user program are not scanned or operated upon. Instead, the processor immediately scans the I/O image table followed by user program from the first instruction to the temporary end instruction. When you insert the temporary end instruction, the rungs below it, although visible and accessible, are not scanned. You can edit their content, if desired. The displayed section of user program made inactive by the temporary end instruction contains the message “INACTIVE AREA” in the lower right-hand corner of the screen. Inserting a Temporary End Instruction Keystrokes: You insert the temporary end instruction in either of two ways: First Method 1. Cursor to the last rung of the main program to be kept active. 2.
Position the cursor on the output instruction.
3.
Press [INSERT][T.END]
Second Method 1. Cursor to the first rung of the main program to be made inactive. 2.
Position the cursor on the first instruction in the rung.
3.
Press [INSERT][ ] [T.END]
19-7
Page 229
Chapter 19 Program Troubleshooting
Removing a Temporary End Instruction Keystrokes: You remove a temporary end instruction by following steps. 1.
Position the cursor on the temporary end instruction you want to remove.
2.
Press [REMOVE][T.END]
Entering a Rung After a Temporary End Instruction Keystrokes: You can enter a rung after the T.END instruction by performing the following steps. 1.
Place the cursor on the T.END instruction.
2.
Press [INSERT][RUNG].
3.
Enter the new rung.
The industrial terminal prevents you from using the temporary end instruction in any of the following ways. These ways result in a rung timer error. Using more than one temporary end instruction at a time. Using the instruction in the subroutine area. Inserting or removing the instruction during on-line programming. Placing the instruction in the path of Jump or Jump to Subroutine instructions.
ERR Message for an Illegal Opcode
An illegal opcode is an instruction code that the processor does not recognize. It causes the processor to fault and is displayed as an ERR message in the ladder diagram rung in which it occurs. The 4-digit hex value of the illegal opcode is displayed above the ERR message by the 1770-T3 industrial terminal. The illegal OP code ERR message should not be confused with ERR messages caused when a 1770-T1 or 1770-T2 industrial terminal is connected to a processor that was using a 1770-T3 industrial terminal. These industrial terminal ERR messages do not contain the 4-digit hexadecimal value and will not cause the processor to fault. If an illegal opcode occurs, compare the rung containing it to the equivalent rung in a hard copy printout of the program. You must either
19-8
Page 230
Chapter 19 Program Troubleshooting replace the error with its correct instruction, replace the instruction, or remove it. The ERR message caused by an illegal opcode cannot be removed directly. instead, remove and replace the entire rung. You should identify and correct the cause of the problem in addition to correcting the ERR message.
Chapter Summary
We showed you several special troubleshooting techniques you can use during start-up and processor operation.
19-9