Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Page 1 of 3
show the entry list Process interrupts (I/O interrupts) with the S7-21x Display part number QUESTION: How do I program a process interrupt (I/O interrupt) for the S7-21x? ANSWER: The following CPUs can process one or more process interrupts (I/O interrupts): I/O interrupt Inputs No. of possible interrupt programs CPU210 CPU212 None None I 0.0 INT 0 127 CPU214 I 0.0 to I 0.3 INT 0 127 CPU215 I 0.0 to I 0.3 INT 0 127 CPU216 I 0.0 to I 0.3 INT 0 - 127
The I/O interrupts include interrupts with rising or falling edge, interrupts of the high-speed counter and pulse string interrupts. The CPU can generate an interrupt in the case of a rising edge and/or falling edge at an input. The events Rising Edge and Falling Edge can be determined for each of these inputs. The operating system assigns each event a fixed event number. Event Rising flank at Falling flank at Rising flank at Falling flank at Rising flank at Falling flank at Rising flank at Falling flank at Input I 0.0 I 0.0 I 0.1 I 0.1 I 0.2 I 0.2 I 0.3 I 0.3 Event number 0 1 2 3 4 5 6 7 Priority 0 4 1 5 2 6 3 7
In the following example the interrupt program "4" is assigned to the rising flank event at input I 0.0 so that you can write your program for the interrupt case in the interrupt program "INT 4". What does the command do? Command Operand Example of operand
Network 1 Unique assignment of event to the number of the LD interrupt program by querying the flag that is ONLY in the first cycle "1" Assign interrupt program number "4 (INT 4)" to the rising flank event with "event no. 0" at input I 0.0 ATCH SM 0.1 SM 0.1
INT,EVENT
4,0
http://support.automation.siemens.com/WW/llisapi.dll/299018?func=ll&objId=299018&...
10.09.2010
Siemens - Industry Automation and Drive Technologies - Service& Support - Automation... Page 2 of 3
End of main program Network X Open interrupt program with the number "4" Now write the program here that you want to have run in the case of an interrupt ( rising flank at I 0.0 ) Terminate interrupt program for rising flank at I 0.0 Notes :
l
MEND
INT .......
No. ....
4 ....
RETI
Interrupts are processed by the CPU in the order of their occurrence and according to their priority status. There can only ever be one program active for interrupt processing. If an interrupt program is being processed and a new process interrupt is queued, then the currently active program is terminated first. It cannot be interrupted by a subsequently occurring interrupt program, not even if this has a higher priority. If an interrupt occurs while another interrupt is being processed, then the later interrupt is put into a queue for processing later. The following table shows the three queues for interrupts and the maximum number of interrupts that can be put into each queue. CPU210 None None None CPU212 4 4 2 CPU214 16 4 4 CPU215 16 4 8 CPU216 16 8 8
It might happen that more interrupts occur than can be entered in the queue. In this case the system has queue overflow flags that specify the type of interrupt events that could not be included in the queue. The table shows the special flags that are set when there is queue overflow. You may only use these bits, SM 4.0 to 4.2, in an interrupt program, because they will be reset when the queue has been processed and main program processing continues. Special flag SM 4.0 SM 4.1 SM 4.2
Queue Queue overflow for communications interrupts Queue overflow for I/O interrupts Queue overflow for time-controlled interrupts
Supplementary information is available in the System Manual of the S7-21x in Entry ID 1109154. Keywords: Functionality Entry ID:299018 Date:2001-10-01
http://support.automation.siemens.com/WW/llisapi.dll/299018?func=ll&objId=299018&...
10.09.2010
Siemens - Industry Automation and Drive Technologies - Service& Support - Automation... Page 3 of 3
as helpful
http://support.automation.siemens.com/WW/llisapi.dll/299018?func=ll&objId=299018&...
10.09.2010