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.

Conversion Instructions<br />

3.7 DTR Double Integer (32-Bit) to Floating-Point (32-Bit<br />

IEEE-FP)<br />

Format<br />

Description<br />

Status word<br />

Example<br />

DTR<br />

DTR (conversion of a 32-bit integer number to a 32-bit IEEE floating point number)<br />

interprets the content of ACCU 1 as a 32-bit double integer and converts it to a 32-bit<br />

IEEE floating point number. If necessary, the instruction rounds the result. (A 32-bit<br />

integer has a higher accuracy than a 32-bit floating point number). The result is<br />

stored in accumulator 1.<br />

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

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

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

L MD10 //Load the 32-bit integer into ACCU 1.<br />

DTR //Convert from double integer to floating point (32-bit IEEE FP); store result<br />

in ACCU 1.<br />

T MD20 //Transfer result (BCD number) to MD20.<br />

DTR<br />

MD10<br />

MD20<br />

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 1 0 0<br />

Integer (32 bit) to IEEE floating-point (32 Bit)<br />

"+500" Integer<br />

31 30... 22...<br />

...0<br />

0 1 0 0 0 0 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0<br />

8-bit exponent<br />

1 bit<br />

Sign of the mantissa<br />

23-bit mantissa<br />

"+500" IEEE-FP<br />

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

A5E00706960-01 3-7

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

Saved successfully!

Ooh no, something went wrong!