12.07.2015 Views

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Common Attributes 639Integer to REALThe controller stores REAL values in IEEE single-precision,floating-point number format. It uses one bit for the sign of the value,23 bits for the base value, and eight bits for the exponent (32 bitstotal). If you mix an integer tag (SINT, INT, or DINT) and a REAL tagas inputs in the same instruction, the controller converts the integervalue to a REAL value before the instruction executes.• A SINT or INT value always converts to the same REAL value.• A DINT value may not convert to the same REAL value:– A REAL value uses up to 24 bits for the base value (23 storedbits plus a “hidden” bit).– A DINT value uses up to 32 bits for the value (one for thesign and 31 for the value).– If the DINT value requires more than 24 significant bits, itmay not convert to the same REAL value. If it will not, thecontroller rounds to the nearest REAL value using 24significant bits.DINT to SINT or INTTo convert a DINT value to a SINT or INT value, the controllertruncates the upper portion of the DINT and sets the overflow statusflag, if necessary. The following example shows the result of a DINTto SINT or INT conversion.EXAMPLEConversion of a DINT to an INT and a SINTThis DINT ValueConverts To This Smaller Value16#0001_0081 (65,665) INT: 16#0081 (129)SINT: 16#81 (-127)Publication 1756-RM003I-EN-P - January 2007

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

Saved successfully!

Ooh no, something went wrong!