Chapter 3. Program DataGFK-2950C February 2018 513.9 How Program Functions Handle Numerical DataRegardless of where data is stored in memory – in one of the bit memories or one of the wordmemories – the application program can handle it as different data types.3.9.1 Data TypesType Name Description Data FormatBOOL Boolean The smallest unit of memory. It has two states: 1 or0. A BOOL array may have length N.BYTE Byte Has an 8-bit value. Has 256 values (0–255). A BYTEarray may have length N.WORD Word Uses 16 consecutive bits of data memory. The validrange of word values is 0000 hex to FFFF hex.Register1 (16 bit states)16 1DWORD Double Word Has the same characteristics as a single word datatype, except that it uses 32 consecutive bits in datamemory instead of only 16 bits.Register 232Register 11617 1(32 bit states)UINT UnsignedIntegerUses 16-bit memory data locations. They have a validrange of 0 to +65535 (FFFF hex).Register1 (Binary value)16 1INT SignedIntegerUses 16-bit memory data locations, and arerepresented in 2’s complement notation. The validrange of an INT data type is –32768 to +32767.Register 1 (Two’sComplementvalue)16 1Ss=sign bit(0=positive, 1=negative)DINT DoublePrecisionIntegerStored in 32-bit data memory locations (twoconsecutive 16-bit memory locations). Always signedvalues (bit 32 is the sign bit). The valid range of aDINT data type is -2147483648 to +2147483647 s=sign bit(0=positive, 1=negative)REAL FloatingPointUses 32 consecutive bits (two consecutive 16-bitmemory locations).The range of numbers that can be stored in thisformat is from ±1.401298E-45 to ±3.402823E+38.For the IEEE format, refer to Floating Point Numbers.Register 232Register 11617 1(IEEE format)LREAL DoublePrecisionFloatingPointUses 64 consecutive bits (four consecutive 16-bitmemory locations).The range of numbers that can be stored in thisformat is from ±2.2250738585072020E-308 to±1.7976931348623157E+308.For the IEEE format, refer to Floating Point Numbers.Register 232Register 11617 1(IEEE format)Register 464Register 34849 33BCD-4 Four-DigitBCDUses 16-bit data memory locations. Each binarycoded decimal (BCD) digit uses four bits and canrepresent numbers between 0 and 9. This BCDcoding of the 16 bits has a legal value range of 0 to9999.Register 1(4 BCD digits)13 1594 3 2 1sRegister 232Register 11617 1(Binary value)