Inst ToolsInst ToolsInst Tools
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Search
  • Books
  • Software
  • Projects
  • Process
  • Tools
  • Basics
  • Formula
  • Power Plant
  • Root Cause Analysis
  • Electrical Basics
  • Animation
  • Standards
  • 4-20 mA Course
  • Siemens PLC Course
Reading: How to Start Writing SCL Language in Siemens Tia Portal?
Share
Notification Show More
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • Design
  • PLC
  • Interview
  • Control System
Search
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Inst Tools > Blog > PLC Tutorials > How to Start Writing SCL Language in Siemens Tia Portal?

How to Start Writing SCL Language in Siemens Tia Portal?

Learn how to write SCL language in Siemens TIA Portal. Start mastering structured control language today with our guide.

Last updated: March 15, 2025 1:07 pm
Viral Nagda
PLC Tutorials
No Comments
Share
7 Min Read
SHARE

In PLC programming, one of the most highly advanced languages is structured text. It is similar to the Pascal language that we use in IT programming. Due to this, you can execute highly difficult and complex codes in a very short length and speed. In TIA Portal software (Siemens), this language is termed SCL or structured control language. If you are new to this language and are using the TIA Portal, then this series of posts will help you learn it properly. In this post, we will see how to start writing SCL language in the TIA Portal.

Contents
SCL Language in Siemens Tia PortalSCL Programming for Beginners

SCL Language in Siemens Tia Portal

As discussed, SCL stands for structured control language. It is based on IEC 1131-3. For simplicity, we will compare this language with ladder logic for your understanding. As compared to ladder logic where you place elements or symbols like NO, NC, COIL, SET, RESET, etc.

SCL language comprises expressions, value assignments, and operators. This means, you have to write this in statement syntax. Due to this, you can easily create branches, jumps, and loops. So, complex applications like mathematical calculations and data analysis are mostly written in this language by PLC programmers. Let us jump further by comparing a simple start-stop logic written in ladder language with SCL language.

SCL Programming for Beginners

Refer to the below image. The code is written in Ladder language. If you see, the following elements are used – two NO contacts, one NC contact, and one normal coil. The logic written is – if the variable I_Start is on or the variable Sys_Running is on and the variable I_Stop is off, then the variable Sys_Running turns on. If any of the conditions goes false, then the output too will turn off.

Automation Programming for beginners

Now, before writing the code in SCL language, just read our logic written. This same logic is written in statement language as shown below. The language chosen is SCL.

SCL Programming for Beginners

In the favorites tab, click if and drag and drop it as shown below (You can also write it manually, but this is done for simplicity and if you do not know the syntax). What do you see? There are two elements – one logic, one condition, and one statement. The logic refers to the if-else statement here. If you correlate this with ladder logic, if the conditions are true, then the output turns on. So here, the output is replaced by a statement and the conditions remain as it is.

SCL Language in Siemens Tia Portal

Now, let us understand the logic written by seeing the below image. We will recall the logic once again – if the variable I_Start is on or the variable Sys_Running is on and the variable I_Stop is off, then the variable Sys_Running turns on. If any of the conditions goes false, then the output too will turn off. As you can see below, there are three types of elements used – expression, operator and value assignment.

An expression means a group of variables or a single variable written in a style, which returns a value during runtime. They are executed from left to right and also sometimes involve the use of brackets. Each line thus represents an expression. An operator can be logical, arithmetic, relational, reference, or miscellaneous, determined by its symbol. It is responsible for performing a function. A value assignment is similar to a write logic, where we write a value to a tag. So, the flow for writing an SCL logic is – use operators inside an expression, use this expression as either a condition or statement, and use value assignments for writing a value.

How to Start Writing SCL in Siemens PLC

As you can see below, we write the whole condition in an if style. In the ladder logic, the two NO elements in parallel are written here as an OR operator, which has the same meaning. They are then enclosed in a bracket, meaning they work in a group. Then, the NC element placed in series is written here as an AND operator, which has the same meaning. The whole condition is terminated by THEN, meaning to start an action. Afterwards, the normal coil is written here in value assignment style, by moving a value ‘1’ in the variable. The left-hand side of := denotes the variable to be written, and the right-hand side of := denotes the value to be written.

Learn SCL programming from scratch

As in the ladder logic, if any of the conditions fails, then the output turns off. So, we then continue with the ELSE keyword. Afterwards, the normal coil is written here in value assignment style, by moving a value ‘0’ in the variable. Then, we terminate the whole if-else logic with END_IF keyword. One thing to note is that conditions do not require a ; in the end, but a value assignment requires a ; in the end of the line. Just now read the whole logic from start to end, and you can see clearly how it matches the ladder logic.

Let me simplify your doubt more as below:

  1. The first line expression is a condition.
  2. The second line expression is a value assignment or statement.
  3. The third line expression is a keyword for moving further to write a second value if the condition is not true.
  4. The fourth line expression is a value assignment or statement.
  5. The fifth line expression is a keyword for ending the whole logic.

As we see other articles further, you will see how SCL is relatively easy to write. In the next post, we will see the arithmetic, relational and logical expressions that can be used, which will help us to write logic further.

Read Next:

  • PLC Instruction List Program for Basic Instructions
  • How to do Scaling for Analog Input in RSLogix 500?
  • PLC Light Sequence Control using Bit Shift Registers
  • PLC Instruction List for Motor Reverse and Forward
  • Timer-Based Sequential PLC Program with One Button
Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
You've successfully subscribed !

Continue Reading

PLC Code to Start & Stop Motor and Pump as per Logic
SCADA Systems
Tia Portal – OB10 Time of Day Interrupt Organization Block
How to Create New Project Using Simatic Manager
PLC Input Output Modules
Programmable Logic Controller Maintenance Check Points
Share This Article
Facebook Whatsapp Whatsapp LinkedIn Copy Link
Share
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

128.3kFollowersLike
69.1kFollowersFollow
210kSubscribersSubscribe
38kFollowersFollow

Categories

Explore More

Electrical Ladder Diagram Control using Timers Example
How to Filter Digital and Analog Inputs in a PLC?
PLC Program for Washing Machine
PLC Programming Example for a Batch Process
Power Supply Sizing for Industrial Automation Systems
Define the Order of Execution in Functional Block Diagram of Studio 5000
PLC Level Control of Two Tanks
Different Types of Schneider PLC

Keep Learning

Shutdown Motors in Timed Operation PLC Program

Shutdown Motors in Timed Operation PLC Program

OSI Reference model

SCADA Communication and Protocols

What is an RTU - Remote Terminal Unit

What is an RTU? – Remote Terminal Unit

PLC Program for Fish Feeding System

PLC Program for Fish Feeding System

What is Siemens TDC - Siemens Control System

What is Siemens TDC? – Siemens Control System

Smart Drip Irrigation System Using PLC

Scheduled Daily Plant Watering PLC Program

Omron PLC programs

Daily Alarm PLC Program using Real-Time Clock

PLC Cabinet

PLC Programming Videos

Learn More

Basic Requirements of Sizing the Control Valves

Basic Requirements of Control Valves Sizing

Flanged pipe fittings

What is Flanged Pipe Fittings ?

Transistor as Switch Working Animation

How a Transistor Switch Works

Difference Between Clamp Meters and Digital Multimeters

Difference Between Clamp Meters and Multimeters

Raspberry Pi Projects

200 Raspberry Pi Projects

Computer Science and Technology Certifications

Computer Science and Technology Majors Certifications

SIS Audit & Assessment - Safety Instrumented System

SIS Audit & Assessment – Safety Instrumented System

Humidity sensor Working Principle

Humidity Sensor Working Principle

Menu

  • About
  • Privacy Policy
  • Copyright

Quick Links

  • Learn PLC
  • Helping Hand
  • Part Time Job

YouTube Subscribe

Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?