Siemens PLC Programming Guide

SCL vs Ladder Logic in TIA Portal: Siemens PLC Programming Guide

Should you program a Siemens PLC in visual Ladder Logic or text-based SCL? Compare readability, troubleshooting, complex calculations, sequences, reuse and maintenance before selecting the right language for each block.

Beginner to Intermediate11 min readSiemens TIA PortalS7-1200 / S7-1500

What’s covered

  1. The fundamental difference
  2. How Ladder Logic works
  3. How SCL/ST works
  4. Side-by-side comparison
  5. Equivalent programming examples
  6. Which language should you select?
  7. Using LAD and SCL together
  8. TIA Portal practice lab

SCL/ST vs Ladder Logic: the fundamental difference

Ladder Logic (LAD) is a graphical PLC language based on electrical circuit diagrams. Contacts, coils, branches and instruction boxes form networks that show Boolean power flow. SCL, Siemens Structured Control Language, is a text-based high-level language aligned with the Structured Text language family defined by IEC 61131-3.

LAD

Visual and electrical

Excellent for discrete control, permissives, interlocks and online troubleshooting by technicians.

VS
SCL / ST

Textual and algorithmic

Excellent for calculations, loops, arrays, data processing, recipes and state-based algorithms.

Important: this is rarely an all-or-nothing decision. TIA Portal projects can contain blocks written in different supported languages. Select the best language for each block and maintain a clear interface between them.

What is Ladder Logic?

LAD represents a control circuit as networks or rungs. Conditions appear as contacts, actions appear as coils or boxes, and branches represent parallel logic. Its visual resemblance to relay control makes machine interlocks easy to follow.

Where Ladder Logic is strongest

  • Start/stop circuits and seal-in logic.
  • Motor, pump, valve and solenoid commands.
  • Safety-related standard permissives and machine interlocks.
  • Timers, counters and simple step logic.
  • Plant maintenance where electricians monitor status online.

Where Ladder becomes difficult

Large mathematical expressions, many array elements, string manipulation, data searches and deeply nested decisions can spread across many networks. The visual code remains valid but may be slower to write, review and modify.

What is SCL or Structured Text?

SCL uses assignments, expressions and structured statements such as IF…THEN…ELSE, CASE, FOR and WHILE. It is well suited to algorithms that would require many LAD instruction boxes and branches.

Where SCL is strongest

  • Analogue scaling and complex formulas.
  • Loops through arrays, recipes or device structures.
  • Sorting, searching, statistics and production calculations.
  • State machines using a readable CASE statement.
  • Data conversion, validation and communication handling.

Where SCL needs care

Text can be less intuitive for personnel trained only on electrical schematics. A loop can also execute many operations in one PLC scan, so loop limits, array bounds and execution time must be designed deliberately. Clear names and comments matter more than compact code.

Detailed SCL/ST vs Ladder Logic comparison

CriterionLadder Logic (LAD)SCL / Structured Text
RepresentationGraphical contacts, coils, branches and boxesText statements and expressions
Learning approachFamiliar to electricians and relay-logic usersFamiliar to programmers and algorithm designers
Discrete Boolean logicVery clear and easy to monitorConcise, but long Boolean expressions need formatting
MathematicsPossible with multiple boxes and intermediate tagsNatural expression syntax; usually more compact
Arrays and loopsRepetitive or dependent on specialised instructionsFOR/WHILE loops provide direct iteration
SequencesClear for small sequences; may expand across many networksCASE-based state machines scale well
Online troubleshootingPower flow is highly visualValues can be monitored, though execution is less circuit-like
Code reviewVisual review is intuitive but large networks are wideCompact text is convenient for detailed algorithm review
Best audienceOperators, technicians, electricians and controls engineersControls/software engineers and advanced programmers
Typical choiceMachine control, interlocks and commandsData processing, calculations and complex logic

Same control requirement in LAD and SCL

Both languages can solve the same Boolean task. The difference is how the engineer and maintenance team read it.

Example 1: motor run command

Ladder-style representation

|--Start--Permissive--/Fault--RunCmd--|

SCL representation

#RunCmd := #Start
          AND #Permissive
          AND NOT #Fault;

Example 2: calculate the average of ten samples

Ladder approach

ADD sample[0] + sample[1]
ADD result + sample[2]
...repeat for all samples...
DIV total / 10.0

SCL approach

#Total := 0.0;
FOR #i := 0 TO 9 DO
    #Total := #Total + #Sample[#i];
END_FOR;
#Average := #Total / 10.0;

The motor permissive is immediately visual in LAD. The array calculation is shorter and easier to expand in SCL. Neither language is universally superior; suitability depends on the problem.

Which language should you select?

Choose LAD when
  • The logic is mainly Boolean and discrete.
  • Maintenance technicians require fast visual diagnosis.
  • Contacts, interlocks and output commands dominate.
  • The plant standard specifies Ladder.
  • A simple network communicates intent best.
Choose SCL when
  • The logic contains formulas or many comparisons.
  • You must process arrays or structured data.
  • Loops remove repeated code safely.
  • A CASE state machine improves the sequence.
  • Compact, algorithmic code is easier to maintain.

Selection rule: optimise for lifetime maintainability—not the fewest lines today. Consider who will commission, troubleshoot and modify the machine five years from now.

Best practice: use LAD and SCL together

A strong Siemens project often uses a hybrid architecture:

  • LAD: top-level equipment calls, start/stop logic, permissives, interlocks and clear actuator commands.
  • SCL: scaling, recipe handling, array processing, communications, calculations and larger state machines.
  • Block interfaces: typed Input, Output and InOut parameters keep language boundaries clean.

For example, OB1 may call an equipment FB written in LAD, which calls an SCL FC for performance calculations. TIA Portal compiles the blocks for the CPU; the team still sees each block in the language selected when it was created.

Engineering standards that help

  • Use descriptive symbolic names and consistent prefixes.
  • Keep Boolean expressions formatted and commented in SCL.
  • Limit LAD networks to one clearly named purpose.
  • Bound every loop and validate array indices.
  • Agree which language owns sequences, calculations and interlocks.
  • Do not change languages merely to demonstrate cleverness.

Step-by-step TIA Portal comparison lab

  1. Create a Siemens PLC project.
    Add an S7-1200 or S7-1500 CPU suitable for your training setup.
  2. Create FC_MotorPermissive in LAD.
    Use contacts for AutoMode, SafetyHealthy, ProcessReady and NOT Fault, ending with a Permissive output.
  3. Create FC_MotorPermissive_SCL.
    Create the same interface and write the equivalent Boolean assignment in SCL.
  4. Create FC_Average in SCL.
    Pass an array of sample values, iterate with a bounded FOR loop and return the average.
  5. Call the blocks from OB1.
    Map identical test tags to both permissive FCs and compare their results.
  6. Compile and simulate.
    Use PLCSIM where appropriate or a training PLC. Toggle inputs and monitor both implementations.
  7. Review as a maintenance team.
    Decide which format is clearest for the permissive and which is clearest for the calculation.

Frequently asked questions

Is Siemens SCL the same as Structured Text?

SCL is Siemens’ Structured Control Language for SIMATIC programming. It follows the Structured Text family defined by IEC 61131-3, while Siemens provides its own editor, syntax details and instruction support.

Is SCL faster than Ladder Logic?

Language choice alone does not guarantee faster PLC execution. Algorithm design, instruction selection, loop count, data access and CPU type matter. Measure cycle time when performance is critical.

Can LAD and SCL be used in the same TIA Portal project?

Yes. A project can contain different blocks written in supported languages. A LAD block can call an SCL block through its normal interface and vice versa.

Which language is better for beginners?

LAD is often easier for learners with electrical backgrounds. SCL may feel more natural to people with programming experience. PLC engineers benefit from learning both.

Which language is best for sequences?

LAD works well for small, visual step sequences. For larger state machines, an SCL CASE structure is often more compact and scalable. Plant standards and troubleshooting needs still matter.

Should all complex logic be written in SCL?

No. Complexity alone is not enough. Choose the form that best communicates the logic and remains maintainable for the responsible team.

Official Siemens references

Language descriptions were checked against the Siemens STEP 7 documentation: LAD programming language, Programming language SCL, and the supported programming languages overview. Available instructions can depend on CPU and TIA Portal version.

Learn LAD and SCL with practical PLC projects

Develop structured Siemens S7-1200 and S7-1500 programs in TIA Portal.

Siemens PLC & TIA Portal Learning Path

Continue with the related Siemens PLC tutorials in this practical learning series.

  1. SCL vs Ladder Logic
  2. Upload PLC Program
  3. TIA Selection Tool
  4. Analog Input Scaling
  5. PLC Counters
  6. PLC Timers
  7. Addressing & Data Types
  8. Hardware & PLC Tags
  9. OB, FB, FC & DB