12.05.2014 Views

Automating Manufacturing Systems - Process Control and ...

Automating Manufacturing Systems - Process Control and ...

Automating Manufacturing Systems - Process Control and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

plc advanced functions - 16.16<br />

program file 2<br />

S2:1/15 - first scan<br />

MOV<br />

Source 3<br />

Dest S2:31<br />

MOV<br />

Source 500<br />

Dest S2:30<br />

program file 3<br />

ADD<br />

SourceA I:000<br />

SourceB N7:10<br />

Dest N7:10<br />

Figure 16.16<br />

A Timed Interrupt Program<br />

Interrupts can also be used to monitor a change in an input. This is useful when<br />

waiting for a change that needs a fast response. The relevant values that can be changed<br />

are listed below.<br />

S:46 - the program file to run when the input bit changes<br />

S:47 - the rack <strong>and</strong> group number (e.g. if in the main rack it is 000)<br />

S:48 - mask for the input address (e.g. 0000000000000100 watches 02)<br />

S:49 - for positive edge triggered =1 for negative edge triggered = 0<br />

S:50 - the number of counts before the interrupt occurs 1 = always up to 32767<br />

Figure 16.17 shows an interrupt driven interrupt. Program 2 sets up the interrupt to<br />

run program file 3 when input I:002/02 has 10 positive edges. (Note: the value of 0004 in<br />

binary is 0000 0000 0000 0100b, or input 02.) When the input goes positive 10 times the<br />

bit B3/100 will be set.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!