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: Types of Expressions in the SCL Language of the 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 > Types of Expressions in the SCL Language of the Tia Portal

Types of Expressions in the SCL Language of the Tia Portal

Learn the different types of expressions in the SCL language and how to use them for arithmetic and logical operations.

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

In the previous post, we had a brief introduction to the SCL language and saw how to start writing the language. Once we have gone through this, we must first learn what are the valid types of expressions which this language accepts with proper syntax. If you are not able to write them properly, then you will not be able to use this language. In this post, we will see some general types of expressions which are used in the SCL language of the TIA portal (mostly, it is uniform in other automation platforms too).

Contents
Arithmetic expressionsRelational expressionsLogical expressionsTypes of Expressions in the SCL Language

Arithmetic expressions

As the name implies, you can use mathematical operators for creating calculations and also for assigning values. They work on numerical values and can be used either as conditions or statements. The data types must be used properly in the code before doing any mathematical operation. You can use all the data types using arithmetic expressions, except strings. The various types of arithmetic operators are – power(**), plus(+), minus(-), multiplication (*), division (/), and modulo function (MOD).

Relational expressions

Relational expressions compare values and give you a result based on those comparisons. The final answer will always be true or false. They work on numerical or string values and can be used only as conditions. The data types must be used properly in the code before doing any relational operation. You can use all the data types using relational expressions.

The various types of relational operators are – equal(=), not equal(<>), less than(<), less than or equal to(<=), more than(>), and more than or equal to (>=).

Logical expressions

Logical expressions refer to the gate logic we use in digital circuits. They work on numerical and string values and can be used either as conditions or statements. The data types must be used properly in the code before doing any logical operation. You can use all the data types using logical expressions. The various types of arithmetic operators are – AND, OR, NOT, and XOR.

Types of Expressions in the SCL Language

Let us now write a logic using all these expressions. We will again convert the ladder logic into SCL logic, and see how to write using proper syntax. The logic is – if the variable I_Start is on or the variable Sys_Running is on and the variable I_Stop is off and the variable I_Sensor is more than 30, then the variable Sys_Running turns on and a variable Add_Tag is added with itself and 1. If any of the conditions goes false, then the output too will turn off and the addition will pause. Refer to the below image for ladder logic.

convert the ladder logic into SCL logic

Now, we write the following logic in SCL code as below:

Types of Expressions in the SCL Language of the Tia Portal

Let us understand how it is written by referring to the below image. You get a direct view with the ladder logic. Continuing from our earlier post, we just added a sensor value comparison and added a tag when the system is running. As the sensor comparison is required in series, we add an AND syntax before that, and compare the tag by putting > syntax. Once the condition is true, we also add a tag as required. As discussed before, the write tag comes in the left hand side of :=; so add_tag comes before :=. The values to write comes in the right hand side of :=; so we write as add_tag+1.

Note that we are not asked to reset the value of addition in the question anytime; so we are just not writing anything in the false condition, where we turn off the running bit. So, it all depends on how you read and understand the question first. The same was written in ladder logic.

Introduction to SCL Programming in Siemens PLC

In this way, we saw some general types of expressions in the SCL language of TIA Portal. Next, we will see some different types of value assignments in the SCL language.

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 !
How to Configure Distributed IO in a PLC Project?
PLC Connection between Instrument, Junction Box, Marshalling & System Cabinet
Set the S5 Timer Value by a Memory Word
Vendor Document for Project Systems Architecture
PLC Program for Controlling a Water Pump with 3 Power Sources
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 Program using One Shot Rising Instructions

One Shot Rising and One Shot Falling Instructions in PLC

Studio 5000 Define Program or Operator Control in Functional Block Diagram

Studio 5000: Define Program or Operator Control in Functional Block Diagram

Pumping System in Industrial Automation

Basic Pumping System Application Used in Industrial Automation

Industrial Automation and Control Systems (IACS)

Industrial Automation and Control Systems (IACS)

Free Omron PLC Programming Course in HINDI

Free Omron PLC Programming Course in HINDI

scada hmi

Functions of SCADA

Functional Block Diagram of XNOR Logic Gate

PLC Functional Block Diagram for Logic Gates

Ferrule Example

Ferrules and Cross Ferruling

More Articles

Basic Logic Gate Symbols

Engineering Logic Diagrams

What is a Time Delay Relay

What is a Time Delay Relay? Principle, Advantages, Disadvantages

Stop Check valve

What is Stop Check valve ?

Radiochemical Questions and Answers

Fundamentals of Radiochemical Methods Questions

radar-level-sensor-

Non-Contacting Radar Level Transmitter Working Principle

Pressure Transmitter Working Principle

Gage and Absolute Pressure Transmitters Principle

WirelessHART field instruments

WirelessHART device Configuration

Losses of Transformer

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?