26.10.2012 Views

Statement List (STL) - DCE FEL ČVUT v Praze

Statement List (STL) - DCE FEL ČVUT v Praze

Statement List (STL) - DCE FEL ČVUT v Praze

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Logic Control Instructions<br />

6.11 JOS Jump if OS = 1<br />

Format<br />

Description<br />

Status word<br />

Example<br />

JOS <br />

Address Description<br />

Symbolic name of jump destination.<br />

If status bit OS is 1, JOS interrupts the linear program scan and jumps<br />

to a jump destination. The linear program scan resumes at the jump destination. The<br />

jump destination is specified by a jump label. Both forward and backward jumps are<br />

possible. Jumps may be executed only within a block, that is, the jump instruction<br />

and the jump destination must lie within one and the same block. The jump<br />

destination must be unique within this block. The maximum jump distance is -32768<br />

or +32767 words of program code. The actual maximum number of statements you<br />

can jump over depends on the mix of the statements used in your program (one-,<br />

two-, or three word statements).<br />

BR CC 1 CC 0 OV OS OR STA RLO /FC<br />

writes: - - - - 0 - - - -<br />

<strong>STL</strong> Explanation<br />

L IW10<br />

L MW12<br />

*I<br />

L DBW25<br />

+I<br />

L MW14<br />

-I<br />

JOS OVER //Jump if overflow in one of the three instructions during<br />

calculation OS=1. (See Note).<br />

T MW16 //Program scan continues here if jump is not executed.<br />

A M 4.0<br />

R M 4.0<br />

JU NEXT<br />

OVER: AN M 4.0 //Program scan resumes here after jump to jump label OVER.<br />

S M 4.0<br />

NEXT: NOP 0 //Program scan resumes here after jump to jump label NEXT.<br />

Note<br />

In this case do not use the JO instruction. The JO instruction would only check the<br />

previous -I instruction if an overflow occurred.<br />

<strong>Statement</strong> <strong>List</strong> (<strong>STL</strong>) for S7-300 and S7-400 Programming<br />

6-12 A5E00706960-01

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

Saved successfully!

Ooh no, something went wrong!