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.

14.7 ENT Enter ACCU Stack<br />

Format<br />

Description<br />

Example<br />

ENT<br />

Accumulator Instructions<br />

ENT (enter accumulator stack) copies the contents of ACCU 3 into ACCU 4 and the<br />

contents of ACCU 2 into ACCU 3. If you program the ENT instruction directly in front<br />

of a load instruction, you can save an intermediate result in ACCU 3.<br />

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

L DBD0 //Load the value from data double word DBD0 into ACCU 1. (This value must be<br />

in the floating point format).<br />

L DBD4 //Copy the value from ACCU 1 into ACCU 2. Load the value from data double word<br />

DBD4 into ACCU 1. (This value must be in the floating point format).<br />

+R //Add the contents of ACCU 1 and ACCU 2 as floating point numbers (32 bit,<br />

IEEE-FP) and save the result in ACCU 1.<br />

L DBD8 //Copy the value from ACCU 1 into ACCU 2 load the value from data double word<br />

DBD8 into ACCU 1.<br />

ENT //Copy the contents of ACCU 3 into ACCU 4. Copy the contents of ACCU 2<br />

(intermediate result) into ACCU 3.<br />

L DBD12 //Load the value from data double word DBD12 into ACCU 1.<br />

-R //Subtract the contents of ACCU 1 from the contents of ACCU 2 and store the result<br />

in ACCU 1. Copy the contents of ACCU 3 into ACCU 2. Copy the contents of ACCU<br />

4 into ACCU 3.<br />

/R //Divide the contents of ACCU 2 (DBD0 + DBD4) by the contents of ACCU 1 (DBD8<br />

- DBD12). Save the result in ACCU 1.<br />

T DBD16 //Transfer the results (ACCU 1) to data double word DBD16.<br />

14.8 LEAVE Leave ACCU Stack<br />

Format<br />

Description<br />

LEAVE<br />

LEAVE (leave accumulator stack) copies the contents of ACCU 3 into ACCU 2 and<br />

the contents of ACCU 4 into ACCU 3. If you program the LEAVE instruction directly<br />

in front of a shift or rotate instruction, and combine the accumulators, then the leave<br />

instruction functions like an arithmetic instruction. The contents of ACCU 1 and<br />

ACCU 4 remain unchanged.<br />

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

A5E00706960-01 14-7

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

Saved successfully!

Ooh no, something went wrong!