Inst ToolsInst ToolsInst Tools
  • Ask
  • Courses
  • Videos
  • Q & A
    • Interview
      • Instrumentation
      • Electronics
      • Electrical
      • Practical Questions
    • MCQ
      • Instrumentation MCQ
      • Electrical MCQ
      • Electronics MCQ
      • Control Systems MCQ
      • Analog Electronics MCQ
      • Digital Electronics MCQ
      • Power Electronics MCQ
      • Microprocessor MCQ
      • Multiple Choice Questions
  • EE
    • Electronics
      • Electronics Q & A
      • Electronic Basics
      • Electronic Devices & Circuits
      • Electronics Animation
      • Digital Electronics
    • Electrical
      • Electrical Basics
      • Electrical Q & A
      • Power Electronics
      • Electrical Machines
      • Electrical Animation
      • Power Systems
      • Switchgear & Protection
      • Transmission & Distribution
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Search
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Reading: How to Start Writing SCL Language in Siemens Tia Portal?
Share
Notification Show More
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • PLC Tutorials
  • Control Systems
Search
  • Ask
  • Courses
  • Videos
  • Q & A
    • Interview
    • MCQ
  • EE
    • Electronics
    • Electrical
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
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 !
Tank Filling and Emptying using Intouch Scada Script
Free PLC Training Software Download
PLC Output Types
Create a User-Defined Function Block in Codesys
What are High-Speed Inputs in PLC?
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
208kSubscribersSubscribe
38kFollowersFollow

Categories

Recent Comments

  • Guifty Shimica on Top Non-PLC Certification Courses for Automation Professionals
  • Guifty Shimica on Top Non-PLC Certification Courses for Automation Professionals
  • MIHARITSOA Aina Sitraka on Top Non-PLC Certification Courses for Automation Professionals
  • Vaishnavi on Free Instrumentation Course for Trainee Engineers

Related Articles

PLC Ladder Logic Chemical Mixing Process

Chemical Mixing Process using PLC

Demo of a SCADA Software – Level Control System

User Defined Function Blocks in PLC

What are User Defined Function Blocks in PLC?

0 to 10 mA Current Loop

What is Live Zero in 4-20 mA Current Loop ?

Open Platform Communication (OPC)

Open Platform Communication (OPC)

Two Hand Control Logic

Two Hand Control Logic using PLC

Falling Positive and Falling Negative Instructions in PLC

Positive and Negative Edges using Statement List Language

Field Instrument package

Package System Architecture – Control & Instrumentation

More Articles

Densitometers Principle

Vibrating Tube Densitometers Working Principle

Manchester encoding

Foundation Fieldbus Electrical Parameters

Voltage Divider

Voltage Divider

Electrical & Electronics Measurements Objective Questions

Electrical & Electronics Measurements Objective Questions – Set 2

PLC Programming Example on Bottle Line Control

PLC Programming Example on Bottle Line Control

Voting Logic in Safety Instrumented System (SIS)

Voting Logic in Safety Instrumented System (SIS)

Nonlinear Control Systems

Construction of Phase -Trajectories

How to Design a Motor Faceplate in Graphics - SCADA Tutorials

How to Design a Motor Faceplate in Graphics? – SCADA Tutorials

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?