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.

6.16 JPZ Jump if Plus or Zero<br />

Format<br />

Description<br />

Status word<br />

Example<br />

JPZ <br />

Address Description<br />

Symbolic name of jump destination.<br />

Logic Control Instructions<br />

If the result indicated by the status bits CC 1 and CC 0 is greater than or equal to<br />

zero (CC 1=0/CC 0=0 or CC 1=1/CC 0=0), JPZ (jump if result >= 0)<br />

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

program scan resumes at the jump destination. The jump destination is specified by<br />

a jump label. Both forward and backward jumps are possible. Jumps may be<br />

executed only within a block, that is, the jump instruction and the jump destination<br />

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

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

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

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

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

REG0: AN M 4.1 //Program scan resumes here after jump to jump label REG0.<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 />

A5E00706960-01 6-17

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

Saved successfully!

Ooh no, something went wrong!