How Program Functions Handle Numerical Data - GE VersaMax PLC User Manual

Table of Contents

Advertisement

9.4 How Program Functions Handle Numerical Data

Type
Name
BIT
Bit
Byte
BYTE
WORD
Four-Digit
Binary Coded
BCD-4
Decimal
Floating-Point
REAL
Signed Integer
INT
Double
Precision
DINT
Signed Integer
120
GFK-1503E
For public disclosure
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.
Description
A Bit data type is the smallest unit of
memory. It has two states, 1 or 0. The
programmer functions use the term
BOOL for bit-type data.
A Byte data type has an 8-bit value.
The valid range is 0 to 255 (0 to FF in
hexadecimal).
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 independent of
each other. Each bit represents its own
binary state (1 or 0). The valid range of
word values is 0 to +65,535 (FFFF).
Four-digit BCD numbers use 16-bit
data memory locations. Each BCD digit
uses four bits and can represent
numbers between 0 and 9. BCD coding
of the 16 bits has a value range of 0 to
9999.
Real numbers use two consecutive
16-bit memory locations. The range of
numbers that can be stored in this
format is ± 1.401298E-45 to
± 3.402823E+38. Refer to the following
table for more information.
Signed integer data uses 16-bit
memory locations. Signed integers are
represented in 2's complement
notation. Bit 16 is the sign bit,
(0 = positive, 1 = negative). Their range
is -32,768 to +32,767.
Double precision signed integers data
uses two consecutive 16-bit memory
locations. They are represented in 2's
complement notation. Bit 32 is the sign
bit, (0 = positive, 1 = negative). Their
range is -2,147,483,648 to
+2,147,483,847.
Data Format
Word 1
16 bit positions
16
1
Word 1
1
4
Word 2
3
2
4 BCD Digits
13
9
5
1 Bit Positions
16
Word 2
Word 1
+/-
17
16
32
8 bit exponent
23 bit mantissa
Two's Complement Values
Word 1
+/-
16 bit positions
16
1
Two's Complement Values
Word 1
Word 2
+/-
1
17
16
32
Two's Complement Values
VersaMax PLC User Manual
1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents