Delta Electronics AH — 5.2.16. Values and Constants (K, 16#)

Chapter 5 Understanding Common Devices 5.2.16. Values and Constants (K, 16#) - The explanation on data units which could be used in the system: The relation among bits, nibbles, bytes, words, and double words in the binary system is shown below. DW Double word W1 W0 Word BY3 BY2 BY1 BY0 Byte NB0 NB1 NB2 NB3 NB4 NB5 NB6 NB7 Nibble Bit 5_ - The PLC uses four types of values to execute the operation according to different control purposes. The functions of these values are illustrated as follows: 1. Binary number (BIN) The PLC adopts the binary system to operate the values. 2.

Decimal number (DEC) The decimal number in the PLC is used as;  the setting value of the timer (T) or the setting value of the counter (C/HC). For example, TMR C0 50 ( constant K ).  the device number. For example, M10 and T30 (device number)  the number before or after the decimal point. For example, X0.0, Y0.11, and D10.0 (device number).  the constant K : It is used as the operand in the applied instruction. For example, MOV 123 D0 (constant K) . 3. Binary-coded decimal (BCD) A decimal value is represented by a nibble or four bits, and therefore sixteen consecutive bits can represent a four-digit decimal value. 4.

Hexadecimal number (HEX) 5-11 Name Description Bit A bit is the basic unit in the binary system. Its state is either 1 or 0. Nibble A nibble is composed of four consecutive bits (e.g. b3~b0). Nibbles can be used to represent 0~9 in the decimal system, or 0~F in the hexadecimal system. Byte A byte is composed of two consecutive nibbles (i.e. 8 bits, b7~b0). Bytes can be used to represent 00~FF in the hexadecimal system. Word A word is composed of two consecutive bytes (i.e. 16 bits, b15~b0). Words can be used to represent 0000~FFFF in the hexadecimal system. Double word A double word is composed of two consecutive words (i.e. 32 bits, b31~b0).

Double words can be used to represent 00000000~FFFFFFFF in the hexadecimal system. Quadruple word A quadruple word is composed of four consecutive words (i.e. 64 bits, b63~b0). Quadruple words can be used to represent 0000000000000000 – FFFFFFFFFFFFFFFF in the hexadecimal system. b31 b30 b29 b28 b27 b26 b25 b24 b23 b22 b21 b20 b19 b18 b17 b16 b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0