The text of a manual · part 49 of 59
Mini-PLC-2/02, -2/16, -2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual: 26 - Program Troubleshooting
Pages 400 to 409 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.5 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-LX / LXP
Page 400
Chapter
26
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
The processor and the 1770-T3 Industrial Terminal can diagnose certain errors that occur during the execution of your program. 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 that the processor cannot properly perform. Or, it is possible to program paired instructions, such as a Jump/Label, with improper syntax. If a run time error occurs and your processor is in the Run or Run/Program mode, the processor’s green run LED goes out and it displays a run time error. The instruction with the illegal data is intensified on the industrial terminal screen, after re-entering the PLC-2 mode from the mode selection screen. The processor is automatically placed in the Remote Program mode. After you correct the program, change the mode select switch from Run or Run/Program to Program mode and then to Run or Run/Program mode. Or, you can cycle power in the Run mode to get the processor running again (if the processor’s keyswitch is in the Run mode).
26-1
Page 401
Chapter 26 Program Troubleshooting
Diagnosing a Run Time Error The following steps help you diagnose run time errors: 1.
Connect your industrial terminal to the processor.
2.
Turn on the industrial terminal and notice the message, PLC-2 RUN-TIME ERROR. Press [1] [1] to continue. If the industrial terminal is already connected, then your ladder diagram is replaced by the display showing the run time error message on the mode selection screen.
3.
Press [1] [1] to display the instruction that caused the error.
4.
Correct the run time error by editing your program (Table 26.A).
5.
Restart your processor.
Table 26.A Possible Causes of Run Time Errors Instruction
26-2
Cause
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.
Page 402
Chapter 26 Program Troubleshooting
Bit Monitor/Manipulation
The bit monitor allows the status of all 16 bits of any data table word to be displayed. Bit manipulation allows data table bits to be selectively changed and is useful in setting initial conditions in the data of word instructions. Bit Monitor Function The bit monitor can function when the processor is operating in any mode. By pressing [Search] [5] [3] <word address>, the status of all 16 bits of the desired word is displayed. While the cursor is in the status field, you can use the [1] and [0] keys to change the addressed digit data/status values. 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 force or display the status of force conditions. Bit Manipulation Function Bit manipulation can function when the processor is operating in the Program or Remote Program mode. When in Remote Test, or Run/Program mode, the program can override the bit status in the next scan. Use [→] or [←] to cursor over to any bit. With the cursor on the desired bit, you can change its status by pressing [1] and [0]. To terminate this function, press [Cancel] [Command].
ATTENTION: If you need 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 1770-T3 Industrial Terminal. You can print it by a peripheral printer. If you use a peripheral device, set the baud rate for channel C of the Industrial Terminal to the baud rate of your printer.
26-3
Page 403
Chapter 26 Program Troubleshooting
Data table bits, excluding those in the processor work area can be accessed by the contact 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 on the Industrial Terminal. The seconds are displayed within 0.01 second (10 ms) resolution. Two operating modes for the contact histogram shown in Table 26.B are: 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. Table 26.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
[DISPLAY]
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. 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.
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 26.1.
26-4
Page 404
Chapter 26 Program Troubleshooting
Figure 26.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 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].
Force Functions
You can use the force functions to selectively force an input bit or output bit on or off. The processor must be operating in the remote test or run/program mode. The force functions determine the on/off status of input bits 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 terminal causes the corresponding output device to be on or off regardless of the rung logic or the 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. When the processors is in the remote test mode, it holds outputs off regardless of attempts to force them on, even though the output bit instructions are intensified. Bits may only be forced in the active input or output image tables. Enter [Search] [5] [0] to view the number of input/output racks available.
26-5
Page 405
Chapter 26 Program Troubleshooting
Using a Force Function You can use force 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] [5] [3] <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] Removing a Force Function 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 Industrial 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 Industrial Terminal displays forced status “on” or “off” below each forced instruction. Important: The industrial terminal displays the on/off status of Latch/Unlatch instructions below the instruction. However, the industrial terminal displays the status of Latch/Unlatch bits only in the Program/Remote 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]
26-6
Page 406
Chapter 26 Program Troubleshooting
ATTENTION: When an energized output is being forced off, keep personnel away from the machine area. Accidental removal of force functions instantly energizes the output device. Injury to personnel near the machine could result.
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, then scans the 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 on the Industrial Terminal screen. Inserting a Temporary End Instruction Insert a Temporary End instruction in either of two ways: First Method (Entering from the Remote Program or Program mode) 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].
26-7
Page 407
Chapter 26 Program Troubleshooting
Second Method (Entering from the Remote Program or Program mode) 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].
Removing a Temporary End Instruction Remove a Temporary End instruction by performing the following steps. 1.
Position the cursor on the Temporary End instruction you are going to remove.
2.
Press [Remove] [T. End].
Entering a Rung After a Temporary End Instruction Enter a rung after a Temporary End instruction by performing the following steps. 1.
Place the cursor on the Temporary End instruction.
2.
Press [Rung].
3.
Enter the new rung.
The industrial terminal prevents you from using the Temporary End instruction in any of the following ways, which would result in a run time error. Using more than one Temporary End instruction at a time. Using the Temporary End instruction in the subroutine area. Inserting or removing the instruction during online programming. Placing the instruction in the path of Jump or Jump To Subroutine instructions.
26-8
Page 408
Chapter 26 Program Troubleshooting
Testing Your Program
This is the last phase of testing needed to help ensure proper start-up.
ATTENTION: Only trained personnel should conduct this test. Have a trained person at appropriate emergency stop switches to de-energize output devices that could cause hazardous operation.
To test your program do the following: 1.
Connect the industrial terminal to your processor
2.
Press [Search] [5] [9] [2] to select the Remote Program mode.
3.
Enter your program.
4.
Press [Search] [5] [9] [1] to select the Remote Test mode.
5.
Examine your entered program. Make sure that no output device energizes unconditionally.
6.
Connect an output module to a single device that causes machine motion.
7.
Check the behavior of the connected output device. To do this, simulate the input conditions necessary to energize the output in the program while the processor is in the run/program mode of operation. Press [Search] [5] [9] [0].
8.
Disconnect the output device.
9.
Restore the connection from an output module to the next single output device to be tested.
10. Repeat steps 7-9 until you test all outputs. 11. Restore the connection from output modules to all devices causing machine motion. Restore power to any machine that you disconnected for start-up. 12. Perform a first run of your processor program with all output devices enabled.
26-9
Page 409
Chapter 26 Program Troubleshooting
ERR Message for an Illegal Opcode
An illegal opcode is an instruction code that theprocessor does not recognize. It causes a run time error. Important: The illegal opcode 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 replace the error with its correct 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 and correct the ERR message.
26-10