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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

plc st - 19.12<br />

IF (I:000/00 = 1) THEN<br />

O:001/00 := 1;<br />

ELSIF (I:000/01 = 1 AND T4:0/DN = 1) THEN<br />

O:001/00 := 1;<br />

IF (I:000/02 = 0) THEN<br />

O:001/01 := 1;<br />

END_IF;<br />

ELSE<br />

O:001/01 := 1;<br />

END_IF;<br />

Figure 19.18<br />

Example With An If Statement<br />

• The example below will set output bits 00-03 depending upon the value of the<br />

integer in N7:0, if the value is not between 0 <strong>and</strong> 3 the outputs will all go off.<br />

CASE N7:0 OF<br />

0:<br />

O:000/00 := 1;<br />

1:<br />

O:000/01 := 1;<br />

2:<br />

O:000/02 := 1;<br />

3:<br />

O:000/03 := 1;<br />

ELSE<br />

O:000 := 0;<br />

END_CASE;<br />

Figure 19.19<br />

Use of a Case Statement<br />

• The example below accepts a BCD input from (I:000) <strong>and</strong> will use it to change

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

Saved successfully!

Ooh no, something went wrong!