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.

Examples<br />

Word Logic Instructions<br />

Bit 31 . . . . . . . . . . . . . . . . . 0<br />

ACCU 1 before execution of UD 0101 0000 1111 1100 1000 1001 0011 1011<br />

ACCU 2 or 32-bit constante 1111 0011 1000 0101 0111 0110 1011 0101<br />

Result (ACCU 1) after execution of UD 0101 0000 1000 0100 0000 0000 0011 0001<br />

Example 1<br />

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

L ID20 //Load contents of ID20 into ACCU 1.<br />

L ID24 //Load contents of ACCU 1 into ACCU 2. Load contents of ID24 into ACCU<br />

1.<br />

AD //Combine bits from ACCU 1 with ACCU 2 by AND, store result in ACCU<br />

1.<br />

T MD8 //Transfer result to MD8.<br />

Example 2<br />

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

L ID 20 //Load contents of ID20 into ACCU 1.<br />

AD DW#16#0FFF_EF21 //Combine bits of ACCU 1 with bit pattern of 32-bit constant<br />

(0000_1111_1111_1111_1110_1111_0010_0001) by AND; store result in<br />

ACCU 1.<br />

JP NEXT //Jump to NEXT jump label if result is unequal to zero, (CC 1 = 1).<br />

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

A5E00706960-01 13-9

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

Saved successfully!

Ooh no, something went wrong!