46
3
3 Elements3.9 Constant
page 686
.
3.9 Constant
Five types of numerical values can be used based on the use and purpose of the PLC. Their roles and functions
are listed in the following table below.
Type Description of Application in Programming
Decimal, DEC
It is used to set the value of the timer and counter (constant K).
It is used to specify the number of the auxiliary relay (M), timer (T), counter (C),
and status S (the element number).
It is used to specify the numerical value of the application instruction operand and
instruction action (constant K).
Hexadecimal, HEX
Similar to DEC, it is used to specify the numerical value of the application
instruction operand and instruction action (constant H).
Binary, BIN
The DEC or HEX can be used to specify numerical values for the timer, counter
or data register, but the numerical values are processed as binary numbers inside
the PLC. Besides, when used on a peripheral device for monitoring purpose, these
elements will automatically convert to decimal or hexadecimal numbers.
Octal, OCT
The element numbers of input relays and output relays are allocated as octal
values. Therefore, 0-7, 10-17……70-77, 100-107 are allowed, but 8, 9 are not
allowed.
BCD
BCD is a method in which 4-bit binary values are used to represent decimal
numbers 0 to 9. The bits can be easily processed, and can be used to control the
display of the digital switch or 7-segment codes of the BCD output parameters.
Binary oating-point
number
The PLC provides the high-precision oating-point operation function using BIN
oating-point numbers.
Decimal owing-point
number
Decimal owing-point values are used only for monitoring and easy reading
purpose.
[K] is a symbol indicating a decimal integer. It is mainly used to specify the value of the timer or counter or the
numerical value in the application instruction operand. In a 16-bit instruction, the value range of the constant K is
-32768 to +32767. In a 32-bit instruction, the value range of the constant K is -2,147,483,648 to +2,147,483,647.
[H] is a symbol indicating a hexadecimal value. It is mainly used to specify the numerical value in the application
instruction operand. In a 16-bit instruction, the value range of the constant H is 0000 to FFFF. In a 32-bit
instruction, the value range of the constant H is 0x0 to 0xFFFFFFFF.