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

Continue Reading

How to Add Unspecified CPU in Tia Portal?
How to use Sub Routines with Allen Bradley PLC
Free PLC Training Software Download
Omron PLC Project: Fish Farm Automation Tutorial
PLC Project Examples for EcoStruxure Machine Expert
Distributed Control System Interview Questions
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

SCADA Software and their Comparison
Case Statement in SCL Language
PLC Motor Control Ladder Logic Programming
PLC Program – Controls Conveyors ON and OFF Sequence
PID Controllers in Closed Loop Control Systems – PLC Basics
Converter Instruction in Siemens PLC Programming
Free Allen Bradley PLC Ladder Logic Training Course
Why 24 Volts DC Power Supply is used? – Industrial Automation Systems

Keep Learning

PLC Latching circuit Animation

What is Seal-in Circuit ?

Procedure For reading or searching the tag number in Siemens PLC

Procedure for Reading or Searching the Tag number in Siemens PLC

Boolean Logic to PLC Programming

Boolean Logic to PLC Programming

Classification of Fuses

Step-by-Step Guide to Choose Right Fuse for a Panel

Allen Bradley PLC Emulator

How to Work with Allen Bradley RsLogix Emulator?

memory types in siemens plc

#13 PLC Best Practices – Disable Unused Communication Ports

Function Block Programming in Studio 5000

Introduction to Functional Block Diagram in Studio 5000

4 TO 20 MA ANALOG CURRENT SIGNALS

Basics of 4 to 20 mA analog Signals

Learn More

Formula of AMP, KW, KVA, HP for AC and DC Voltages

Formula of AMP, KW, KVA, HP for AC and DC Voltages

Home Heating

What Type of Heating is Best for Your Home?

Claw Machine PLC Programming

Doll Claw Machine using Omron PLC Programming

Vibration Measurement Sensors

Types of Sensors used in Vibration Measurement

Difference Between Isolator and Circuit Breaker

Difference Between Isolator and Circuit Breaker

Surface Grinding Process using PLC Program

Surface Grinding Process using PLC Program

pH Analyzers Questions and Answers

pH Measurement Questions & Answers

Circuit Measurement Objective Questions

Electrical and Electronics Circuit Measurement Objective Questions

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?