Control System Planning

When selecting the brand of PLC components (Allen-Bradley, Siemens, Modicon) you must consider factors such as standards, support, cost and capability. Often times your facility, if it applies, will request a certain brand of PLC. If not, your first instinct may be to select the cheapest PLC you can find. But with cheaper PLCs you may find support is limited and the hardware may not be as robust. The downside to the bigger brand PLCs are the programming software and hardware can be more expensive. Often times you get what you pay for but there are also excellent components out there priced reasonably. You should also consider if the system is new or existing. For instance, if you are upgrading a CPU of an existing system it may be beneficial to select a processor that is compatible with existing I/O to save money. Next you must determine how environmental issues may affect your application. You should always research the product to be sure the equipment satisfies the environmental constraints or you must design the installation to meet those requirements (i.e., panel enclosures, purging, etc.).

Before ordering any equipment you should determine how much discrete and analog I/O the system will have and what voltages the field devices will have. You will need to choose a PLC model that supports the amount and type of I/O. On many systems it is a good idea to add about 20% to your I/O count for spares to cover I/O you may have missed during planning or future expandability.  Another important factor in determining the type of CPU and I/O is whether the system requires any special capabilities such as high-speed counting or servo control. Planning ahead will help you select the correct processor and I/O for your specific application. It is also important to try to determine how large your program will be to determine the amount of memory is required. If the system you are programming for is small obviously less memory is required. Always consider expandability when planning your control system. A small system may easily turn into a larger system and require more memory. The location of I/O needs to be taken into account to determine if local or remote I/O can be used. Remote I/O can save money by reducing panel cost and cost of electrical installation.

Finally you should know your communication requirements. This is often determined by the type of operator interface you may want to use or components that you need to connect to such as drives and I/O. In many instances you must purchase a communication module separately. Check the availability and costs of communicating to your devices and choose accordingly.  Troublshooting and commisioning the communications portion of a control system can be one of the more difficult tasks you will confront.  Minimizing the number of different communication methods on a control system will generally speed the development, installation and troubleshooting time in your system.  Planning ahead can save you time and money implementing your control system.

Before you can begin programming a PLC you must first select the hardware components for your control system. This hardware will include power supply, CPU, I/O (Input/Output). Many considerations must be taken into account before selecting you components such what PLC manufacturer (brand) you would like to use, memory requirements, CPU requirements, voltage level requirements (24Vdc, 120Vac, 220Vac), environmental requirements, communication requirements, etc. .

Control System Sensors

A Sensor used in a control system is a device that monitors a process state and converts a signal which can be observed by a PLC. Discrete sensors only detect a TRUE or FALSE state. The two basic ways to detect the presence of an object is contact and proximity. Contact is a physical contact between the object and switch. Contact switch typically have rollers and wear pads for the point of contact. Proximity indicates when an object is near but no physical contact is made. Some common types of presence detector are contact switches (detect physical contact), reed switches (uses a magnet to close switch when object is near), optical (uses a light source and detector to sense an object), capacitive (sense dielectric object), inductive (senses metal objects).

There are different methods of wiring the sensors to the PLC. A sensor will signal a logical change to the PLC by switching voltage or current ON or OFF. Some types of sensor outputs to the PLC are Sinking/Sourcing (switch current ON or OFF), Switch Contacts (switch voltage ON or OFF), Solid State Relay (switch AC voltage) and TTL – Transistor-Transistor Logic (uses 0V and 5V to indicate logic state). You will find many different types of sensors that can be used in a control system. Selecting the correct sensor to monitor each process state is critical for a successful control system.

Boolean Logic

Boolean logic is a tool used to analyze and design a controls system. In 1854, an Irish mathematician named James Boole developed Boolean algebra in his book An Investigation of the Laws of Thought. Boolean algebra was found useful in the development of digital circuits. The three basic operators are AND, OR and NOT with more complex operators like EXCLUSIVE OR (EOR), NOT ADD (NAND) and NOT OR (NOR). Truth tables are used show all of the possible combinations using variable A and B to calculate X.

Truth tables can represent all of the possible states of a system. Boolean equations can easily be converted into ladder logic.


The most commonly used timer in a PLC program in the Non-Retentive On-Delay Timer. The following is a basic example of how the On-Delay Timer (TON) can be used. When bit B3:0/0 turns ON, timer T4:0 preset value will begin increasing by 1 every one second (Time Base equals 1.0). While the timer is timing the timer’s timing bit (T4:0/TT) will be ON causing bit B3:0/1 to transition from 0 to 1. When the accumulative value reaches 10 the timer stops (T4:0/TT turns OFF) and the timer’s done turns ON causing bit B3:0/2 to transition from 0 to 1. Also note while the timer rung is true the timer’s enable bit (EN) is ON.

The next example uses two timers to toggle a bit ON and OFF every 2 seconds. The cycle starts with timer T4:2 off so T4:2/DN is OFF. Because timer done bit T4:2/DN is OFF timer T4:1 begins timing. When the timer is done bit T4:1/DN turns ON. This causes timer T4:2 to begin timing. Once T4:2 is done, the input to timer T4:1 goes false and causes the timer to reset. This causes bit T4:1/DN to turn OFF causing timer T4:2 to reset and the cycle will start over. Try entering this code online with a PLC or Emulator to watch it work. Adjust the timer presets to vary how long the bit B3:0/5 will turn ON and OFF.


A PLC Counter is an instruction that operates similar to the Timer instruction. While the Timer instruction continually increments its accumulative value the when the rung is true the Counter only increments its accumulative value on a transition from false to true. This means that the rung must transition from true to false before the counter can increment once more; the counter only looks for the transition. There are two basic types of counters: count-up and count-down. When the count-up instruction’s input goes true the accumulative value will increase by one. On a count-down instruction, when the accumulative value will decrease by one. The counters done bit is set when the preset value is reached.

A simple example of an Allen-Bradley count-up (CTU) counter is shown below. Counter C5:0 on rung 000 has a preset value of 5 and an accumulative value of 2. If bit B3:0/0 transitions from 0 to 1 the counter’s accumulative value will increase to 3. Once the accumulative value reaches 5, the counter done bit will transition from 0 to 1 causing bit B3:0/1 to transition from 0 to 1. Bit B3:0/2 is used to reset the counter’s accumulative value back to zero. The counter is then ready to restart the counting. It should be noted the counter will continue to increment above the preset value.

The count-up and count-down instructions can also work together as seen in the example below. In this example the CTU and CTD instruction uses the same address C5:0. When bit B3:0/0 transitions from 0 to 1 the counter preset on both counters (C5:0) increments by 1. If bit B3:0/1 transitions from 0 to 1 the C5:0 accumulative value decreases by 1. The C5:0 DONE (DN) bit is set when the preset value equals the accumulative value.