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 15 . . . . . . . . . . 0<br />

ACCU 1 before execution of XOW 0101 0101 0011 1011<br />

ACCU 2-L or 16-bit constant: 1111 0110 1011 0101<br />

Result (ACCU 1) after execution of XOW 1010 0011 1000 1110<br />

Example 1<br />

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

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

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

XOW //Combine bits of ACCU 1-L with ACCU 2-L bits by XOR, store result in ACCU<br />

1-L.<br />

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

Example 2<br />

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

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

XOW 16#0FFF //Combine bits of ACCU 1-L with bit pattern of 16-bit constant<br />

(0000_1111_1111_1111) by XOR, store result in ACCU 1-L.<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-7

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

Saved successfully!

Ooh no, something went wrong!