Industrial PLC Programming transforms machine operation requirements into organized control logic that reads sensors, verifies safety and operating conditions, and then issues commands to motors, valves, and other equipment at the right time. Programming a PLC for factories is not limited to writing a few lines of Ladder logic; a good program begins with understanding the process, proceeds through preparing an I/O List, sequence of operations, and alarms, and concludes with testing, documentation, and backups.
This guide explains the steps for programming a PLC for a new industrial project or upgrading an existing machine. It covers the most important programming languages, how to build Manual and Auto Modes, linking the PLC with HMIs, Inverters, and Servos, and FAT/SAT testing that reduces commissioning surprises. It also details the data a control engineer needs to evaluate the project and realistically determine the cost.
If you have a new production line, a machine that needs a Sequence modification, or an old program you want to upgrade, send the process description, signal list, and panel photos to the SUMER team for an initial review. You can also explore the Delta PLC units available for industrial projects.
What is Industrial PLC Programming?
Industrial PLC Programming is the process of analyzing, designing, developing, and testing the program of a Programmable Logic Controller (PLC) to manage a machine or an industrial process. The PLC reads digital and analog inputs, executes logic, timings, and calculations, and then updates outputs and exchanges data with other devices periodically and precisely.
The cycle of reading, executing, and updating is known as the Scan Cycle. Therefore, the logic must be clear and deterministic, handling state changes, faults, power recovery, and communication loss, not just normal operating conditions. The desired result is not merely a program that works during trials, but a system that is easy to operate, diagnose, modify, and maintain throughout the machine's lifespan.
What is the difference between programming a PLC and choosing a PLC device?
Choosing the device determines the hardware capabilities: the number and type of I/O points, program capacity, ports, protocols, and counting or pulse speed. Programming, on the other hand, determines how the system will utilize these capabilities to execute the process. If you are still in the hardware selection phase, refer to the guide on the types of PLC devices and how to choose the right type. If you need the complete electrical system designed, the PLC Panels guide explains panel components and design.
What data is required before programming a PLC for factories?
The largest part of a program's quality is decided before opening the PLC programming software. The clearer the requirements, the fewer late modifications will be needed, and the more accurate project testing will become. It is recommended to prepare the following documents:
1. Process Description and Sequence of Operation The process description explains what the machine does, while the Sequence of Operation defines the order of steps and transition conditions between them. It must detail start and stop states, the normal operating sequence, and what happens when Stop is pressed, a fault occurs, or power is lost and then restored.
2. I/O List (Inputs and Outputs) The I/O List includes the name, description, type, address, and source of each signal. You must differentiate between:
-
DI: Digital signals such as buttons, sensors, and fault states.
-
DO: Digital commands such as triggering a relay, valve, or indicator light.
-
AI: Analog measurements such as pressure, temperature, and level.
-
AO: Analog references such as a speed command or proportional valve opening.
-
High-speed I/O or Pulse: For counters, encoders, and appropriate motion applications.
A reasonable expansion margin should be left, but choosing a PLC based solely on point count is incorrect; signal speed, precision, memory, communications, and the operating environment are equally important factors.
3. Operating States and Interlocks Manual, Auto, and Setup/Maintenance modes must be defined when needed, specifying permissions for each mode. Additionally, Permissives and Interlocks must be clearly written: Is the tank level appropriate? Is air pressure available? Is the safety door closed? Is the drive ready? And what is the safe state of each output if one of these conditions is lost?
4. Alarms and Operator Messages Specifying the fault name is not enough. You must know its trigger condition, delay time (if any), whether it prevents starting or stops operation, the acknowledgment method (Reset or Acknowledge), and the data that helps maintenance technicians pinpoint the cause. A message like "Product failed to arrive within the specified time" is much more useful than just "Error 12."
5. Communication and Interface Requirements Specify connected devices, protocols, network addresses, exchanged data, and system behavior during communication loss. Also, define the required operation screens, user levels, Recipes, and data logging or integration with higher-level systems if within the project scope.
Important Note: A standard PLC or an HMI button should not be relied upon as a substitute for a proper safety system. Designing emergency stop circuits and functional safety begins with a machine risk assessment and is executed by a qualified engineering entity using appropriate architecture and components for the risk level.
What PLC programming languages are used in the industry?
There are several PLC programming languages, and language selection depends on the task type, controller/software capabilities, and maintenance team experience. Some of the most common languages are:
-
Ladder Diagram (LD):
-
When to use: Digital logic, sequencing, interlocks, and projects maintained by electrical technicians.
-
Practical notes: Easy to track when networks and comments are well-organized, but becomes confusing if the entire process is crammed into a single Network.
-
-
Function Block Diagram (FBD):
-
When to use: Control functions, repetitive blocks, and some process applications.
-
Practical notes: Good for showing signal flow, but a clear arrangement of blocks must be maintained.
-
-
Structured Text (ST):
-
When to use: Calculations, data processing, loops, and more complex algorithms.
-
Practical notes: Powerful and concise, but requires naming conventions, comments, and thorough review to be easily supported.
-
-
Sequential Function Chart (SFC):
-
When to use: Processes based on clear steps and transitions.
-
Practical notes: Makes the Sequence visual, provided the platform being used supports it.
-
There is no single best language for every project. An industrial program might combine Ladder logic for interlocks, Structured Text for calculations, and organized blocks for repetitive equipment. Available languages and their execution methods vary by PLC model and software version, so you must refer to the technical manual for the chosen platform.
Stages of Executing an Industrial PLC Program
Phase 1: Fixing Scope of Work and Functional Design Requirements, schematics, and the I/O list are reviewed, then the Sequence of Operation is converted into clear operating states. At this stage, boundaries of responsibility are defined: Who programs the HMI? Who tunes the VFD or Servo? Does the service include on-site commissioning? What are the project acceptance conditions?
Phase 2: Building the Program Structure The program is divided into understandable parts rather than placing all logic into a single routine. Examples of division: reading and conditioning signals, operating modes, equipment, Sequence, alarms, communication, and HMI data. A consistent system is used for Tag names, addresses, and comments, separating commands from actual feedback.
Phase 3: I/O Mapping and Signal Processing Physical addresses are linked to understandable names, and Normally Open/Normally Closed states are handled correctly. Analog signals require Scaling from raw values to engineering units (e.g., bar or °C), and may need deliberate filtering and limits to detect signal loss or out-of-range conditions.
Phase 4: Manual and Auto Modes Manual mode allows testing or moving equipment within authorized limits but does not bypass safety conditions. Auto mode executes the full sequence. System transitions between modes must be defined, conflicting commands prevented, and the active mode clearly displayed to the operator.
Phase 5: Writing the Sequence and Interlocks It is preferred to represent the sequence as specific Steps or states, with entry conditions, commands, transition conditions, and an appropriate Timeout for each step. This approach makes tracking a stoppage easier than scattering Sequence parts in different locations. Start permissive conditions are separated from run-time stop conditions and resulting alarms.
Phase 6: Communication and Integration The map of data exchanged with each device, update rates, and handling of invalid values are defined. The program must handle Communication Timeouts and must not continue using an old value as valid if it affects the process.
Phase 7: Review, Testing, and Documentation After completing PLC ladder logic programming or other languages, normal and abnormal states are reviewed, and I/O, sequences, and alarms are tested. The approved version is delivered with a backup, comments, a change log, and relevant operating documents.
A Simplified PLC Programming Example for a Conveyor Machine
This example illustrates how to think about the program, and is not a ready-to-wire code or a substitute for risk assessment and schematics. Suppose a conveyor moves a package to a processing station, stops at an arrival sensor, and then resumes after processing is complete.
-
Inputs:
-
Examples: Start, Stop, Safety Healthy, arrival sensor, Motor Feedback, Overload.
-
Logic Function: Determines operation request, permissive state, product arrival, and command execution health.
-
-
Outputs:
-
Examples: Conveyor Run, Station Command, Alarm Lamp.
-
Logic Function: Runs the conveyor, starts processing, and displays fault status.
-
-
States:
-
Examples: Idle, Conveying, Processing, Complete, Fault.
-
Logic Function: Organizes the sequence and prevents conflicting steps from executing.
-
-
Timeouts:
-
Examples: Max time for package arrival or processing completion.
-
Logic Function: Detects sensor or mechanical failure instead of waiting indefinitely.
-
Sequence flow:
-
The system moves from Idle to Conveying when there is a Start request and permissive conditions are met.
-
The PLC turns on the conveyor and checks for Motor Feedback within a specified time.
-
When the package is detected, the conveyor stops, and the Processing step begins.
-
After receiving a valid completion signal, the system moves to Complete, then starts a new cycle or returns to Idle based on requirements.
-
If an Overload occurs, the package doesn't arrive, or a critical condition is lost, the system goes to Fault, and a message detailing the cause appears.
The advantage of this structure is that operators and maintenance technicians can identify the current step and the missing condition. Repetitive parts can be converted into Function Blocks, testing each Block before reusing it.
Linking the PLC with HMIs, Inverters, and Servos
Linking PLC with HMI The PLC determines the available states, commands, and values, while the HMI displays information and receives authorized operator inputs. Tag names should be unified, data types and addresses set, a Handshake established for commands requiring confirmation, and unauthorized changes prevented. Read the guide on programming HMI screens and linking them with PLCs, or the HMI Screen selection guide for factories if you are currently selecting the screen.
Linking PLC with VFD The PLC may send Run commands, direction, and speed to the inverter, and receive Ready, Running, Fault, and actual value feedback. Linking can be done via I/O signals, Analog, or a communication protocol, depending on device capabilities and project requirements. Review available VFD devices, and do not rely on an address or communication setting before verifying it in the manual of the actual model and version.
Linking PLC with Servo Drive Motion control architecture varies based on precision, speed, and the control method supported by the platform, such as Pulse/Direction or appropriate motion networks. Mechanics must be calculated, and the motor, drive, and command source selected before programming. The Servo Motor Drive article explains system basics and selection criteria.
Examples of Delta PLC Units
Unit selection depends on the application. For example, SUMER offers the Delta DVP32ES200T with 32 built-in I/O points (16 inputs and 16 Transistor outputs), alongside communication ports and pulse features detailed on the product page. Delta DVP12SE11R is also available, offering 12 built-in I/O points and Ethernet connectivity according to the page specifications. These are examples, not automatic recommendations; review the Datasheet, product version, signal count, and protocols before approving any model.
Best Practices for Industrial PLC Programming
-
Use clear names: A name like
Conveyor_Readyis better than vague addresses that are hard to track. -
Write useful comments: Explain the reasoning behind logic and important assumptions; don't just repeat the instruction name.
-
Separate request from result: Don't consider sending a Run command as proof the motor is turning; use appropriate Feedback when necessary.
-
Define safe states for outputs: Review how each output behaves during a Stop, fault, communication loss, and power recovery.
-
Avoid Magic Numbers: Use constants or named Tags for units, limits, and timings.
-
Use First Scan carefully: Initialize required states without triggering unexpected operations or erasing data that should be retained.
-
Check limits: Prevent out-of-range Setpoint entries and define modification permissions.
-
Organize alarms: Give each alarm a condition, priority, message, and clear Reset procedure; avoid a Flood of messages derived from a single root cause.
-
Document versions: Keep a Version number, date, change description, and the name of the person who approved it.
-
Create retrievable Backups: Test opening the backup, and save files, libraries, programming software version, and passwords according to facility policy.
-
Don't leave Forces active: Review Forced I/O and Bypasses before handover, and document any temporary exceptions.
-
Test failure modes: A stuck sensor, overload, communication loss, power cycle, and timeouts are more important to test than just the Start button.
How is a PLC program tested?
Organized testing is the difference between a program that "seems right" and one fit for industrial operation. It starts with Offline review or Simulation (where the platform allows), followed by I/O Check, then FAT before shipping or commissioning, and finally SAT on-site.
FAT Checklist for PLC Programs
-
I/O: Address correctness, signal type, direction, engineering units, and circuit state upon disconnection.
-
Manual Mode: Each command individually, movement limits, prevention of conflicting commands, and continuity of safety conditions.
-
Auto Sequence: Every step and transition, cycle repetition, orderly stopping, and resuming operation per approved requirements.
-
Interlocks: Refusing to start upon a lost condition, and correct response if a condition is lost during operation.
-
Alarms: Trigger condition, message, timing, priority, Reset method, and ensuring the root cause doesn't hide behind subsequent alarms.
-
Communications: Data validity, Timeouts, recovery upon reconnection, and preventing unsafe use of stale data.
-
Power Cycle: State of the PLC, outputs, current step, and retained data after power off and on.
-
Documentation: Program alignment with the I/O List, HMI, schematics, alarm list, and the approved version.
SAT verifies system performance after installation under real site conditions, including field devices, communications, production speed, and product quality, according to pre-agreed acceptance criteria. Fault testing or safety overrides should only be performed under safe procedures and qualified supervision.
Upgrading an Old PLC Program or Migrating to a New PLC
A Retrofit requires more than just replacing addresses. The process starts with attempting to obtain an uploadable Source, passwords, libraries, and the software version used, followed by documenting the actual I/O, communications, and machine sequence. If no Source is available, functions may need reverse engineering based on schematics, observation, and tests; a non-existent logic cannot be guaranteed recovery simply by possessing the old PLC unit.
-
Save a backup of the current program and parameters before any changes.
-
Document addresses, devices, protocols, and actual behavior.
-
Identify differences between the old and new platforms regarding instructions, memory, timing, and communications.
-
Build a conversion and testing plan, along with a Rollback plan if commissioning fails within the allotted time window.
-
Execute changes in phases when production allows, updating schematics, HMI, and the final project copy.
If the upgrade includes the panel, 24V source, and surrounding components, review the 24V Power Supply selection guide and PLC panels guide before finalizing the scope of execution.
Common Mistakes in PLC Programming
-
Starting to write code before approving the Sequence of Operation and I/O List.
-
Placing all logic into a single routine without structure, names, or comments.
-
Allowing Manual mode to bypass critical conditions without clear assessment or permissions.
-
Using a fixed Delay instead of actual machine Feedback in a critical step.
-
Creating a Sequence without Timeouts, leaving the machine stuck if a signal fails to arrive.
-
Writing to the same output from multiple places, making its state hard to track.
-
Neglecting analog Scaling, limits, and wire-break states.
-
Failing to define system behavior upon losing the HMI, VFD, or Remote I/O.
-
Editing the program online without a Backup, Change Log, or testing the modification's impact.
-
Handing over a machine without documented Source Code or a clear Recovery copy included in the agreement.
What factors determine the cost and duration of PLC programming?
There is no single price for all industrial PLC programming projects because programming a simple machine differs entirely from a multi-station, multi-axis line. Cost and duration are affected by:
-
Number of DI, DO, AI, AO points and high-speed signals.
-
Number of machines, stations, modes, and operating sequences.
-
PLC type and availability of programming software, libraries, and original licenses.
-
Number of HMI screens, pages, alarms, recipes, and user levels.
-
Integration with VFDs, Servos, measuring devices, Remote I/O, and other systems.
-
Need for Data Logging, reports, or network integration.
-
Condition of the panel, schematics, and wiring in upgrade projects.
-
Scope of FAT, SAT, on-site commissioning, training, documentation, and post-delivery support.
-
Production downtime window, travel, and site conditions.
To get an accurate quote, the request must be translated into a measurable scope and clear acceptance criteria. A low-price quote based on a generic description often turns into modifications and delays, whereas prior technical evaluation reveals undefined points before execution begins.
Request PLC Programming or Machine Upgrade Service from SUMER
SUMER helps factories and machine builders study control applications, choose the appropriate Delta PLC, program operating logic, link HMIs and drives, and test the system according to the project scope. To speed up the evaluation, send the following information:
-
A brief description of the machine, product, and required production rate.
-
Sequence of Operation or a video of the current operating cycle (if permitted).
-
I/O List or electrical schematics, clear panel photos, and component data.
-
Models and versions of the PLC, HMI, and drives if it's an existing machine.
-
The current issue or requested modifications, and available downtime.
-
Project location and requested service scope: programming only, panel, commissioning, or full upgrade.
Contact SUMER now and send your application data to get an initial review and next-step recommendation instead of picking a device or starting programming without clear requirements.
The success of Industrial PLC Programming is not measured by the number of Networks or typing speed in Ladder; it's measured by the program's ability to execute the process consistently, reject unauthorized operation, diagnose faults clearly, handle abnormal states, and deliver a documented, maintainable version. Start with clear requirements, an approved I/O List and Sequence, choose a PLC based on signals, communications, and performance, and then test the system via FAT and SAT before clearing it for production.
Do you have a new machine or an old PLC needing an upgrade? Send your project data to SUMER to review the application and determine the appropriate solution, from programming and integration to PLCs, HMIs, and drives.