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 st - 19.11<br />

F8:10 := 0;<br />

FOR (N7:0 := 0 TO 4) DO<br />

F8:10 := F8:10 + F8:[N7:0];<br />

END_FOR;<br />

Figure 19.16<br />

A Program To Average Five Values In Memory With A For-Loop<br />

• Consider the program below to find the average of five values in floating point<br />

memory.<br />

F8:10 := 0;<br />

WHILE (N7:0 < 5) DO<br />

F8:10 := F8:10 + F8:[N7:0];<br />

N7:0 := N7:0 + 1;<br />

END_WHILE;<br />

Figure 19.17<br />

A Program To Average Five Values In Memory With A While-Loop<br />

• The example below will set different outputs depending upon the stat of an input.

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

Saved successfully!

Ooh no, something went wrong!