The text of a manual · part 57 of 70
SLC 500 Instruction Set Reference Manual, pages 561 to 570
Pages 561 to 570 of 694
The original document is the PDF (7.2 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-L514
Page 561
SLC Status File
B-41
Table B.4 Status File Functions (Continued) Address
Classification
Description
Fixed 5/01
S:20 and S:21
Status
Test - Fault/Powerdown - Rung/File
5/02
5/03
5/04
5/05
•
•
•
•
•
•
•
These registers indicate the executable rung (word S:20) and file (word S:21) number that the processor last executed before a major error or powerdown occurred. To enable this feature, you must select the Test Single Step option at the time you save your program. You can use these registers to pinpoint the execution point of the processor at the last powerdown or fault routine entry. This function is also active in the REM Run mode. See S:2/4. Application example: Suppose your program contains several TON instructions. TON T4:6 in file 2, rung 25 occasionally obtains a negative preset. Recovery from the negative preset fault is possible by placing the preset at 100 and resetting the timer. Place the following rung in your fault routine to accomplish this. Bit B3/0 is latched as evidence that an application recovery has been initiated. This feature is built into the SLC 5/03 and higher processors. Selection is not required. EQU
EQU
EQU
MOV
EQUAL Source
A
S:6
EQUAL Source
A
S:20
EQUAL Source
A
MOVE Source
Source
B
52
Source
B
25
Source
B
The value 52 equals 0034 Hex. This is the error code for a negative timer preset.
Rung Number
S:21 2
File Number
Dest
100 T4:6.PRE
T4:6 (RES) B3 (L) 0 S:1 (U) 13 (RET)
Publication 1747-RM001G-EN-P - November 2008
Page 562
B-42
SLC Status File
Table B.4 Status File Functions (Continued) Address
Classification
Description
Fixed 5/01
S:22
Status
Maximum Observed Scan Time
5/02
5/03
5/04
5/05
•
•
•
•
•
•
•
•
•
•
•
•
•
This word indicates the maximum observed interval between consecutive scans. Consecutive scans are defined as intervals between file 2/rung 0 and the END, TND, or the REF instruction. This value indicates, in 10 ms increments, the time elapsed in the longest program cycle of the processor. The processor compares each last scan value to the value contained in S:22. If the processor determines that the last scan value is larger than the value stored at S:22, the last scan value is written to S:22. Resolution of the maximum observed scan time value is + 0 to -10 ms. For example, the value 9 indicates that 80 to 90 ms was observed as the longest program cycle. Interrogate this value using the Data Monitor function if you need to determine or verify the longest scan time of your program. The Scan Time Selection Bit (S:33/13) determines the timebase used for average and maximum Scan Times. When clear, operation is as described above. When set, the timebase is expressed in 1 ms increments (instead of 10 ms increments). When S:33/13 is set, resolution of the maximum observed scan time value is + 0 to -10 ms. For example, the value 9 indicates that 8 to 9 ms was observed as the largest program cycle. S:23
Status
Average Scan Time
•
This word indicates a weighted running average time. The value indicates, in 10 ms increments, the time elapsed in the average program cycle of the processor. For every Scan t: Avg = (Avg * 7) +Scan t 8 Resolution of the average scan time value is + 0 to -10 ms. For example, the value 2 indicates that 10 to 20 ms was calculated as the average program cycle. The Scan Time Selection bit S:33/13 determines the timebase used for average Scan time. When clear, operation is as described above. When set, the timebase is expressed in 1 ms increments (instead of 10 ms increments). When S:33/13 is set, resolution of the average scan time value is + 0 to -10 ms. For example: the value 2 indicates that 1 to 2 ms was calculated as the average program cycle.
Publication 1747-RM001G-EN-P - November 2008
Page 563
SLC Status File
B-43
Table B.4 Status File Functions (Continued) Address
Classification
Description
S:24
Dynamic Config
Index Register
Fixed 5/01
5/02
5/03
5/04
5/05
•
•
•
•
•
•
•
•
•
•
•
•
•
This word indicates the element offset used in indexed addressing. When an STI, I/O Slot, or Fault Routine interrupts normal execution of your program, the original value of this register is restored when execution resumes. When a DII interrupts normal execution of your program, the original value of this register is restored when execution resumes. S:25 and S:26
Status
•
I/O Interrupt Pending These two words are bit-mapped to the 30 I/O slots. Bits S:25/1 through S:26/14 refer to slots 1 through 30. Bits S:25/0 and S:26/15 are reserved. The pending bit associated with an interrupting slot is set when the corresponding I/O Slot Interrupt Enable bit is clear at the time of an interrupt request. It is cleared when the corresponding I/O Event Interrupt Enable bit is set, or when an associated RPI instruction is executed. The pending bit for an executing I/O interrupt subroutine remains clear when the ISR is interrupted by an STI or fault routine. Likewise, the pending bit remains clear if interrupt service is requested at the time that a higher or equal priority interrupt is executing (fault routine, STI, or other ISR). The pending bit associated with an interrupting slot is set when the corresponding I/O Slot Interrupt Enable bit is clear at the time of an interrupt request. It is cleared when the corresponding I/O Event Interrupt Enable bit is set, or when an associated RPI instruction is executed. The pending bit is always set when interrupt service is requested and the processor is executing an interrupt of equal or higher priority. Interrupt priority does not affect the setting of these bits. For example, while executing an STI subroutine, slot 6 requests an I/O Event Interrupt. The STI executes to completion; however, slot 6 pending bit (S:25/6) becomes set within execution of the STI. Examine the state of these bits within your interrupt subroutines if your application requires this information.
Publication 1747-RM001G-EN-P - November 2008
Page 564
B-44
SLC Status File
Table B.4 Status File Functions (Continued) Address
Classification
Description
S:27 and S:28
Status
I/O Interrupt Enabled
Fixed 5/01
5/02
5/03
5/04
5/05
•
•
•
•
•
•
•
•
•
•
These two words are bit-mapped to the 30 I/O slots. Bits S:27/1 through S:28/14 refer to slots 1 through 30. Bits S:27/0 and S:28/15 are reserved. The default value of each bit is 1 (set). The enable bit associated with an interrupting slot must be set when the interrupt occurs to allow the corresponding ISR to execute. Otherwise, the ISR does not execute and the associated I/O slot interrupt pending bit becomes set. Changes made to these bits using the Data Monitor function or ladder instructions other than IID or IIE take affect at the next end of scan.
S:29
Dynamic Config
These bits may be set/reset by the user program, comms., or with the IIE or IID instruction. Changes made to these bits using a programming terminal’s Data Monitor function or any ladder instruction take effect immediately.
Dynamic Config
User Fault Routine File Number You enter a program file number (3 to 255) to be used in all recoverable and non-recoverable major errors. Program the ladder logic of your fault routine in the file you have specified. Write a zero value to disable the fault routine. To provide protection from inadvertent Data Monitor alteration of your selection, program an unconditional MOV instruction containing the program file number of your fault routine to S:29, or program a CLR instruction at S:29 to prevent fault routine operation.
Publication 1747-RM001G-EN-P - November 2008
•
Page 565
SLC Status File
B-45
Table B.4 Status File Functions (Continued) Address
Classification
Description
S:30
Dynamic Config
Selectable Timed Interrupt - Setpoint
Fixed 5/01
5/02
5/03
5/04
5/05
•
•
•
•
•
•
•
•
•
•
You enter the timebase, in tens of milliseconds, to be used in the selectable timed interrupt. Your STI routine executes per the value you enter. Write a zero value to disable the STI. To provide protection from inadvertent Data Monitor alteration of your selection, program an unconditional MOV instruction containing the setpoint value of your STI to S:30, or program a CLR instruction at S:30 to prevent STI operation. If the STI is initiated while in the REM Run mode by loading the status registers, the interrupt starts timing from the end of the program scan in which the status registers were loaded. If the STI has been previously configured (with a different setpoint), the new setpoint takes effect only after the previously-configured STI has timed out. Selectable timed interrupts are discussed on page 11-8 of this manual. The STI Setpoint timebase can be either 10 ms or 1 ms depending on the value of the STI Setpoint Selection bit S:2/10. When clear, operation is as described above. When set, the timebase is expressed in 1 ms increments. The STE enables and STD disables the STI instruction. S:31
Dynamic Config
•
Selectable Timed Interrupt - File Number You enter a program file number (3 to 255) to be used as the selectable timed interrupt subroutine. Write a zero value to disable the STI. To provide protection from inadvertent Data Monitor alteration of your selection, program an unconditional MOV instruction containing the file number value of your STI to S:31, or program a CLR instruction at S:31 to prevent STI operation. Selectable timed interrupts are discussed on page 11-8 of this manual.
Publication 1747-RM001G-EN-P - November 2008
Page 566
B-46
SLC Status File
Table B.4 Status File Functions (Continued) Address
Classification
Description
S:32
Status
I/O Interrupt Executing
Fixed 5/01
5/02
5/03
5/04
5/05
•
•
•
•
You can interrogate this word inside your DII subroutine if you wish to know if these higher priority interrupts have interrupted an executing ISR. You may also use this value to discern interrupt slot identity when multiplexing two or more specialty I/O module interrupts to the same ISR.
•
•
•
Incoming Command Pending (Channel 0)
•
•
•
•
•
•
•
•
•
This word indicates the slot number of the specialty I/O module that generated the currently executing ISR. This value is cleared upon completion of the ISR, REM Run mode entry, or upon power-up. You can interrogate this word inside of your STI subroutine or fault routine if you wish to know if these higher priority interrupts have interrupted an executing ISR. You may also use this value to discern interrupt slot identity when multiplexing two or more specialty I/O module interrupts to the same ISR. I/O interrupts are discussed on page 11-27 of this manual.
S:33/0
Status
This bit becomes set when the processor determines that another node on the channel 0 network has requested information or supplied a command to it. This bit can be set at any time. This bit is cleared when the processor services the request (or command). Use this bit as a condition of an SVC instruction to enhance the communication capability of your processor. S:33/1
Status
Message Reply Pending (Channel 0) This bit becomes set when another node on the channel 0 network has supplied the information that you requested in the MSG instruction of your processor. This bit is cleared when the processor stores the information and updates your MSG instruction. Use this bit as a condition of an SVC instruction to enhance the communication capability of your processor.
S:33/2
Status
Outgoing Message Command Pending (Channel 0) This bit is set when one or more channel 0 messages in your program are enabled and waiting, but no message is being transmitted at the time. As soon as transmission of a message begins, the bit is cleared. After transmission, the bit is set again if there are further messages waiting, or it remains cleared if there are no further messages waiting.
Publication 1747-RM001G-EN-P - November 2008
Page 567
SLC Status File
B-47
Table B.4 Status File Functions (Continued) Address
Classification
Description
S:33/3
Status
Selection Status (Channel 0)
Fixed 5/01
5/02
5/03
5/04
5/05
•
•
•
•
•
•
•
•
•
•
•
•
When set, this bit indicates that the channel 0 communication port is in the System mode (DF1 mode). When reset, this bit indicates that channel 0 is in the User mode (ASCII mode). Use your programming devices channel configuration utility to change this selection. S:33/4
Status
Communications Active (Channel 0) DH-485 protocol only: This bit is set by the processor when at least one other node is active on channel 0 DH-485 network. Otherwise the bit remains cleared.
S:33/5
Dynamic Config
Communications Servicing Selection (Channel 0) When set, only one channel 0 communication request/ command will be serviced per END, TND, REF, or SVC instruction. When clear, all serviceable incoming or outgoing communication requests/commands will be serviced per END, TND, REF, or SVC instruction. One communication request/command consists of either a channel 0 Incoming Command, channel 0 Message Reply, or channel 0 Outgoing Message Command. Refer to Words S:33/0, S:33/1, S:33/2, and S:33/6 for more information. Note: When clear, your communication throughput will increase. Your scan time will also increase if several communication commands/requests are received in the same scan. To program this feature, use the Data Monitor function to set and clear this bit. To provide protection from inadvertent data monitor alteration of your selection, program an unconditional OTL instruction at address S:33/5 to ensure one request/command operation, or an unconditional OTU instruction at address S:33/5 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.
S:33/6
Dynamic Config
Message Servicing Selection (Channel 0) This bit is only valid when the channel 0 Comms Servicing Selection (S:33/5) is clear (which selects service all commands). When S:33/6 is clear and S:33/5 is clear, all outgoing channel 0 MSG instructions will be serviced per END, TND, SVC, or REF instruction. Otherwise, only one outgoing channel 0 MSG command or reply will be serviced per END, TND, SVC, or REF instruction.
Publication 1747-RM001G-EN-P - November 2008
Page 568
B-48
SLC Status File
Table B.4 Status File Functions (Continued) Address
Classification
Description
S:33/7
Dynamic Config
Message Servicing Selection (Channel 1)
Fixed 5/01
5/02
5/03
5/04
5/05
•
•
•
•
•
•
•
•
•
This bit is only valid when the channel 1 Comms Servicing Selection bit (S:2/15) is clear (which selects service all commands). When S:33/7 is clear and S:2/15 is clear, all outgoing channel 1 MSG instructions are serviced per END, TND, SVC, or REF instruction. Otherwise, only one outgoing channel 1 MSG command or reply is serviced per END, TND, SVC, or REF instruction. S:33/8
Static Config
Interrupt Latency Control Bit When set, interrupt latency occurs for user interrupts (DII, STI, and I/O Event). This means that when an interrupt occurs, you are guaranteed to be at rung 0 of your interrupt subroutine within the stated interrupt latency period (assuming no interrupt of equal or higher priority is executing). You must select this at the time you save your program. When clear, user interrupts may only interrupt the processor at predefined points of execution in the user program cycle. Interrupt latency is then defined as the longest period of time that can occur between any two predefined points. When S:33/8 is clear, you must analyze each user program. The bit is clear by default. The following points are the only points in which user interrupt subroutines are allowed to execute when S:33/8 is clear: • at the start of each rung • following the servicing of communication • between slots when updating the input or output image, or any specialty I/O card
S:33/9
Status
Scan Toggle Bit This bit is cleared upon entry into the RUN mode. This bit changes state each and every execution of an END, TND, or REF instruction. Use this bit in your user program for applications such as multiplexing subroutine execution.
Publication 1747-RM001G-EN-P - November 2008
Page 569
SLC Status File
B-49
Table B.4 Status File Functions (Continued) Address
Classification
Description
Fixed 5/01
S:33/10
Dynamic Config
Discrete Input Interrupt Reconfiguration Bit
5/02
5/03
5/04
5/05
•
•
•
•
•
•
Set this bit with your user program or programming terminal to cause the DII function to reconfigure itself at the next interrupt occurrence or end of each scan (END, TND, or REF). This bit is applied upon a DII ISR, fault routine, STI ISR, or Event ISR exit. The following occurs when the DII is reconfigured: 1. The DII Accumulator is cleared (S:52). 2. DII parameters located in words S:46 through S:50 are applied. 3. The DII reconfigure bit is cleared by the processor. For example, use the following ladder structure to cause a DII reconfiguration from your main ladder file each time input 0 is cycled on.
I:1/0 ] [
B3/0 [OSR]
S:33/10 (L)
Use the following ladder structure to cause a DII reconfiguration from an event based subroutine. The subroutine is only executed once, each time the DII reconfiguration is possible. S:33/10 (L)
I:1/0 ] [
S:33/11 and S:33/12
Status
Online Edit Status These two bits represent the four possible Online Edit states: Bit 12 Bit 11 Online Edit Status 0
0
No online edits exist
0
1
Online edits are disabled
1
1
Testing online edits
1
0 not used
Examine the state of these bits with your user program to count the number of online edit sessions, flag an alarm, or place your application in a special state designed for online edit sessions.
Publication 1747-RM001G-EN-P - November 2008
Page 570
B-50
SLC Status File
Table B.4 Status File Functions (Continued) Address
Classification
Description
S:33/13
Static Config
Scan Time Timebase Selection
Fixed 5/01
5/02
5/03
5/04
5/05
•
•
•
•
•
•
•
•
•
This bit determines the timebase used to average the Scan time (S:23) and the maximum Scan Time (S:22). When clear, the value contained in the average and maximum scan times represent the number of 10 ms increments that have occurred. When set, the value contained in the average and maximum scan times represent the number of 1 ms increments that have occurred. This value is clear by default (10 ms timebase). S:33/14
Dynamic Config
DTR Control Bit (Channel 0) This bit is used to enable DTR dialing. When clear, the channel 0 DTR signal (pin 4) is directly controlled by the standard communication driver. When set, you can perform DTR dialing by writing to S:33/15, DTR Force Bit. Bit S:33/14 is examined and applied at each end of scan (END, TND, or REF). When in Program, Suspend, or Fault mode, DTR is enabled and remains enabled until an auto-disconnect sequence is detected by the communication driver. An auto-disconnect occurs if the communication driver detects that channel 0 CD signal (pin 1) has been absent for more than 10 seconds or if the channel 0 DSR signal (pin 6) has been disabled. Refer to S:5/14 Channel 0 Modem Lost bit for more information. During an auto-disconnect, the standard communication driver keeps the DTR disabled until either the channel 0 DSR signal is enabled, or 5 seconds elapse. Note: When channel 0 is configured for DH-485, S:33/14 must be clear for proper operation.
S:33/15
Dynamic Config
DTR Force Bit (Channel 0) This bit is used to force the DTR pin high or low. When S:33/14 is set, the channel 0 DTR signal (pin 4) is applied at each end of scan (END, TND, or REF) using the state of S:33/15. When S:33/14 is clear, this bit has no effect on DTR. When S:33/15 is set, DTR is forced high. When clear (default), DTR is forced low. When in the REM Test or REM Run mode, this bit is only applied at end of scan (END, TND, or REF). When in Program, Suspend, or Fault mode (or on power up), DTR is set unless the communication driver is performing an auto-disconnect.
Publication 1747-RM001G-EN-P - November 2008