PLC Programming
for Oil & Gas:
Complete Guide (2026)
Programmable Logic Controllers are the workhorses of oil and gas automation. Every wellhead, compressor station, separator, and tank battery that monitors and controls itself automatically does so because a PLC is executing control logic. This guide covers why PLCs are essential in oil and gas, which platforms are commonly used in the Permian Basin, what they control, and how they connect to SCADA systems - with real project costs for Texas operators.
Why PLCs Are Essential in Oil and Gas
Oil and gas operations involve dangerous materials, remote locations, and processes that must respond to changing conditions in milliseconds - faster than any human operator can react. A wellhead producing at high pressure cannot wait for a field hand to drive out and close a valve when pressure spikes. A gas compressor cannot tolerate bearing temperatures exceeding design limits even briefly without risking catastrophic failure.
PLCs solve these problems by executing control logic continuously - scanning their inputs (pressure transmitters, temperature sensors, flow meters, level probes), applying programmed logic, and updating their outputs (valve solenoids, motor starters, alarms) in real time. A modern CompactLogix scan cycle completes in less than 10 milliseconds, meaning the PLC is re-evaluating all process conditions 100 times per second.
Beyond safety, PLCs enable automation that was previously impossible or prohibitively expensive: automatic well restart after a fault condition clears, optimized separator dump valve control based on interface level, compressor speed modulation for efficiency - all running autonomously without operator intervention.
Most Common PLCs Used in Oil and Gas
Allen-Bradley ControlLogix and CompactLogix
Rockwell Automation's Allen-Bradley platforms are very common in North American oil and gas. CompactLogix handles most wellhead, tank battery, and small compressor applications; ControlLogix is used for large compressor stations and complex process facilities. Both are programmed with Studio 5000 (formerly RSLogix 5000). Allen-Bradley's wide adoption in Texas and the Permian Basin means a large pool of local integrators and good parts availability. For a deep dive, see our Allen-Bradley PLC programming guide.
Siemens S7-1200 and S7-1500
Siemens SIMATIC S7 PLCs are another platform frequently seen in oil and gas, often in midstream, refining, and international operations. The S7-1200 is cost-competitive for wellhead applications; the S7-1500 with its built-in OPC-UA server and safety functions is well-suited for larger installations and SIS applications. Both are programmed with TIA Portal. See our Siemens PLC programming guide for full details.
Other Controller Platforms
Additional controller platforms from other major automation vendors also appear in offshore, pipeline, and power-related oil and gas applications, typically supporting IEC 61131-3 languages and modular I/O. These are often chosen where the same vendor also supplies the drives and motors, so the integrated ecosystem simplifies commissioning.
Legacy Controller Platforms
Some legacy installations and midstream facilities standardized on controllers from other vendors in the 1990s and 2000s. The Modbus protocol itself originated with Modicon in 1979, so many of these controllers offer native Modbus RTU and TCP capability.
PLC Applications in Oil and Gas
Wellhead Control
Wellhead PLCs typically monitor tubing pressure, casing pressure, temperature, and flow rate. Safety logic includes high-high and low-low pressure shutdowns, low flow shutoffs for rod pump protection, and emergency shutdown valve (ESV) control. A standard wellhead PLC program for an oil well runs 200–600 rungs of ladder logic. Communication to SCADA via Modbus TCP or cellular RTU is standard, and wellhead monitoring software turns those same PLC tags into live dashboards and remote alarms.
Compressor Automation
Gas compressor control is the most complex PLC application in upstream oil and gas. Programs manage suction and discharge pressure, inter-stage pressures, inlet/outlet temperatures, vibration, lubrication oil pressure and temperature, coolant levels, anti-surge control, and emergency shutdown sequences. A complete compressor control program may have 2,000–5,000 rungs with multiple PID control loops and safety instrumented function blocks.
Separator Control
Three-phase oil/water/gas separators use PLC-controlled dump valves to maintain oil and water interface levels. The PLC reads level transmitters (typically guided wave radar or differential pressure), executes PID control loops for the oil dump valve and water dump valve, monitors inlet and outlet pressures, and provides high-level alarm and shutdown functions. Accurate level control directly impacts oil quality (BS&W) and water disposal compliance.
Tank Battery Management
Tank battery PLCs monitor crude oil storage tank levels via radar or float transmitters, control transfer pumps based on level setpoints, prevent tank overflow with high-high level shutdowns, and track daily production volumes. Integration with SCADA provides real-time lease automatic custody transfer (LACT) data and daily production reporting required by state regulators.
Pipeline Monitoring
Pipeline PLCs at mainline valve stations and pump/compressor stations monitor line pressure, flow rate, and valve position. Emergency block valve programs execute line shutdown sequences when pressure exceeds limits or flow rate indicates a potential leak. PLCs at pig launcher/receiver stations manage the automated pig launch and receive sequences safely.
Emergency Shutdown Systems
Emergency shutdown (ESD) and safety instrumented systems (SIS) use dedicated safety-rated PLCs (Allen-Bradley GuardLogix, Siemens S7-1500F) certified to IEC 61511. These systems operate independently of the process control PLC, monitoring safety-critical parameters and executing defined safe states - closing valves, stopping pumps, depressurizing equipment - when process conditions exceed safety limits.
PLC to SCADA Integration
A standalone PLC executes control logic and keeps a process running safely. But without SCADA integration, operators have no visibility into what the PLC is doing or how the process is trending over time. SCADA - Supervisory Control and Data Acquisition - provides the monitoring layer above the PLCs. For a full explanation of how SCADA systems work, see our how SCADA works guide.
How PLCs Talk to SCADA Systems
PLCs communicate with SCADA over industrial protocols. The SCADA system (or a gateway device) acts as the master, polling the PLC for data on a defined cycle (typically every 1–10 seconds). The PLC responds with current tag values - pressures, temperatures, levels, valve positions, alarm states. The SCADA system stores these values in a historian database, displays them on operator screens, and evaluates alarm conditions.
Protocols: Modbus, EtherNet/IP, OPC-UA
- Modbus TCP: The most universally supported protocol. Almost every PLC and SCADA platform speaks Modbus TCP. Register-based addressing (holding registers, input registers, coils). Limited to 16-bit integer and floating-point data types. Best for simple monitoring applications.
- EtherNet/IP: Rockwell's native protocol for Allen-Bradley PLCs. Provides direct tag access (no register mapping required), faster scan rates, and richer data types. Supported by most major SCADA platforms.
- OPC-UA: The modern industrial standard for secure, authenticated PLC communication. Supports structured data, browse capability, and encryption. Built into Siemens S7-1500 natively. Increasingly available on Allen-Bradley via companion products. Preferred for new installations connecting to cloud SCADA.
Cloud SCADA vs On-Premise
Traditional SCADA systems run on-premise servers at the facility - expensive to deploy ($50,000–$200,000), requiring dedicated IT infrastructure and maintenance. Cloud SCADA platforms like Merobix eliminate the on-premise server requirement. A small gateway device at each field site connects to the PLCs, transmits data to the cloud over cellular or Ethernet, and operators access dashboards from any browser. For a full comparison, see our cloud SCADA vs on-premise guide.
PLC Programming Costs in Texas
| Project Type | Typical Cost Range | Timeline |
|---|---|---|
| Simple wellhead monitoring | $5,000 – $15,000 | 1–2 weeks |
| Full wellhead automation | $15,000 – $40,000 | 2–4 weeks |
| Compressor control program | $20,000 – $60,000 | 3–8 weeks |
| Tank battery system | $10,000 – $30,000 | 2–4 weeks |
| Full installation (panel + PLC + SCADA) | $25,000 – $100,000 | 4–12 weeks |
| Legacy program modification | $2,000 – $15,000 | Days to 2 weeks |
What affects pricing: Number of I/O points, PLC hardware brand, site remoteness (travel time), complexity of control logic (simple monitoring vs. safety systems), existing infrastructure (new panel or reusing existing), and SCADA integration requirements.
Merobix PLC Programming Services
Merobix provides full-stack PLC programming and cloud SCADA integration for Texas oil and gas operators. Our oil and gas automation services include:
- Allen-Bradley PLC programming - CompactLogix and ControlLogix programs for wellheads, compressors, separators, and tank batteries using Studio 5000
- Siemens PLC programming - S7-1200 and S7-1500 programs using TIA Portal, including Modbus TCP configuration for cloud SCADA integration
- UL 508A control panel fabrication - Custom panels for oil and gas automation, Class 1 Division 2 rated for hazardous area installations
- Cloud SCADA integration - Connect any existing PLC to Merobix cloud SCADA for real-time monitoring, alarming, and production reporting
- Legacy program support - Modification and troubleshooting of existing Allen-Bradley and Siemens PLC programs
Texas-based service: Merobix serves Permian Basin, Eagle Ford, East Texas, and Mid-Continent operators. Our engineers are familiar with the specific challenges of Texas oil and gas automation - remote field locations, extreme temperatures, cellular connectivity requirements, and state production reporting requirements. Contact us at +1 (903) 307-7300 for a project discussion.
Frequently Asked Questions
What PLCs are most commonly used in oil and gas?
Allen-Bradley (Rockwell Automation) CompactLogix and ControlLogix are very common in North American oil and gas, and Siemens S7-1200 and S7-1500 are also frequently used. Controllers from other vendors appear in some legacy and international installations. For Texas and Permian Basin operations, Allen-Bradley is a common choice, supported by a large local integrator base.
How much does PLC programming for oil and gas cost?
Simple wellhead monitoring programs run $5,000–$15,000. Full wellhead automation programs with shutdowns and alarms run $15,000–$40,000. Compressor control programs run $20,000–$60,000. Full installations including panel fabrication, field wiring, PLC programming, and cloud SCADA integration typically run $25,000–$100,000 for a complete well pad or compressor station.
What is the difference between PLC programming and SCADA?
PLC programming is writing the control logic inside the Programmable Logic Controller - the ladder logic that controls field devices like valves and motors based on sensor inputs. SCADA is the supervisory layer above the PLCs that provides centralized monitoring, alarming, historical trending, and reporting. PLCs execute control locally; SCADA provides visibility and oversight from a central location or the cloud.
Does Merobix provide PLC programming services in Texas?
Yes. Merobix provides Allen-Bradley and Siemens PLC programming for oil and gas operators across Texas, including the Permian Basin, Eagle Ford, and East Texas. Services include new program development, legacy program modification, UL 508A panel fabrication, and cloud SCADA integration. Contact us at [email protected] or +1 (903) 307-7300 for a project quote.
Safety & engineering notice. This article is general educational information, not site-specific engineering, safety, or legal advice, and it does not reflect any particular facility. Standards and regulations (for example OSHA, API, IEC, ISO, NFPA, NIST, and NERC CIP requirements) change and vary by edition, jurisdiction, and application. SCADA and remote monitoring cannot verify physical isolation, atmosphere, lockout/tagout, permit status, or a safe go/no-go decision. Qualified personnel must perform site-specific engineering, hazard analysis, and safety review, and confirm current requirements with the authority having jurisdiction, before acting.
More in the Merobix Oil & Gas SCADA Use Cases.
Sources and verification
This page references the standards, specifications, and official documentation published by the organizations below. Editions, product capabilities, and documentation change over time - confirm current requirements and specifications directly with the source.
- UL 508A, Standard for Industrial Control Panels - UL Standards & Engagement (3rd ed., 2018)
- IEC 61511-1:2016, Functional safety - Safety instrumented systems for the process industry - International Electrotechnical Commission (2016)
- Modbus Application Protocol Specification - Modbus Organization
Merobix is not affiliated with, endorsed by, or sponsored by these organizations; their names are used only to identify the standards and products discussed.
Automation services
Need help turning this into a working system?
Merobix integrates SCADA, programs Allen-Bradley and Siemens PLCs, and designs and fabricates industrial control panels.
Meeting requests are reviewed before confirmation.