Development of an algorithm
The first step in developing a control program is the definition of the control task. The control task specifies what needs to be done and is defined by those who are involved in the operation of the machine or process.

The second step in control program development is to determine a control strategy, the sequence of processing steps that must occur within a program to produce the desired output control. This is also known as the development of an algorithm.
A set of guidelines should be followed during program organization and implementation in order to develop an organized system. Approach guidelines apply to two major types of projects: new applications and modernizations of existing equipment.
Flow charting can be used to plan a program after a written description has been developed. A flowchart is a pictorial representation of the process that records, analyzes, and communicates information, as well as defines the sequence of the process.
Logic gates or contact symbology are used to implement the logic sequences in a control program. Inputs and outputs marked with an “X” on a logic gate diagram represent real I/O.
- The I/O assignment table documents the names, locations, and descriptions of the real inputs and outputs.
- The internal address assignment table records the locations and descriptions of internal outputs, registers, timers, counters, and MCRs.
- The register address assignment tablelists all of the available PLC registers.
Special cases of input device programming include the program translation of normally closed input devices, fenced MCR circuits, circuits that allow bidirectional power flow, instantaneous timer contacts, and complicated logic rungs.
- The programming of contacts as normally open or normally closed depends on how they are required to operate in the logic program. In most cases, if a normally closed input device is required to act as a normally closed input, its reference address is programmed as normally open.
- Master control relays turn ON and OFF power to certain logic rungs. In a PLC program, an END MCR instruction must be placed after the last rung an MCR will control.
- PLCs do not allow bidirectional power flow, so all PLC rungs must be programmed to operate only in a forward path.
- PLCs do not provide instantaneous contacts; therefore, an internal output must be used to trap a timer that requires these contacts.
- Complicated logic rungs should be isolated from the other rungs during programming.
The benefits of modernizing a relay control system include greater reliability, less energy consumption, less space utilization, and greater flexibility.
Example Of Simple Start/Stop Motor Circuit
Figure 1 shows the wiring diagram for a three-phase motor and its corresponding three-wire control circuit, where the auxiliary contacts of the starter seal the start push button. To convert this circuit into a PLC program, first determine which control devices will be part of the PLC I/O system; these are the circled items in Figure 2. In this circuit, the start and stop push buttons (inputs) and the starter coil (output) will be part of the PLC system.
The starter coil’s auxiliary contacts will not be part of the system because an internal will be used to seal the coil, resulting in less wiring and fewer connections.



Table 1 shows the I/O address assignment, which uses the same addressing scheme as the circuit diagram (i.e., inputs: addresses 000 and 001, output: address 030).
I/O Address | ||||
Module Type | Rack | Group | Terminal | Description |
Input | 0 | 0 | 0 | Stop PB (NC) |
0 | 0 | 1 | Start PB | |
0 | 0 | 2 | – | |
0 | 0 | 3 | – | |
Output | 0 | 3 | 0 | Motor M1 |
0 | 3 | 1 | – | |
0 | 3 | 2 | – | |
0 | 3 | 3 | – |
To program the PLC, the devices must be programmed in the same logic sequence as they are in the hardwired circuit (see Figure 3). Therefore, the stop push button will be programmed as an examine-ON instruction (a normally open PLC contact) in series with the start push button, which is also programmed as an examine-ON instruction.
This circuit will drive output 030, which controls the starter.

If the start push button is pressed, output 030 will turn ON, sealing the start push button and turning the motor ON through the starter. If the stop push button is pressed, the motor will turn OFF.
Note that the stop push button is wired as normally closed to the input module. Also, the starter coil’s overloads are wired in series with the coil.
Resource // Introduction to PLC Programming and Implementation—from relay logic to PLC logic
Am interested in learning plc programming,I have a vast exposure with the outside world of different plc only.thank.you
GOOD JOB SIR
THIS PORTAL IS VERY BEST. AND EASY TO UNDERSTAND .
THANK YOU SIR
this is very easy way to learn basic steps…good job sir.
Nice Blog..!! Thank you for sharing PLC SCADA Programming. At Sage Automation Also Provide the PLC SCADA and Automation Training and Placement in Thane.
sir you have fantastic work on this site. great job sir. i didn’t saw this type of site in my life. so thank you for your effort and sharing knowledge with us.
Thank you Nimesh, that’s very kind of you :)
sir,can you explain all process as a physically ?
i don’t understand that how it is work
Sir m mechanical engineer working in heat treatment where PLC is setup …I just want to know is this hv better scope in future….
Hello, can I connect a Siemens plc with a yaskawa cacr-sr30bf1amb servopack. if I can how to change the drive parameters
good morning sir, my name is dharmesh i am a electrical engineer i want learn about more plc programing so i need a suggestion from you.i hope so i get a good reply… thanking you sir
Hi Edvard,
Thanks for this articles.
Sir Edward , I’m grateful for the educative information.this is one field I want to spacialis in fact I’ve been looking for this for so so long. can you please help me get plc software and a simulator,
Sir I need to know more about PLC,please help me with some of the skills and ideas on how to go about writing PLC Programmes.
thanks
Great sir,its quite interesting.
I am looking for a job in plc programming can you support me.pls do mail me in following mail id
[email protected]
thank you..
Edvard sir you are the best. Thanks for information about PLC.
Great portal, simple and understandable posts.