Class Note for ECE 493 at UA-Spec Topics Optics(3)
Class Note for ECE 493 at UA-Spec Topics Optics(3)
Popular in Course
Popular in Department
This 9 page Class Notes was uploaded by an elite notetaker on Friday February 6, 2015. The Class Notes belongs to a course at University of Alabama - Tuscaloosa taught by a professor in Fall. Since its upload, it has received 36 views.
Reviews for Class Note for ECE 493 at UA-Spec Topics Optics(3)
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 02/06/15
Programmable Logic Controllers Interrupts Electrical amp ComputerEngineering Dr D J Jackson Lecture 131 Interrupt Basics o In terms of a PLC o What is an interrupt When can the controller operation be interrupted Priority of User Interrupts Interrupt Latency Interrupt Instructions Electrical amp ComputerEngineering Dr D J Jackson Lecture 132 What is an Interrupt 0 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 o The Micrologix 1200 and MicroLogix 1500 support the following User Interrupts User Fault Routine Event Interrupts 4 HighSpeed Counter Interrupts1 Selectable Timed Interrupt Electrical amp comma Engineering in n i racism Lemmaa Interrupt Operation 0 An interrupt must be configured and enabled to execute When any one of the interrupts is configured and enabled and subsequently occurs the user program 1 suspends its execution 2 performs a defined task based upon which interrupt occurred 3 returns to the suspended operation Program FrleZ Interrupt Dperallnll Example run 0 9 Program File i0 Program FrleZ is lire main mmrar rrrrrgram Program File r l is the rmerrrrpr muller rung 123 Arr interrupt Everrlnccurs arrrrrrg rza Program File rrr is executed Pragram File 2 exeurrrrarr restrnrea rrrrrrregrarerrarrer rrrrrg r23 rung 27 Electrical amp comma Engineering in n i racism LennreHl Interrupt Operation continued 0 Specifically if the controller program is executing normally and an interrupt event occurs 1 the controller stops its normal execution determines which interrupt occurred 3 goes immediately to rung 0 of the subroutine specified for that User Interrupt 4 begins executing the User Interrupt subroutine or set of subroutines if the specified subroutine calls a subsequent subroutine 5 completes the subroutines 6 resumes normal execution from the point where the controller program was interrupted N Electrical amp ComputerEngineering Dr D J Jackson Lecture 135 When Can the Controller Operation be Interrupted o The Micrologix 1200 and 1500 controllers only allow interrupts to be serviced during certain periods of a program scan They are At the start of a ladder rung Anytime during End of Scan Between data words in an expansion IO scan 0 The interrupt is only serviced by the controller at these opportunities 0 If the interrupt is disabled the pending bit is set at the next occurrence of one of the three occasions listed above Electrical amp ComputerEngineering Dr D J Jackson Lecture 136 Priority of User Interrupts 0 When multiple interrupts occur the interrupts are serviced based upon their individual priority 0 When an interrupt occurs and another interrupts has already occurred but has not been serviced the new interrupt is scheduled for execution based on its priority relative to the other pending interrupts At the next point in time when an interrupt can be serviced all the interrupts are executed in the sequence of highest priority to lowest priority Electrical amp ComputerEngineering Dr D J Jackson Lecture 137 Priority of User Interrupts o If an interrupt occurs while a lower priority interrupt is being serviced executed the currently executing interrupt routine is suspended and the higher priority interrupt is serviced Then the lower priority interrupt is allowed to complete before returning to normal processing 0 If an interrupt occurs while a higher priority interrupt is being serviced executed and the pending bit has been set for the lower priority interrupt the currently executing interrupt routine continues to completion Then the lower priority interrupt runs before returning to normal processing Electrical amp ComputerEngineering Dr D J Jackson Lecture 138 Interrupt Priorities The priorities From highest to iowest m User Fauit Routiiie highest priority W Eyeiit inteirtipti High39SpEEd Cuunter iiiterrupt U EVEN interrupt Z Event interrupt 3 HighrSpeed Cutinter iitteiiupti iiiinutagix i501 tinVi Seiectahie Timed interrupt lowest priority Elemncal a Cnmrmler Engineering m o J mmquot Lemur 1379 Interru pt Latency o Interrupt Latency is defined as the worst case amount of time elapsed from when an interrupt occurs to when the interrupt subroutine starts to execute Program Scan Activity When all Interrupt Can Occur iiiiJut Scan Betweeii Wurti Updates Ladtiei Scan Start of Huiig Output Scan Betweeit wnid updates Ceiiiiiiumcatinns Seiwce Aiiytime Housekeeping Anytime Elemncal a Cnmrmler Engineering m o J mmquot Lemur 134a Determining Interrupt Latency 1 First determine the execution time for the longest executing rung in your control program maximum rung time See MicroLogix 1200 Memory Usage and Instruction Execution Time handout for more information 2 Multiply the maximum rung time by the Communications Multiplier corresponding to your configuration in the MicroLogix 1200 Scan Time Worksheet handout Evaluate your results as lbllows Controller If the time calculated instep 2 is Tllen the Interrupt Latency is lVllcrnLuglx l 200 less than T33 us All us greater than T33 us the value calculated in step Z pltlsZ7Bus MicroLogix l 500 less than lDU us 360 us gleaterthan lOU us the value calculated in step Z plus 250 us Electrical aconnnner Engineering DI D J Jackson Lectute1311 INT Interrupt Subroutine lNI lU llilEiitilJl 39 lnstl uction Type input er lCiU uglx lCiD uglx I ll e lls us us its o The INT instruction is used as a label to identify a user interrupt service routine ISR o This instruction is placed as the first instruction on a rung and is always evaluated as true 0 Use of the INT instruction is optional Electrical aconnnner Engineering DI D J Jackson Lectute131Z UID User Interrupt Disable lnsll llcilon Type Output UH Us H EWF D sah e 7 Controller When llung ls uwmpmpes 5 True False MmruLugtx 1200 08us 0 0 us HHcangtx1500 0 0 us 0 0 us o The UID instruction is used to disable selected user interrupts Electricalecumnmergngmeenng DrDllzcksnn Lecture 13713 Types of Interrupts Disabled by the UID Instruction Interrupt Element Decimal Corresponding Value Bit EH Etth Hiput Htteuupts EvthU E4 bltG EH 7 Event Hmut lmenupts Event 1 32 bitS HSC HighSpeed Cuunter HSCD IE turd EH 7 Event lnput lnteuupxs EtentZ 8 bxt EH 7 Event Hmut Hneu Upts B8013 1 but 2 H80 A HtgHSpeed Cothe H H5 2 hi STI Selectable Timed lute mpts STI I bit I Nutev 508710 15 must be settu zero m The Mmmtogtx IZUUhasmveHSCHvlerrupt HSCD lHechmLamx WEUDhas lwu HSCU auttHSU Electricalecumnmergngmeenng DrDllzcksnn Lecture 13715 Types of Interrupts Disabled by the UID Instruction 0 To disable interrupts 1 Select which interrupts you want to disable 2 Find the Decimal Value for the interrupts you selected 3 Add the Decimal Values if you selected more than one type of interrupt 4 Enter the sum into the UID instruction 0 For example to disable EII Event 1 and E11 Event 3 EII Event 1 32 E11 Event 3 4 32 4 36 enter this value Eletlnczl a Cnmrluler Engmeennu DrDllzcksnn Lecture 1315 UIE User Interrupt Enable mg i Use HlBHumEuable i hwlevmplTvpes 4 Insnumun Type Output Commllei When ung Is True False MmroLogwxiZUU Dans 00115 MmroLogwx 1500 U 0 p U 0 us o The UIE instruction is used to enable selected user interrupts o The parameter for the UIE instruction is computed exactly as the UID instruction Eletlnczl a Cnmrluler Engmeennu DrDllzcksnn Lecture 1316 UIF User Interrupt Flush Instruction Type mnpur MP 7 UseiiiiteiiupiFiiisii Controller When Rungls iiiiEiiuplTypES T F I me a se M icmLugi x iZUU 12 3 p5 DUps MiciuLugix i500 WEAVLSP i0 U us I us MiciuLugix i500 WEAVLRF i0 5 us UUus The UIF instruction is used to flush remove pending interrupts from the system selected user interrupts The parameter for the UIF instruction is computed exactly as the UIE and UID instructions Electrical it coriipimer Engineering Dr D J Jackson Lecture 1317
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'