PLC program is the control logic that is stored inside the PLC memory to perform the predefined actions to control the system.

The above image shows how PLC control system is interacting with field/system with help of IO modules and PLC Program.
Following are the important parts of the typical PLC program,
- Hardware Configuration – It gives the details of IO modules and their corresponding linked signals to PLC Program.
- Tag or Variable Table or Data Blocks – This is a memory table contains all the variables or tags used in the PLC program. Tags are used to reference the IO signals & Local memory points ( for calculation purposes within the PLC itself). So PLC program can access all the signals by its memory reference or Tag name.
- Program or Task – It defines how PLC is going to study and control the field/system.
In summary, the PLC Program helps the PLC Control system to understand Which types of the system they are handling and What action to be taken on it.
In the following part, we are going to see Ladder logic programming. We choose this type of programming because it is easy to compare with the conventional electrical wiring diagram.
Refer the following example, it uses simple lamp control using On/Off Switch.

Left Side – Shows the Ladder Logic to ON/OFF Lamp, inside the PLC Programming software.
CH – Channels in the Modules, used to connect the I/O devices
How PLC works ?
Step-1: When switch(Digital Input) ON, +24 Vdc pass through the switch to specific CHn (Channel) in the DI module.

Step-2: +24 Vdc at CHn in the DI module makes I1.0 memory in the PLC to ON state. Hardware Configuration defines that CHn corresponds to the I1.0 memory address.

How I1.0 is enable when CHn activated in DI Module ?
- This is managed by hardware configuration in the PLC programming software.
- Hardware configuration – we need to provide the Model of the CPU (Controller), IO modules, Interfacing modules etc., also we need to allocate the exact location of the modules as in actual panel.
- In the above example, the CPU is at slot-0, DI module is at slot-1, and the DO module is at slot-2.
- Here Switch is connected to the DI module which is in slot 1 and First Channel so the memory address I1.0 automatically assigned by the PLC by using Hardware configuration.
- So depends on the Slot and Channel numbers in the Hardware configuration PLC assigns its addresses. For example, I1.1 or I2.3.
- This memory allocation is managed by the PLC programming and this addressing philosophy depends upon the PLC manufacturers. Some manufacturer uses “I” some uses “%I” some directly uses memory tag table for reference.
Step-3: Once the memory I1.0 (Tag – Switch) becomes ON, the memory Q1.0 (Lamp tag) becomes ON, this action/control is controlled by the PLC program (ladder logic) which is loaded inside the PLC memory.

Step-4: Q1.0 ON state generates 24Vdc between CHn+ & CHn- in the DO module. This CHn channel referenced to Q1.0 by Hardware configuration in the PLC Programming.

Step-5: CHn+ and CHn- connected to the Lamp. So whenever we makes Q1.0 ON in the PLC this will ON the Lamps.

Note: Type of Signals & Their Data types are vital while making the PLC Program. Click here for more details.

Leave a Reply