2

Data Types

Data types include the following:

Table 2-5. Data Types

Type

Name

Description

 

 

 

 

 

 

Data Format

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

INT

Signed

Signed integers use 16-bit memory

 

 

Register 1

 

 

 

 

 

Integer

data locations, and are represented

 

 

 

 

 

 

 

 

in 2’s complement notation. The

 

S

 

 

 

 

(16 bit positions)

 

 

valid range of an INT data type is –32,768

16

 

 

1

 

 

 

 

 

 

to +32,767.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DINT

Double

Double precision signed integers are

 

 

 

 

 

 

 

 

 

 

 

 

Precision

stored in 32-bit data memory

 

 

Register 2

 

 

 

Register 1

 

 

 

Signed

locations (actually two consecutive 16-bit

 

 

 

 

 

 

 

 

 

S

 

 

 

 

 

 

 

 

 

Integer

memory locations) and represented in 2’s

 

 

 

 

 

 

 

 

 

 

32

 

 

17

 

16

1

 

 

 

complement notation. (Bit 32 is the sign

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

bit.) The valid range of a DINT data type

 

 

(Two’s Complement Value)

 

 

 

 

is –2,147,483,648 to +2,147,483,867.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BIT

Bit

A Bit data type is the smallest unit of

 

 

 

 

 

 

 

 

 

 

 

 

 

memory. It has two states, 1 or 0. A BIT

 

 

 

 

 

 

 

 

 

 

 

 

 

string may have length N.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BYTE

Byte

A Byte data type has an 8-bit value.

 

 

 

 

 

 

 

 

 

 

 

 

 

The valid range is 0 to 255 (0 to FF in

 

 

 

 

 

 

 

 

 

 

 

 

 

hexadecimal).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

WORD

 

A Word data type uses 16 consecutive

 

 

 

 

 

 

 

 

 

 

 

 

 

bits of data memory; but, instead of the

 

 

 

 

 

 

 

 

 

 

 

 

 

bits in the data location

 

 

 

 

 

 

 

 

 

 

 

 

 

representing a number, the bits are

 

 

Register 1

 

 

 

 

 

 

 

 

independent of each other. Each bit

 

 

 

 

 

 

 

(16 bit positions)

 

 

represents its own binary state (1 or

16

 

 

1

 

 

 

 

 

 

 

0), and the bits are not looked at

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

together to represent an integer

 

 

 

 

 

 

 

 

 

 

 

 

 

number. The valid range of word

 

 

 

 

 

 

 

 

 

 

 

 

 

values is 0 to FFFF.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BCD-4

Four-Digit

Four-digit BCD numbers use 16-bit data

 

 

 

 

 

 

 

 

 

 

 

 

Binary

memory locations. Each BCD

 

 

Register 1

 

 

 

 

 

 

 

Coded

digit uses four bits and can represent

 

 

 

 

 

 

 

 

 

 

4 3 2 1

 

(4 BCD digits)

 

 

 

Decimal

numbers between 0 and 9. This BCD

 

 

 

 

 

16

13

9

5

1

 

 

 

 

 

 

coding of the 16 bits has a legal value

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

range of 0 to 9999.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

REAL

Floating

Real numbers use 32 consecutive bits

 

 

 

 

 

 

 

 

 

 

 

 

Point

(actually two consecutive 16-bit memory

 

 

Register 2

 

 

 

Register 1

 

 

 

 

locations). The range of numbers that can

 

S

 

 

 

 

 

 

 

 

 

 

be stored in this format is from ±

32

 

 

17

 

16

1

 

 

 

1.401298E-45 to ± 3.402823E+38.

 

 

 

 

 

 

 

 

(Two’s Complement Value)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S = Sign bit (0 = positive, 1 = negative).

GFK-0467K

Chapter 2 System Operation

2-23

Page 43
Image 43
GE 90-30/20/Micro manual Data Types, Type Name Description Data Format, Byte, Real