PLC Programming • Siemens

Siemens PLC Programming:
Complete Guide
for Industrial Operations (2026)

Merobix Engineering • • 13 min read

Siemens S7 PLCs are among the most widely deployed industrial controllers in the world, with a strong presence in European-influenced oil and gas, chemical, and power generation facilities. This guide covers the S7 hardware families, TIA Portal programming software, available programming languages, SCADA integration methods, and a practical comparison of Siemens versus Allen-Bradley for Texas oil and gas operators.

Back to Blog

What Is Siemens PLC?

Siemens is a German multinational corporation and a global manufacturer of industrial automation equipment. The Siemens SIMATIC PLC product line has been in production since 1958 and is widely used in Europe and in North American petrochemical, power, and manufacturing operations. The S7 designation refers to the SIMATIC S7 family - the seventh-generation SIMATIC PLC hardware.

In oil and gas, Siemens PLCs are commonly found in facilities with European engineering influence, refinery operations, offshore platforms, and LNG terminals. Within Texas and the Permian Basin, Siemens PLCs appear frequently in larger gas processing and treating facilities, pipeline compression stations, and midstream operations that standardized on Siemens equipment at the enterprise level.

S7 Family Overview: S7-1200 vs S7-1500 vs S7-300/400

Siemens currently produces three primary PLC families relevant to oil and gas:

1958 SIMATIC PLC launched
#1 PLC brand in Europe
40%+ Global industrial PLC share

When to Choose Siemens vs Allen-Bradley

For greenfield oil and gas projects in Texas, the choice between Siemens and Allen-Bradley typically comes down to three factors: the engineering firm's standard (many use Allen-Bradley by default), existing site standardization, and supply chain considerations. See our full Allen-Bradley PLC programming guide for the Allen-Bradley perspective, and the comparison section at the bottom of this article.

Siemens Programming Software

TIA Portal (Current Standard - V17/V18/V19)

Totally Integrated Automation Portal is Siemens' unified engineering software that integrates PLC programming, HMI configuration, drive parameterization, and safety logic in a single platform. TIA Portal V19 is the current release as of 2026. It replaced the older STEP 7 Classic environment for new S7-1200 and S7-1500 projects.

TIA Portal licenses come in three tiers:

STEP 7 Classic (Legacy S7-300/400)

STEP 7 Classic (also known as SIMATIC Manager or S7 Classic) is the older programming environment for S7-300 and S7-400 PLCs. It uses a different project structure and file format than TIA Portal - the two are not directly compatible. If you maintain legacy S7-300 installations, you need STEP 7 Classic V5.7 (the final supported version). Siemens provides a migration wizard to convert STEP 7 Classic projects to TIA Portal format when upgrading hardware.

Programming Languages in TIA Portal

TIA Portal supports all five IEC 61131-3 programming languages plus Siemens Graph (Sequential Function Chart for sequence control). The three most relevant for oil and gas are:

Ladder Diagram (LAD)

Ladder logic is the most widely used language for oil and gas PLC programming, including on Siemens hardware. The syntax is similar to Allen-Bradley ladder logic - contacts, coils, timers, counters - but with Siemens-specific instruction names. For example, Allen-Bradley's TON is equivalent to Siemens' TP (Pulse Timer) or TON - Siemens uses IEC standard timer function blocks. For a comprehensive introduction to ladder logic programming, see our ladder logic guide.

Function Block Diagram (FBD)

FBD uses graphical blocks connected by signal lines rather than the ladder-and-rung metaphor. It is well-suited for process control applications - PID loops, analog signal processing, and complex valve sequencing. Many Siemens-trained engineers prefer FBD for continuous process control applications in oil and gas because it more naturally represents the flow of analog signals through a process.

Structured Text (ST)

Structured Text is a high-level text-based language similar to Pascal or C. It is efficient for mathematical calculations, complex data manipulations, and algorithms. In oil and gas, ST is used for flow computer calculations, gas composition processing, and custom alarm logic that would be verbose in LAD or FBD. S7-1500's SCL (Structured Control Language) is Siemens' implementation of ST.

Which Language for Oil and Gas?

For most wellhead and compressor control applications: use LAD for safety and shutdown logic (easiest for operators to review), FBD for PID control loops and analog processing, and ST for calculations. This mixed-language approach within a single TIA Portal project is common practice.

Siemens S7 Protocol and SCADA Integration

S7 Communication Protocol

The S7 protocol (also called ISO-TSAP or S7comm) is Siemens' native PLC communication protocol over TCP/IP port 102. It allows read/write access to PLC data blocks, bit memory, I/O, and timer/counter values using the PLC's native addressing. Many SCADA platforms and third-party OPC servers have native S7 drivers.

OPC-UA Integration with Siemens

The S7-1500 has an integrated OPC-UA server that requires no external software or gateway - you enable it in TIA Portal, configure the server interface, and SCADA clients connect directly. The S7-1200 supports OPC-UA from firmware V4.4 onwards. OPC-UA is the recommended modern integration standard for new installations, providing secure, authenticated communication with structured data and browse capability. For SCADA integration details, see our PLC programming for oil and gas guide.

Modbus TCP on Siemens

S7-1200 and S7-1500 PLCs support Modbus TCP through software function blocks - specifically the MB_SERVER (Modbus slave) function block that exposes a Modbus register map to external Modbus master devices. This is the integration path Merobix uses for Siemens PLCs: the MB_SERVER block is configured to expose selected data block variables as Modbus holding registers, and the Merobix gateway reads those registers via Modbus TCP. No hardware modifications are required - just a few function blocks added to the existing PLC program.

Connecting Siemens to Merobix Cloud SCADA

Merobix connects to Siemens S7-1200 and S7-1500 PLCs using either the S7 protocol or Modbus TCP via a local gateway device. The gateway is installed at the field site, connects to the Siemens PLC over Ethernet, reads configured tags, and transmits data to the Merobix cloud. Configuration takes under an hour for a standard wellhead or compressor application. Visit our Siemens PLC programming services for integration options.

Common Siemens Applications in Oil & Gas

Gas Compression Control

Siemens S7-1500 PLCs are deployed on gas compressor units in midstream and upstream applications. TIA Portal's integrated motion control and PID capabilities make the S7-1500 well-suited for anti-surge control, speed regulation, and multi-stage compressor sequencing. The F-CPU variants (S7-1500F) are used for safety instrumented functions - emergency shutdown systems that meet IEC 61511 requirements.

Valve Automation

S7-1200 PLCs are frequently used for partial stroke testing and automated positioning of pipeline valves. The PLC monitors valve position feedback, executes partial stroke tests per API 6D requirements, and reports test results and valve status to the SCADA system. TIA Portal's built-in valve control function blocks simplify program development for standard valve types.

Flow Measurement

Siemens offers integrated flow measurement solutions combining S7 PLCs with SITRANS flow transmitters and SCADA software. In larger measurement facilities (custody transfer meters, allocation metering stations), the S7-1500 handles AGA/API flow calculations, uncertainty analysis, and electronic chart recorder functions.

Safety Instrumented Systems

Siemens F-CPU variants (SIMATIC S7-1500F, S7-300F) are certified to IEC 61508 and IEC 61511 for safety instrumented systems. TIA Portal Safety programming uses a restricted subset of LAD and FBD instructions verified by the software's built-in safety compiler. In oil and gas, Siemens SIS solutions are deployed for high-integrity pressure protection systems (HIPPS), emergency shutdown systems (ESD), and fire and gas detection logic.

Process Control Loops

The S7-1500's PID_Compact and PID_3Step function blocks provide auto-tuning capability for pressure, level, temperature, and flow control loops. In separator control, PID loops manage dump valve position for oil/water interface level, back-pressure control valve position for gas outlet pressure, and feed flow control for inlet choke position.

Siemens vs Allen-Bradley for Oil & Gas

Factor Siemens S7 Allen-Bradley
Programming Software TIA Portal (subscription or one-time) Studio 5000 (subscription, ~$3k/yr)
Hardware Cost (compact) S7-1200: $300–$800 CPU CompactLogix: $800–$2,000 CPU
Native Protocol S7comm, Profinet, OPC-UA EtherNet/IP, CIP
OPC-UA Support Built-in on S7-1500, S7-1200 V4.4+ Requires add-on module or gateway
Parts availability (Texas) Good - major distributors stocked Excellent - dominant market presence
Local integrators Available but fewer than AB Abundant - most Texas integrators
Best for small operators Cost-effective at entry level Larger installer base, easier support

Bottom line for Texas operators: Both platforms are excellent choices. Allen-Bradley has a larger integrator base in Texas, making support easier to find. Siemens has a cost advantage at the entry level (S7-1200 vs CompactLogix) and superior built-in OPC-UA on the S7-1500. For sites that already have one platform installed, standardize on what you have. For greenfield installations, both work equally well with Merobix cloud SCADA.

Frequently Asked Questions

What is TIA Portal?

TIA Portal (Totally Integrated Automation Portal) is Siemens' unified engineering software for programming S7-1200 and S7-1500 PLCs, configuring HMI panels, and managing drives. It supports Ladder Diagram, Function Block Diagram, Structured Text, and Sequential Function Chart. Current versions include V17, V18, and V19. It replaces the older STEP 7 Classic software used for S7-300/400 PLCs.

How do I connect Siemens PLC to SCADA?

Siemens PLCs connect to SCADA using the S7 protocol (native, TCP port 102), OPC-UA (built into S7-1500), or Modbus TCP (via MB_SERVER function blocks). Cloud SCADA platforms like Merobix connect through a local gateway device that communicates with the Siemens PLC over Ethernet, requiring no changes to existing PLC hardware.

S7-1200 vs S7-1500: which should I choose?

For wellhead monitoring, valve control, and simple compressor applications, the S7-1200 provides sufficient capability at lower cost ($300–$800 CPU vs $1,500–$6,000). Choose the S7-1500 for complex compressor control, safety instrumented functions, motion control, or applications requiring built-in OPC-UA server capability. Both are programmed with TIA Portal.

Does Merobix work with Siemens PLCs?

Yes. Merobix cloud SCADA connects to Siemens S7-1200 and S7-1500 PLCs using Modbus TCP or the S7 protocol through a local gateway device. No changes to the existing Siemens PLC program are required for standard monitoring applications. Contact us at [email protected] to discuss your specific Siemens installation.

Electrical & field-work safety. The steps below can involve working on or near industrial control equipment that may be energized and located in classified (hazardous) areas. This work must be carried out only by qualified personnel and requires site-specific engineering and hazard analysis. Before wiring, tapping a serial or Ethernet port, or opening a panel: de-energize and apply lockout/tagout, verify absence of voltage, account for stored energy, and wear appropriate arc-flash PPE in accordance with NFPA 70E and your site electrical-safety program. Confirm the area classification and use wiring methods listed for hazardous (classified) locations. Always follow the equipment manufacturer manual and your facility written procedures, which take precedence over this general educational guidance.

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 Automation Fundamentals.

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.

Merobix is not affiliated with, endorsed by, or sponsored by these organizations; their names are used only to identify the standards and products discussed.

Free SCADA operator training
Merobix University - 70 video lessons & 261 quiz questions, from first login to compliance reporting. No demo call required.
Start free →