Basics
39
1.3 Constants
A constant represents a fixed value. Depending on the application, a constant can be used as an addend,
multiplier, address, in-/output number, set value, etc.
There are 3 types of constants:
decimal
hexadecimal
BCD
1.3.1 Decimal Constants
Decimal constants can have a width of either 16 or 32 bits.
Range 16 bit: -32,768 to 32,768
Range 32 bit: -2,147,483,648 to 2,147,483,648
Constants are internally changed into 16-bit binary numbers including character bit and are processed as such.
Simply enter the decimal number in your program.
1.3.2 Hexadecimal Constants
Hexadecimal constants occupy fewer digit positions than binary data. 16 bit constants can be represented by
4-digit, 32-bit constants by 8-digit hecadecimal constants.
Range 16 bit: 8000 to 7FFF
Range 32 bit: 80000000 to 7FFFFFFFF
Enter e.g.: 16#7FFF for the hexadecimal value 7FFF in your program.
1.3.3 BCD Constants
BCD is the abbreviation for Binary Coded Decimal.
Range 16 bit: 0 to 9999
Range 32 bit: 0 to 99999999
Enter BCD constants in the program either as:
binary: 2#0001110011100101 or
hexadecimal: 16#9999