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.

Conversion Instructions<br />

3.6 DTB Double Integer (32-Bit) to BCD<br />

Format<br />

Description<br />

Status word<br />

Example<br />

DTB<br />

DTB (binary to decimal conversion of a 32-bit integer number) interprets the content<br />

of ACCU 1 as a 32-bit double integer and converts it to a seven-digit binary coded<br />

decimal number (BCD).The result is stored in accumulator 1. Bit 0 to bit 27 contain<br />

the value of the BCD number. Bit 28 to bit 31 are set to the state of the sign of the<br />

BCD number (0000 = positive, 1111 = negative). Accumulator 2 remains unchanged.<br />

The BCD number can be in the range of "-9,999,999" to "+9,999,999". If the number<br />

is out of the permissible range, then the status bits OV and OS are set to 1.<br />

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

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

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

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

DTB //Convert from integer (32-bit) to BCD, store result in ACCU 1.<br />

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

DTB<br />

MD10<br />

MD20<br />

31... ...16 15... ...0<br />

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

Integer to BCD<br />

"-701" Integer<br />

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

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

" - " " 0 " " 0 " " 0 " " 0 " " 7 " " 0 " " 1 "<br />

"-701" BCD<br />

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

3-6 A5E00706960-01

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

Saved successfully!

Ooh no, something went wrong!