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.

Integer Math Instructions<br />

7.7 + Add Integer Constant (16, 32-Bit)<br />

Format<br />

Description<br />

Status word<br />

Example 1<br />

+ <br />

Address Data type Description<br />

(16, or 32-bit integer) Constant to be added<br />

+ adds the integer constant to the contents of ACCU 1 and<br />

stores the result in ACCU 1. The instruction is executed without regard to, and<br />

without affecting, the status word bits.<br />

+ : Adds a 16-bit integer constant (in the range of -32768<br />

to +32767) to the contents of ACCU 1-L and stores the result in ACCU 1-L.<br />

+ : Adds a 32-bit integer constant (in the range<br />

of - 2,147,483,648 to 2,147,483,647) to the contents of ACCU 1 and stores the result<br />

in ACCU 1.<br />

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

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

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

L IW10 //Load the value of IW10 into ACCU 1-L.<br />

L MW14 //Load the contents of ACCU 1-L to ACCU 2-L. Load the value of MW14 into<br />

ACCU 1-L.<br />

+I //Add ACCU 2-L and ACCU 1-L; store the result in ACCU 1-L.<br />

+ 25 //Add ACCU 1-L and 25; store the result in ACCU 1-L.<br />

T DB1.DBW25 //Transfer the contents of ACCU 1-L (result) to DBW25 of DB1.<br />

Example 2<br />

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

L IW12<br />

L IW14<br />

+ 100 //Add ACCU 1-L and 100; store the result in ACCU 1-L.<br />

>I //If ACCU 2 > ACCU 1, or IW12 > (IW14 + 100)<br />

JC NEXT //then conditional jump to jump label NEXT.<br />

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

7-8 A5E00706960-01

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

Saved successfully!

Ooh no, something went wrong!