The text of a manual · part 44 of 55
Hand-Held Terminal (Catalog Number 1747-PT1) User Manual: 27 - The Status File, pages 378 to 386
Pages 378 to 386 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 378
Chapter 27 The Status File
Address S:2/14
Description Math Overflow Selection Bit Applies to Series C and later SLC 5/02 processors only. Set this bit when you intend to use 32-bit addition and subtraction. When S:2/14 is set, and the result of an ADD, SUB, MUL, or DIV instruction cannot be represented in the destination address (underflow or overflow), • the overflow bit S:0/1 is set, • the overflow trap bit S:5/0 is set, and • the destination address contains the unsigned truncated least significant 16 bits of the result. The default condition of S:2/14 is reset (0). This provides the same operation as that of the Series B SLC 5/02 processor. When S:2/14 is reset, and the result of an ADD, SUB, MUL, or DIV instruction cannot be represented in the destination address (underflow or overflow), • the overflow bit S:0/1 is set, • the overflow trap bit S:5/0 is set, and • the destination address contains 32767 if the result is positive or – 32768 if the result is negative. Note that the status of bit S:2/14 has no effect on the DDV instruction. Also, it has no effect on the math register content when using MUL and DIV instructions. To program this feature, use the EDT_DAT function to set/clear this bit. To provide protection from inadvertent data monitor alteration of your selection, program an unconditional OTL instruction at address S:2/14 to ensure the new math overflow operation, or program an unconditional OTU instruction at address S:2/14 to ensure the original math overflow operation. See chapter 20 for an application example of 32-bit signed math.
27–10
5/02
•
5/01, Fixed
Page 379
Chapter 27 The Status File
Address
Description
5/02
S:2/15
DH–485 Communications Servicing Selection Bit Read/write. When set, only one communication request/command will be serviced per END, TND, REF, or SVC. When clear, all serviceable incoming or outgoing communication requests /commands will be serviced per END, TND, REF, or SVC. When clear, your communications throughput will increase. However, your scan time will increase if several communication commands/requests are received in the same scan.
•
5/01, Fixed
One communication request/command consists of either a DH–485 incoming command, DH–485 message reply, or DH–485 outgoing message command. See S:2/5, S:2/6, S:2/7. To program this feature, use the EDT_DAT function to set/clear this bit. To provide protection from inadvertent data monitor alteration of your selection, program an unconditional OTL instruction at address S:2/15 to ensure one request/command operation, or program an unconditional OTU instruction at address S:2/15 to ensure multiple request/command operation. Alternately, your program may change the state of this bit using ladder logic if your application requires dynamic selection of this function. Application example: Suppose you have a system consisting of a SLC 5/02 processor, an APS programmer, and a DTAM. The program scan time for your user program is extremely long. Because of this, the programming device or DTAM takes an unusually long time to update its screen. You can improve this update time by clearing S:2/15. In a case such as this, the additional time spent by the processor to service all communications at the end of the scan is insignificant compared to the time it takes to complete one scan. You could increase communication throughput even further by using an SVC instruction. See chapter 18.
27–11
Page 380
Chapter 27 The Status File
Address
Description
5/02
5/01, Fixed
S:3L
Current/Last 10 ms Scan Time Byte Read/write. The value of this byte tells you how much time elapses in a program cycle. A program cycle includes the ladder program scan, I/O scan, and servicing the communication port. The byte value is zeroed by the processor each scan, immediately preceding the execution of rung 0 of program file 2 (main program file) or on return from the REF instruction. The byte is incremented every 10 milliseconds thereafter, and indicates, in 10 ms increments, the amount of time elapsed in each program cycle. If this value ever equals the value in S:3H Watchdog, a user watchdog major error will be declared (code 0022).
•
•
Resolution of the scan time value: The resolution of this value is +0 to – 10 milliseconds. Example: The value 9 indicates that 80–90 ms has elapsed since the start of the program cycle. Application example: Your application requires that each and every program scan execute in the same length of time. You measure the maximum and minimum scan times and find them to be 40 ms and 20 ms. You can make every scan equal to precisely 50 ms by programming the following rungs as the last rungs of your program. 1 ]LBL[
MOV MOVE Source
S:3
Dest
N7:0
AND BITWISE AND Source A
255
Source B
N7:0
Dest
N7:0
LES
1 (JMP)
LESS THAN Source A
N7:0
Source B
5
This example assumes that your I/O scan and communications servicing takes less than 10 ms. If it were to exceed 10 ms, the resolution of +0 to –1 tick (10 ms) would have to be added to the scan time.
27–12
Page 381
Chapter 27 The Status File
Address
Description
5/02
5/01, Fixed
S:3H
Watchdog Scan Time Byte Read/write. This byte value contains the number of 10 ms ticks allowed to occur during a program cycle. The default value is 10 (100 ms) but you can increase this to 250 (2.5 seconds) or decrease it to 2, as your application requires. If the program scan S:3L value equals the watchdog value, a watchdog major error will be declared (code 0022).
•
•
S:4
Free Running Clock Discussion applies to SLC 5/01 and fixed processors only.
•
Read only. Only the first 8 bits (byte value) of this word are assessed by the processor. This value is zeroed at powerup in the Run mode. With the Series B SLC 5/01 processor, this value is also zeroed at each entry into the run or test mode. It is incremented every 10 ms thereafter. You can use any individual bit of this byte in your user program as a 50% duty cycle clock bit. Clock rates for S:4/0 to S:4/7 are: 20, 40, 80, 160, 320, 640, 1280, and 2560 milliseconds. The application using the bit must be evaluated at a rate more than two times faster than the clock rate of the bit. This is illustrated in the example below for SLC 5/02 processors.
•
Free Running Clock Discussion applies to SLC 5/02 processors only. Read/write. All 16 bits of this word are assessed by the processor. The value of this word is zeroed upon power up in the Run mode or entry into the run or test mode. It is incremented every 10 ms thereafter. Application note: You can write any value to S:4. It will begin incrementing from this value. You can use any individual bit of this word in your user program as a 50% duty cycle clock bit. Clock rates for S:4/0 to S:4/15 are: 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, 10240, 20480, 40960, 81920, 163840, 327680, and 655360 milliseconds. The application using the bit must be evaluated at a rate more than two times faster than the clock rate of the bit. In the example below, bit S:4/3 toggles every 80 ms, producing a 160 ms clock rate. To maintain accuracy of this bit in your application, the instruction using bit S:4/3 (O:1/0 in this case) must be evaluated at least once every 79.999 ms. 160 ms
S:4 ] [ 3
S:4/3 cycles in 160 ms
O:1 ( ) 0
Both S:4/3 and Output O:1/0 toggle every 80 ms. O:1/0 must be evaluated at least once every 79.999 ms.
27–13
Page 382
Chapter 27 The Status File
Address
Description
5/02
5/01, Fixed
S:5
Minor Error Bits The bits of this word are set by the processor to indicate that a minor error has occurred in your ladder program. Minor errors, bits 0–7, revert to major error 0020H if any bit is detected as being set at the end of the scan. If the processor faults for error code 0020H, you must clear minor error bits S:5/0–7 along with S:1/13 to attempt error recovery.
•
•
S:5/0
Overflow Trap Bit Read/write. When this bit is set by the processor, it indicates that a mathematical overflow has occurred in the ladder program (see S:0/1).
•
•
If this bit is ever set upon execution of the END, TND, or REF instruction, a major error (0020) will be declared. To avoid this type of major error from occurring, examine the state of this bit following a math instruction (ADD, SUB, MUL, DIV, DDV, NEG, SCL, TOD, or FRD), take appropriate action, and then clear bit S:5/0 using an OTU instruction with S:5/0 or a CLR instruction with S:5.0. S:5/1
Reserved
•
•
S:5/2
Control Register Error Bit Read/write. The LFU, LFL, FFU, FFL, BSL, BSR, SQO, SQC, and SQL instructions are capable of generating this error. When bit S:5/2 is set, it indicates that the error bit ER of the control instruction has been set.
•
•
If this bit is ever set upon execution of the END, TND, or REF instruction, a major error (0020) will be declared. To avoid this type of major error from occurring, examine the state of this bit following a control register instruction, take appropriate action, and then clear bit S:5/2 using an OTU instruction with S:5/2 or a CLR instruction with S:5.0.
27–14
Page 383
Chapter 27 The Status File
Address
Description
5/02
S:5/3
Major Error Detected while Executing User Fault Routine Bit Read/write. When set, the major error code (S:6) will then represent the major error that occurred while processing the fault routine due to another major error.
•
5/01, Fixed
If this bit is ever set upon execution of the END, TND, or REF instruction, a major error (0020) will be declared. To avoid this type of major error from occurring, examine the state of this bit inside your fault routine, take appropriate action, and then clear bit S:5/3 using an OTU instruction with S:5/3 or a CLR instruction with S:5.0. Application example: Suppose you are executing your fault routine for fault code 0016H Startup Protection. At rung 3 inside this fault routine, a TON containing a negative preset is executed. When rung 4 is executed, fault code 0016H will be overwritten to indicate code 0034H, and S:5/3 will be set. If your fault routine did not determine that S:5/3 was set, major error 0020H would be declared at the end of the first scan. To avoid this problem, examine S:5/3, followed by S:6, prior to returning from your fault routine. If S:5/3 is set, take appropriate action to remedy the fault, then clear S:5/3. S:5/4
M0–M1 Referenced on Disabled Slot Bit Read/write. This bit is set whenever any instruction references an M0 or M1 module file element for a slot that is disabled (via its I/O slot enable bit). When set, the bit indicates that an instruction could not execute properly due to the unavailability of the addressed M0 or M1 data.
•
If this bit is ever set upon execution of the END, TND, or REF instruction, a major error (0020) will be declared. To avoid this type of major error from occurring, examine the state of this bit following a M0–M1 referenced instruction, take appropriate action, and then clear bit S:5/4 using an OTU instruction with S:5/4 or a CLR instruction with S:5.0. S:5/5, S:5/6, S:5/7
Reserved Read/write. Reserved for minor errors that revert to major errors at the end of the scan.
•
•
27–15
Page 384
Chapter 27 The Status File
Address
Description
5/02
5/01, Fixed
S:5/8
Memory Module Boot Bit Read/write. When this bit is set by the processor, it indicates that a memory module program has been transferred to the processor. This bit is not cleared by the processor.
•
•
•
•
Your program can examine the state of this bit every Run mode entry to determine if the memory module content has been transferred. S:1/15 will be set to indicate Run mode entry. This information is useful when you have an application that contains retentive data and a memory module that has only bit S:1/10 set (load memory module on NVRAM error). You can use this bit to indicate that retentive data has been lost. This bit is also helpful when using bits S:1/11 (load memory module always) or S:1/12 (load memory module always and run) to distinguish a powerup Run mode entry from a program (or test) mode to Run mode entry. S:5/9
Memory Module Password Mismatch Bit Read/write. This bit is set at Run mode entry, whenever loading from the memory module is specified (word 1, bits 11 or 12) and the processor user program is password protected, and the memory module program does not match that password. You can use this bit to inform your application program that an autoloading memory module is installed but did not load due to a password mismatch.
27–16
S:5/10
STI (Selectable Timed Interrupt) Overflow Bit Read/ write. This bit is set whenever the STI timer expires while the STI routine is either executing or disabled and the pending bit is already set.
•
S:5/11
Battery Low Bit Read only. This bit is set whenever the Battery Low LED is on; the bit is cleared when the Battery Low LED is off. It is updated only in the run or test modes.
•
S:5/12 thru S:5/15
Reserved
•
•
Page 385
Chapter 27 The Status File
Address
Description
5/02
5/01, Fixed
S:6
Major Error Fault Code Read/write. A hex code will be entered in this word by the processor when a major error is declared (refer to S:1/13). The code defines the type of fault, as indicated on the following pages. This word is not cleared by the processor.
•
•
Error codes are presented, stored, and displayed in hexadecimal. (appendix B explains hex numbering system.) If you enter a fault code as a parameter in an instruction in your ladder program, you must convert the code to decimal. For example, if you program an EQU instruction to go true when the error 0016 occurs, enter S:6 as source A and 22, the decimal equivalent of 0016H, as source B:
•
EQU EQUAL Source A
S:6
Source B
22
Application note: You can declare your own application–specific major fault by writing your own unique value to S:6 and then setting bit S:1/13. SLC 5/02 processor users: Interrogate the value of S:6 in your fault routine to determine the type of fault that occurred. If your program was saved with the test single step enabled, you can also interrogate S:20 and S:21 to pinpoint the exact rung that was being executed when the fault occurred. Fault Classifications: Faults are classified as Non-User, Non-Recoverable, and Recoverable, defined below. Non-User Fault The fault routine does not execute.
Non-Recoverable User Fault The fault routine executes for 1 pass. (You may initiate a MSG instruction to another node to identify the fault condition of the processor.)
Recoverable User Fault The fault routine may clear the fault by clearing bit S:1/13.
Error code descriptions and classifications are listed on pages 27–18 through 27–22. Categories:
•
•
• powerup errors • going to run errors • runtime errors • user program instruction errors • I/O errors See chapter 28 for cause/recovery information on faults.
27–17
Page 386
Chapter 27 The Status File
Fault Classification Description Address
Error Code (Hex)
S:6
0001
NVRAM error.
0002
Processor
User 5/02
5/01, Fixed
X
•
•
Unexpected hardware watchdog timeout.
X
•
•
0003
Memory module memory error.
X
•
0004
Memory integrity check failed (runtime).
X
•
Powerup Errors
Non-User
Non-Recov
Recov
Fault Classification Description Address
Error Code (Hex)
S:6
0010
Processor does not meet proper revision level.
0011
27–18
Processor
User 5/02
5/01, Fixed
X
•
•
The executable file number 2 is absent.
X
•
•
0012
The ladder program has a memory error.
X
•
•
0013
The required memory module is absent or either S:1/10 or S:1/11 is not set (and the program requires it).
•
•
0014
Internal file error.
X
•
•
0015
Configuration file error.
X
•
•
0016
Startup protection after power loss. Error condition exists at powerup when bit S:1/9 is set and powerdown occurred while running.
Going to Run Errors
Non-User
Non-Recov
Recov
X
X
•