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.12<br />

A<br />

FOR<br />

label number 0<br />

index N7:0<br />

initial value 0<br />

terminal value 9<br />

step size 2<br />

ADD<br />

Source A 1<br />

Source B N7:1<br />

Dest N7:1<br />

B<br />

BRK<br />

NXT<br />

label number 0<br />

Note: if A is true then the loop will repeat 10 times, <strong>and</strong> the value of N7:1 will be<br />

increased by 10. If A is not true, then the ADD function will only be executed once<br />

<strong>and</strong> N7:1 will increase in value by 1.<br />

Figure 16.12<br />

A For-Next Loop<br />

Ladder logic programs always have an end statement, as shown in Figure 16.13.<br />

Most modern software automatically inserts this. PLCs will experience faults if this is not<br />

present. The temporary end (TND) statement will skip the remaining portion of a program.<br />

If C is true then the program will end, <strong>and</strong> the next line with D <strong>and</strong> Y will be<br />

ignored. If C is false then the TND will have no effect <strong>and</strong> Y will be equal to D.

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

Saved successfully!

Ooh no, something went wrong!