Chapter 3. Program Data
GFK-2950C February 2018 51
3.9 How Program Functions Handle Numerical Data
Regardless of where data is stored in memory – in one of the bit memories or one of the word
memories – the application program can handle it as different data types.
3.9.1 Data Types
The smallest unit of memory. It has two states: 1 or
0. A BOOL array may have length N.
Has an 8-bit value. Has 256 values (0–255). A BYTE
array may have length N.
Uses 16 consecutive bits of data memory. The valid
range of word values is 0000 hex to FFFF hex.
Has the same characteristics as a single word data
type, except that it uses 32 consecutive bits in data
memory instead of only 16 bits.
Uses 16-bit memory data locations. They have a valid
range of 0 to +65535 (FFFF hex).
Uses 16-bit memory data locations, and are
represented in 2’s complement notation. The valid
range of an INT data type is –32768 to +32767.
s=sign bit
(0=positive, 1=negative)
Stored in 32-bit data memory locations (two
consecutive 16-bit memory locations). Always signed
values (bit 32 is the sign bit). The valid range of a
DINT data type is -2147483648 to +2147483647
s=sign bit
(0=positive, 1=negative)
Uses 32 consecutive bits (two consecutive 16-bit
memory locations).
The range of numbers that can be stored in this
format is from ±1.401298E-45 to ±3.402823E+38.
For the IEEE format, refer to Floating Point Numbers.
Double
Precision
Floating
Point
Uses 64 consecutive bits (four consecutive 16-bit
memory locations).
The range of numbers that can be stored in this
format is from ±2.2250738585072020E-308 to
±1.7976931348623157E+308.
For the IEEE format, refer to Floating Point Numbers.
Uses 16-bit data memory locations. Each binary
coded decimal (BCD) digit uses four bits and can
represent numbers between 0 and 9. This BCD
coding of the 16 bits has a legal value range of 0 to
9999.