2. Programming Concepts 2.6 PLC Bits, Nibbles, Bytes, Words, etc For different control purposes, there are five types of values inside DVP-PLC for executing the operations. Bit, nibble, byte, word, and double word in a binary system: DW Double Word W1 W0 BY3 BY2 BY1 BY0 Word Byte NB0 NB1 NB2 NB3 NB4 NB5 NB6 NB7 Nibble Bit 2.7 Binary, Octal, Decimal, BCD, Hex For fulllfilling different kinds of internal manipulation, DVP-PLC appies 5 foramts of number systems. Each number system has its specific purpose and function described as below. 1. Binary Number, (BIN) PLC internally calculates, operates, and stores the value in Binary format. 2.
Octal Number, (OCT) The external I/O points of DVP-PLC are numbered in octal format. e.g. External inputs: X0 ~ X7, X10 ~ X17, …, X377. (No. of device) External outputs: Y0 ~ Y7, Y10 ~ Y17, …, Y377. (No. of device) 3. Decimal Number, (DEC) DVP-PLC appies decimal operation in situations below: Set value for timers and counters, e.g. TMR C0 K50. (K value) No. of S, M, T, C, D, E, F, P, I devices, e.g. M10, T30. (No. of device) For use of operand in API instructions, e.g. MOV K123 D0. (K value) 4. BCD (Binary Coded Decimal) BCD format takes 1 digit or 4 bits to indicate a Decimal value, so that data of consecutive 16 bits indicates a 4-digit decimal value.
Used mainly for reading values from DIP switches or sending data to 7-segement displays 5. Hexadecimal Number, HEX DVP-PLC appies Hexadecimal operation in situations below: For use of operand in API instructions, e.g. MOV H1A2B D0 。 (H value) Constant (K): A decimal number in a PLC is generally preceded by K. For example, K100 represents the decimal number 100. 2-11 Numeric Description Bit Bit is the basic unit of a binary number system. Range is 0 or 1 Nibble Consists of 4 consecutive bits, e.g. b3~b0. Range 0 ~ 9 in Decimal or 0~F in Hex Byte Consists of 2 consecutive nibbles, e.g. b7~b0. Range 00 ~ FF in Hex Word Consists of 2 consecutive bytes, e.g. b15~b0.
Range 0000 ~ FFFF in Hex Double Word Consists of 2 consecutive words, e.g. b31~b1. Range 00000000 - FFFFFFFF in Hex