What are logic functions, and how are they applied?
In our previous article, we dived into PLC Programming techniques. In this article, we’re going to check out logic functions and how they are applied to PLC systems.
What is a PLC timer?
A PLC timer is an instruction that controls and operates the device for a specific duration of time. A timer is essential in a PLC for this reason. We can set time-based activity with the help of the PLC programming timer instruction.
The timer instruction provides programming logic and is used to decide when to turn the circuit on or off. It has normally open (NO) and normally closed (NC) contacts.
The image below shows the input and output timers for NO and NC contact in LD programming:

If we want to perform work or device activity in a particular time span, we have to learn I/O timer instructions for writing the PLC program. In the Ladder Diagram (LD) PLC programming, we can set the PLC timer from millisecond (ms) to an hour (hr) time range.
Logic functions used in PLC timer programming
There are several logic functions used in the programming of PLC timers. Let’s have a look at some of them:
AND logic function
Switch A and switch B have both to be open to give an AND logic situation.
Inputs | Output | |
A | B | |
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
The ladder diagram starts with | |, a normally open set of contacts labelled input A, to represent switch A and in series with it | |, another normally open set of contacts labelled input B, to represent switch B. The line then terminates with O to represent the output.
For there to be an output, both input A and input B have to occur, i.e., input A and input B contacts have to be closed
OR logic function
This describes an OR logic gate in that input A or input B must be on for there to be an output.
Inputs | Output | |
A | B | |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
An example of an OR gate control system is a conveyor belt transporting bottled products to packaging, where a deflector plate is activated to deflect bottles into a reject bin if either the weight is not within certain tolerances or there is no cap on the bottle.
NOT logic function
When there is an input to the switch, it opens and there is then no current in the circuit. This illustrates a NOT gate in that there is an output when there is no input and no output when there is an input. The gate is sometimes referred to as an inverter.
Input A | Output |
0 | 1 |
1 | 0 |
With no input-to-input A, the contacts are closed and so there is an output. When there is an input-to-input A, it opens and there is then no output. An example of a NOT gate control system is a light that comes on when it becomes dark, i.e., when there is no light input to the light sensor there is an output.
NAND logic function

Suppose we follow an AND gate with a NOT gate. The NOT gate will invert all the outputs from the AND gate. An alternative, which gives exactly the same results, is to put a NOT gate on each input and then follow that with OR
Inputs | Output | |
A | B | |
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
Bthe inputs A and B have to be 0 for there to be a 1 output. There is an output when input A and input B are not 1. The combination of these gates is termed a NAND gate.
An example of a NAND gate control system is a warning light that comes on if, with a machine tool, the safety guard switch has not been activated and the limit switch signalling the presence of the workpiece has not been activated.
NOR logic function

Suppose we follow an OR gate by a NOT gate. The NOT gate will to invert the outputs of the OR gate. An alternative, which gives exactly the same results, is to put a NOT gate on each input and then an AND gate for the resulting inverted inputs.
Inputs | Output | |
A | B | |
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 0 |
The combination of OR and NOT gates is termed a NOR gate. There is an output when neither input A or input B is 1.

Keep an eye out for our next articles where we’re going to dive even further into Programmable Logic Controller systems and their uses.
Interested in our courses?
You can read more about our selection of accredited online electrical and electronic engineering courses here.
Check out individual courses pages below:
Diploma in Electrical and Electronic Engineering
Higher International Certificate in Electrical and Electronic Engineering
Diploma in Electrical Technology
Diploma in Renewable Energy (Electrical)
Higher International Diploma in Electrical and Electronic Engineering
Alternatively, you can view all our online engineering courses here.
Recent Posts
Types of Actuators: Principles, Mechanisms, and Applications
Types of Actuators: Principles, Mechanisms, and Applications Thermal actuators Thermal actuators convert temperature changes into linear movement or “stroke” by utilising the expansion and contraction of thermally sensitive materials within them. They integrate both temperature sensing and actuation, making them valuable for various applications, including: 1. Temperature control 2. Fluid mixing and diverting 3. Freeze […]
Thermoelectric Transducers: Principles, Types, and Applications
Thermoelectric Transducers: Principles, Types, and Applications Introduction A temperature transducer is a device that converts a thermal quantity (temperature) into another physical quantity, such as mechanical energy, pressure, or an electrical signal, to allow for measurement or control. This conversion enables temperature to be easily monitored and utilised in various applications. A thermocouple is a […]
From Power Stations to Your Home: The Role of Transformers
From Power Stations to Your Home: The Role of Transformers Introduction Since their invention in the late 19th century, electromagnetic transformers have become a cornerstone of electrical power systems. Operating on Faraday’s law of electromagnetic induction, a transformer enables efficient energy transfer between circuits, typically to adjust voltage levels for generation, transmission, and utilization. Whether […]