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 !
HMI Handbook
How to Choose the Right Industrial Automation Solution?
Shutter Door Control using Motor and Limit Switches
Example of Automated Guided Vehicle with PLC
Run 4 Motors Sequentially from Same Push button PLC Program
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

PID Simulator

PID Simulator Download

PLC Documents

PLC System Documentation

Siemens Industrial Laptop (Simatic Field PG)

Connect to the Siemens S7 PLC

PLC SCADA Water Pump

PLC Program for Controlling a Water Pump with 3 Power Sources

PLC Lamp Control using Logic Condition

Lamp Control using PLC Logic Condition

Gate Array Logic using PLC

PLC Program to Simulate Gate Array Logic

PLC Automatic Control of Two Outputs with one Input

PLC Automatic Control of Two Outputs with one Input

Learn PLC in Hindi

Learn PLC in Hindi

More Articles

Purpose of Isolation valve

Repeat Failures of Letdown Valves

PLC Timer Programming Examples on Coffee Machine

PLC Timer Practice Exercise: Coffee Machine Programming

SCR Full Bridge Converter

Power Electronics – Full-wave Rectifier With R and RL Load

HMI Simulation for PID Controller

PID Controller Output Types – PID_PWM and PID_Output

Instrumentation Engineering Root Cause Analysis

Instrumentation Engineering Problems Solved – Root Cause Analysis

Introduction to Schneider PLC

Different Types of Schneider PLC

Proximity Switch Working Animation

Proximity Switch Working Animation

5 Tips to Pass CFSE Exam

5 Tips to Pass CFSE Exam

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?