170 likes | 308 Vues
ECT 464. Lecture 18 Interrupts. Today’s Quote: When God measures a man, He puts the tape around the heart instead of the head.
E N D
ECT 464 Lecture 18 Interrupts
Today’s Quote: When God measures a man, He puts the tape around the heart instead of the head. But the LORD said to Samuel, "Do not consider his appearance or his height, for I have rejected him. The LORD does not look at the things man looks at. Man looks at the outward appearance, but the LORD looks at the heart." 1 Samuel 16:7
Interrupts • An interrupt is an event that causes the controller to suspend the task it is currently performing, perform a different task, and then return to the suspended task at the point where it suspended.
Interrupt Types • User Fault Routine • Event Interrupts • High Speed Counter Interrupts • Selectable Timed Interrupt
User Fault Routine • The user fault routine gives you the option of preventing a controller shutdown when a specific user fault occurs. The fault routine is executed when any recoverable or non-recoverable user fault occurs. The fault routine is not executed for non-user faults. • Faults are classified as recoverable, non-recoverable, and non-user faults.
User Fault Routines • Create a subroutine file. (3-25) • Enter the file number in word S:29 • The occurrence of recoverable or non-recoverable faults causes the controller to read S:29 and execute the subroutine number identified by S:29. If the fault is recoverable, the routine can be used to correct the problem and clear the fault bit S:1/13. The controller then continues in its current executing mode. The routine does not execute for non-user faults.
User Interrupt Instructions • The INT instruction is used as a label to identify a user interrupt service routine (ISR). This instruction is placed as the first instruction on a rung and is always evaluated as true. Use of the INT instruction is optional.
Selectable Timed Start • The STS instruction can be used to start and stop the STI function or to change the time interval between STI user interrupts. The STI instruction has one value which is is the amount of time (in milliseconds) which must expire prior to executing the selectable timed user interrupt. A value of zero disables the STI function. The time range is from 0 to 65,535 milliseconds.
User Interrupt Instructions • User Interrupt Enable (UIE) • User Interrupt Disable (UID) • User Interrupt Flush (UIF)
Selectable Timed Interrupt • The Selectable Timed Interrupt (STI) provides a mechanism to solve time critical control requirements. The STI is a trigger mechanism that allows you to scan or solve control program logic that is time sensitive.
Selectable Timed InterruptExamples • PID type applications, where a calculation must be performed at a specific time interval. • A motion application, where the motion instruction (PTO) needs to be scanned at a specific rate to guarantee a consistent acceleration/ deceleration profile. • A block of logic that needs to be scanned more often.
Event Input Interrupt • The EII (event input interrupt) is a feature that allows the user to scan a specific program file (subroutine) when an input condition is detected. • Each EII can be configured to monitor any one of the first eight inputs (I1:0.0/0 to I1:0.0/7). • Each EII can be configured to detect rising edge or falling edge input signals. • When the configured input signal is detected at the input terminal, the controller immediately scans the configured subroutine.