To express the number in the binary system requires many more digits than in the decimal system, or other systems, explained earlier. The octal numbering system, a base 8 system, is used because 8 data bits make up a byte of information that can be addressed. Octal is a convenient means of handling large binary numbers. One octal digit can be used to express three binary digits.   It can be seen that the octal 462 is much easier to read and write than its binary equivalent is.

Similarly, hexadecimal numbers can easily be converted to binary numbers by writing the 4-bit binary equivalent of the hex digit for each position.


BCD, Gray and ASCII code

Binary Coded Decimal (BCD) System

The binary coded decimal (BCD) system provides a convenient way of handling large numbers that need to be input to or output from a PLC. The BCD system provides a means of converting a code readily handled by humans (decimal) to a code readily handled by the equipment (binary). The BCD system uses 4 bits to represent each decimal digit. The 4 bits used are the binary equivalents of the numbers from 0 to 9. In the BCD system, the largest decimal number that can be displayed by any four digits is 9.

Gray Code

The Gray code is a special type of binary code that does not use position weighting. The Gray code is set up so that as we progress from one number to the next, only one bit changes; it is an ordering of the binary numeral system such that two successive values differ in only one bit (binary digit). This is ideal for encoder circuits. In binary for example, the transition from 0111 to 1000 (decimal 7 to 8) involves a change in all four digits. This kind of change increases the possibility for error in certain digital circuits. For this reason, the Gray code is considered to be an error-minimizing code, since only one bit changes its value during any transition between two numbers.
Gray codes are used with position encoders for accurate control of the motion of robots, machine tools, and servomechanisms.

ASCII Code

ASCII - American Standard Code for Information Interchange, is an alphanumeric code because it includes letters as well as numbers. The characters accessed by the ASCII code include 10 numeric digits; 26 lowercase and 26 uppercase letters of the alphabet; and about 25 special characters, including those found on a standard typewriter. The keystrokes on the keyboard of a computer are converted directly into ASCII for processing by the computer, because computers can only understand numbers; ASCII code is the numerical representation of a character, such as 'a', or '@', or an action of some sort. ASCII format means that it is in plain text, without any formatting, like bold, underscore or tabs etc.; the raw format that any computer can understand. Below are shown ASCII and extended ASCII codes.



Some PLC communication systems use a binary bit to check the accuracy of data transmission. For example, when data are transferred between PLCs, one of the binary digits may be accidentally changed from a 1 to a 0. This can happen because of a transient or a noise or because of a failure in some portion of the transmission network. A parity bit is used to detect errors that may occur while a word is moved.
Two systems of parity are normally used: odd and even.
Odd parity means that the total number of binary 1 bits in the character, including the parity bit, is odd. Even parity means that the number of binary 1 bits in the character, including the parity bit, is even.

Input/Output Devices and Motor Controls

Pushbuttons and Switches

Pushbuttons and switches are discrete input devices that either allow electric current to flow or prevent it from flowing through them (ON and OFF position). Their states can be physically changed to the ON or OFF position, in which they remain until the position is changed, again. Pushbuttons and switches are connected to PLC input ports. During the ON state, positive voltage is placed on the PLC port, while during the OFF state, there is no voltage (zero voltage is placed) on the PLC port.   Multiple-contact pushbuttons and switches have number of poles and throws; poles are contacts through which current enters the switch, they are connected to the movable contacts which is the number of places in which the switch opens or breaks the circuit - throws.

« Previous Next »