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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Logic Control Instructions<br />

6.13 JN Jump if Not Zero<br />

Format<br />

Description<br />

Status word<br />

Example<br />

JN <br />

Address Description<br />

Symbolic name of jump destination.<br />

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

(CC 1=0/CC 0=1 or CC 1=1/CC 0=0), JN (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 />

XOW<br />

JN NOZE //Jump if the contents of ACCU 1-L are not equal to zero.<br />

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

S M 4.0<br />

JU NEXT<br />

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

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

Saved successfully!

Ooh no, something went wrong!