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 />

Routine Name: LoopRoutine<br />

index i<br />

initial value 0<br />

terminal value 9<br />

step size 2<br />

LoopRoutine<br />

SBR<br />

ADD<br />

Source 1<br />

Source i<br />

Dest j<br />

B<br />

BRK<br />

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

by 10. If A is not true, then the subroutine will never be called.<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.<br />

www.PA<strong>Control</strong>.com

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

Saved successfully!

Ooh no, something went wrong!