The text of a manual · part 48 of 55
Hand-Held Terminal (Catalog Number 1747-PT1) User Manual: 29 - Understanding the User Fault Routine – SLC 5/02 Processor Only
Pages 413 to 420 of 486, from Hand-Held Terminal (Catalog Number 1747-PT1) User Manual
The original document is the PDF (1.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 1747-PT1
Page 413
Chapter
29
Understanding the User Fault Routine – SLC 5/02 Processor Only This chapter applies to the SLC 5/02 processor only. It covers the following topics: • recoverable and non–recoverable user faults • application examples of user fault subroutines
Overview of the User Fault Routine
The SLC 5/02 processor allows you to designate a subroutine file as a User Fault Routine. This file will be executed when any recoverable or non-recoverable user fault occurs. The file is not executed for non-user faults. The User Fault Routine gives you the option of preventing a processor shutdown upon the occurrence of a specific user fault. You do this via the designated subroutine by entering a ladder program which will prevent the fault from occurring. You can handle a number of user faults in this way, as the example on page 29–6 shows. All application examples shown are in the HHT zoom display.
Status File Data Saved Data in the following words is saved on entry to the designated subroutine and re-written upon exiting the subroutine. • S:0 Arithmetic flags
• S:13 and S:14 Math register • S:24 Index register
Recoverable and Non–Recoverable User Faults
Faults are classified as recoverable and non-recoverable user faults, and non-user faults. A complete list appears in chapter 27, “Status File.” Definitions: Non-User Fault
Non-Recoverable User Fault
Recoverable User Fault
The user fault routine does not execute.
The user fault routine executes for 1 pass. (Hint: You may initiate a MSG instruction to another node to identify the fault condition of the processor.)
The user fault routine may clear the fault by clearing bit S:1/13.
Recoverable and non-recoverable user faults are listed on the following pages. Refer to chapters 27 and 28 for additional information. 29–1
Page 414
Chapter 29 Understanding the User Fault Routine – 5/02 Processor Only
Recoverable User Faults GOING TO RUN ERRORS 0013
The required memory module is absent or either S:1/10 or S:1/11 is not set (and the program requires it).
0016
Startup protection after power loss. Error condition exists at powerup when bit S:1/9 is set and powerdown occurred while running.
RUNTIME ERRORS 0020
A minor error bit is set at the end of the scan.
0029
Indexed address reference outside of entire data file space (range of B3:0 through the last file).
INSTRUCTION ERRORS
29–2
0032
Sequencer length/position points past end of data file.
0033
Length of LFU, LFL, FFU, FFL, BSL, or BSR points past end of data file.
0034
A negative value for a timer accumulator or preset value was detected.
0036
Invalid value for a PID parameter. Code 0036 is discussed further in chapter 26.
Page 415
Chapter 29 Understanding the User Fault Routine 5/02 Processor Only
I/O ERRORS Recoverable only if you disable slot xx in the user fault routine xx50
A rack data error is detected.
xx52
A module required for the user program is detected as missing or removed.
xx53
At going-to-run, a user program declares a slot as unused, and that slot is detected as having an I/O module inserted. Can also mean that the I/O module has reset itself.
xx54
A module required for the user program is detected as being the wrong type.
xx55
A module required for the user program is detected as having the wrong I/O count or wrong I/O driver.
xx57
A specialty I/O module has not responded to a lock shared memory command within the required time limit.
xx59
A specialty I/O module has not responded to a command as being completed within the required time limit.
xx5A
Hardware interrupt problem.
xx5B
G file configuration error – User program G file size exceeds capacity of the module.
xx5C
M0–M1 file configuration error – User program M0–M1 file size exceeds capacity of the module.
xx5D
Interrupt service requested is not supported by the processor.
xx5E
Processor I/O driver (software) error.
xx60 thru xx6F
Identifies an I/O module specific recoverable major error. Refer to the user manual supplied with the module.
29–3
Page 416
Chapter 29 Understanding the User Fault Routine – 5/02 Processor Only
Non-Recoverable User Faults An example of using a non-recoverable user fault in a user fault routine would be to initiate a MSG instruction to inform another node of the fault condition. Non-recoverable user faults: RUNTIME ERRORS 0022
User watchdog scan time exceeded.
0023
Invalid or non-existent STI interrupt file.
0024
Invalid STI interrupt interval (greater than 2559ms or negative).
0025
Excessive stack depth/JSR calls for STI routine.
0026
Excessive stack depth/JSR calls for I/O interrupt routine.
0027
Excessive stack depth/JSR calls for user fault routine.
002A
Indexed address reference beyond specific referenced data file.
INSTRUCTION ERRORS 0030
Attempt was made to jump to one too many nested subroutine files. Can also mean that a program has potentially recursive routines.
0031
Unsupported instruction reference was detected.
0035
TND, SVC, or REF instruction is called within an interrupting or user fault routine.
I/O ERRORS
29–4 xx51
A “stuck” runtime error is detected on an I/O module.
xx58
A specialty I/O module has generated a generic fault. The module fault bit is set to 1 in the status byte of the module.
xx70 thru xx7F
Identifies an I/O module specific non-recoverable major error. Refer to the user manual supplied with the module.
xx90
Interrupt problem on a disabled slot.
xx91
A disabled slot has faulted.
xx92
Invalid or non-existent module interrupt subroutine file.
xx93
Unsupported I/O module specific major error.
xx94
In the run or test mode, a module has been detected as being inserted under power. Can also mean that an I/O module has reset itself.
Page 417
Chapter 29 Understanding the User Fault Routine 5/02 Processor Only
Creating a User Fault Subroutine
To utilize the user fault routine, create a subroutine file (3–255), then enter this file number in word S:29 of the status file. In the status file display below, subroutine file 3 is designated as “Err File,” the user fault routine:
Word S:29
Status File S2:5 Minor Fault 0000 0000 0000 0000 S2:6 Fault Code 0000H Desc: No Error S2:29 Err File: 3 Indx Cross File: No S2:24 Index Reg: 0 Single Step: No S2:5/0 = 0 PRG ADDRESS NEXT FL PREV FL NEXT PG PREV PG F1
Application Example
F2
F3
F4
F5
Suppose you have a program in which you want to control major errors 0020 (MINOR ERROR AT END OF SCAN) and 0034 (NEGATIVE VALUE IN TIMER PRE OR ACC) in the following manner: • Prevent a processor shutdown if the overflow trap bit S:5/0 is set. Permit a processor shutdown when S:5/0 is set more than five times. • Prevent a processor shutdown if the accumulator value of timer T4:0 becomes negative. Reset the negative accumulator value to zero. Energize an output to indicate that the accumulator has gone negative one or more times. • Allow a processor shutdown for all other user faults. A possible method of accomplishing this is indicated in the following figures. Subroutines 3, 4, and 5 are created. The user fault routine is designated as subroutine file 3. When a recoverable or non-recoverable user error occurs, the processor scans file 3. The processor jumps to file 4 if the error code is 0020 and it jumps to file 5 if the error code is 0034. For all other recoverable and non-recoverable errors, the processor exits the user fault routine and halts operation in the fault mode.
29–5
Page 418
Chapter 29 Understanding the User Fault Routine – 5/02 Processor Only
Word S:6 is the fault code (in decimal). EQU
JSR
EQUAL Source A
JUMP TO SUBROUTINE SBR file number 4
Source B
S:6 0 32
Fault code 0020H = 0000 0000 0010 0000 binary = 32 decimal
EQU
JSR
EQUAL Source A
JUMP TO SUBROUTINE SBR file number 5
Source B
S:6 0 52
Fault code 0034H = 0000 0000 0011 0100 binary = 52 decimal END
User Fault Routine – Subroutine File 3 When the processor detects a recoverable or non-recoverable user fault, this file is executed. The fault code appears as Source A in the EQU instructions in this file. The processor will enter the fault mode and shut down for all user faults except two: 0020 MINOR ERROR AT END OF SCAN 0034 NEGATIVE VALUE IN TIMER PRE OR ACC If the fault code (S:6) is 0020H, subroutine file 4 is executed. If the fault code is 0034H, subroutine file 5 is executed.
29–6
Page 419
Chapter 29 Understanding the User Fault Routine 5/02 Processor Only
SBR
C5:0 (U) CU
S:5 ] [
SUBROUTINE
0 CTU COUNT UP Counter Preset Accum
(CU) C5:0 120 0
GRT
RET
GREATER THAN Source A C5:0.ACC 0 Source B 5
RETURN
(DN)
S:5 (U) 0
S:5 ] [ 0
S:1 (U) 13 RET RETURN
END
Subroutine File 4 – Executed for error 0020 MINOR ERROR AT END OF SCAN If the overflow trap bit S:5/0 is set, counter C5:0 will increment. If the count of C5:0 is 5 or less, the overflow trap S:5/0 will be cleared, the major error halted bit S:1/13 will be cleared, and the processor will remain in the Run mode. Fault code 0020 will be indicated in the status file display. If the count is greater than 5, the processor will set S:5/0 and S:1/13 and enter the fault mode. This subroutine file is also executed if the control register error bit S:5/2 is set. In this case, the processor is placed in the fault mode.
Status File Display – At 1st through 5th overflow (S:5/0) occurrences S:1/13 Cleared
S:5/0 Cleared
Status File Arithmetic Flags S:0 Z:0 V:0 C:0 S2:0 Proc Status 0000 0000 0000 0000 S2:1 Proc Status 0000 0000 1000 0001 S2:2 Proc Status 1000 0000 0000 0010 S2:0/0 = 0 PRG ADDRESS NEXT FL PREV FL NEXT PG PREV PG F1
F2
F3
F4
F5
Status File S2:5 Minor Fault 0000 0000 0000 0000 S2:6 Fault Code 0020H Desc: Minor Error At End Of Scan S2:29 Err File: 0 Indx Cross File: No S2:24 Index Reg: 0 Single Step: No S2:5/0 = 0 PRG ADDRESS NEXT FL PREV FL NEXT PG PREV PG F1
F2
F3
F4
F5
Fault code and description are indicated.
29–7
Page 420
Chapter 29 Understanding the User Fault Routine – 5/02 Processor Only
SBR
LES
SUBROUTINE
LESS THAN Source A T4:0.ACC 0 Source B 0
S:1 (U) 13 CLR CLEAR Dest
T4:0.ACC 0
O:3.0 ( ) 3 RET RETURN
END
Subroutine File 5 – Executed for error 0034 NEGATIVE VALUE IN TIMER PRE OR ACC If the accumulator value of timer T4:0 is negative, the major error halted bit, S:1/13 is unlatched, preventing the processor from entering the fault mode. At the same time, the accumulator value T4:0.ACC is cleared to zero and output O:3.0/3 is energized. Fault code 0034 will be indicated in the status file display. If the preset of timer T4:0 is negative, S:1/13 will remain set and the processor will enter the fault mode (O:3.0/3 will be reset if previously set). Also, if either the preset or accumulator value of any other timer in the program is negative, S:1/13 will be set and the processor will enter the fault mode (O:3.0/3 will be reset if previously set).
Status File Display – T4:0.ACC is negative. S:1/13 Cleared
Fault code and description are indicated.
Status File Arithmetic Flags S:0 Z:0 V:0 C:0 S2:0 Proc Status 0000 0000 0000 0000 S2:1 Proc Status 0000 0000 1000 0001 S2:2 Proc Status 1000 0000 0000 0010 S2:0/0 = 0 PRG ADDRESS NEXT FL PREV FL NEXT PG PREV PG F1
29–8
F2
F3
F4
F5
Status File S2:5 Minor Fault 0000 0000 0000 0000 S2:6 Fault Code 0034H Desc: Negative Value in Time PRE or ACC S2:29 Err File: 0 Indx Cross File: No S2:24 Index Reg: 0 Single Step: No S2:5/0 = 0 PRG ADDRESS NEXT FL PREV FL NEXT PG PREV PG F1
F2
F3
F4
F5