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.15 JM Jump if Minus<br />

Format<br />

Description<br />

Status word<br />

Example<br />

JM <br />

Address Description<br />

Symbolic name of jump destination.<br />

If status bits CC 1 = 0 and CC 0 = 1, JM (jump if result < 0) interrupts<br />

the linear program scan and jumps to a jump destination. The linear program scan<br />

resumes at the jump destination. The jump destination is specified by a jump label.<br />

Both forward and backward jumps are possible. Jumps may be executed only within<br />

a block, that is, the jump instruction and the jump destination must lie within one and<br />

the same block. The jump destination must be unique within this block. The<br />

maximum jump distance is -32768 or +32767 words of program code. The actual<br />

maximum number of statements you can jump over depends on the mix of the<br />

statements used in your program (one-, two-, or three word statements).<br />

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

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

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

L IW8<br />

L MW12<br />

-I //Subtract contents of MW12 from contents of IW8.<br />

JM NEG //Jump if result < 0 (that is, contents of ACCU 1 < 0).<br />

AN M 4.0 //Program scan continues here if jump is not executed.<br />

S M 4.0<br />

JU NEXT<br />

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

S M 4.1<br />

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

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

6-16 A5E00706960-01

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

Saved successfully!

Ooh no, something went wrong!