At a Glance
Integer types are used to represent a value in different bases. These are:
base 10 (decimal) by default. Here the value is signed or unsigned depending on the integer type
base 2 (binary). Here the value is unsigned and the prefix is 2#
base 8 (octal). Here the value is unsigned and the prefix is 8#
base 16 (hexadecimal). Here the value is unsigned and the prefix is 16#
Integer Type (INT)
Signed type with a 16-bit format.
This table shows the range in each base.
Base |
from... |
to... |
---|---|---|
Decimal |
-32768 |
32767 |
Binary |
2#1000000000000000 |
2#0111111111111111 |
Octal |
8#100000 |
8#077777 |
Hexadecimal |
16#8000 |
16#7FFF |
Double Integer Type (DINT)
Signed type with a 32-bit format.
This table shows the range in each base.
Base |
from... |
to... |
---|---|---|
Decimal |
-2147483648 |
2147483647 |
Binary |
2#10000000000000000000000000000000 |
2#01111111111111111111111111111111 |
Octal |
8#20000000000 |
8#17777777777 |
Hexadecimal |
16#80000000 |
16#7FFFFFFF |
Unsigned Integer Type (UINT)
Unsigned type with a 16-bit format.
This table shows the range in each base.
Base |
from... |
to... |
---|---|---|
Decimal |
0 |
65535 |
Binary |
2#0 |
2#1111111111111111 |
Octal |
8#0 |
8#177777 |
Hexadecimal |
16#0 |
16#FFFF |
Unsigned Double Integer Type (UDINT)
Unsigned type with a 32-bit format.
This table shows the range in each base.
Base |
from... |
to... |
---|---|---|
Decimal |
0 |
4294967295 |
Binary |
2#0 |
2#11111111111111111111111111111111 |
Octal |
8#0 |
8#37777777777 |
Hexadecimal |
16#0 |
16#FFFFFFFF |