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

PLC Program for Automatic Bottle Rejection System
Allen Bradley Math Functions
CX-Programmer Products Sorting & Counting – Omron PLC
Sequential PLC Programming for the Pneumatic Valves
Types of Failures in Industrial Automation Systems
What is PID Controller?
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

PLC Simulator using Excel
What is Fail-safe in Siemens PLC?
Studio 5000: Programming Three Motors with Fixed Priorities
Difference between PLC and HMI
Ladder Logic for Flow Meter Totalizer
PLC Program – Controls Conveyors ON and OFF Sequence
PLC Ladder Logic for Start-up Control of Boilers
PLC Programming for Sequential Batch Mixing System

Keep Learning

ControlLogix Architecture - Rockwell Automation

ControlLogix Architecture – Rockwell Automation

Marking Machine

PLC SCL Program for Marking Machine

Establish Communication Between Two PLC Via PROFIBUS Protocol

Establish Communication Between Two PLC Via PROFIBUS Protocol

SCADA Standards

SCADA for Substation Automation

PLC Example to Control LEDs Via Switches

PLC Example to Control LEDs Via Switches

How to export in Vijeo Designer

Vijeo Designer software – Import and Export

Face Mask Making Machine using PLC and HMI

Face Mask Making Machine using PLC and HMI

ControlLogix 5580 Controllers

Rockwell PLCs for Large Scale Applications

Learn More

Safety Considerations in PLC System Design

Safety Considerations in PLC System Design

harmonics-effect-on-transformer

Harmonics effect on Transformer

BALL CHECK VALVE THEORY

Types of Check Valves

Simple Conveyor Control PLC Program

XG5000 Example of Simple Conveyor Control PLC Program

Difference between KW and KVA

Difference between KW and KVA

Control Valve Parts

Control Valve Parts Questions and Answers

Electrical Conduit Seal

Assembling an Electrical Conduit Seal

What is a Compressor

What is a Compressor? Types of Compressors

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?