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: Value Assignments in SCL Language – Single, Multiple, Combined
Share
Notification Show More
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 > Value Assignments in SCL Language – Single, Multiple, Combined

Value Assignments in SCL Language – Single, Multiple, Combined

Learn the essentials of value assignments in SCL language. Master syntax to write statements accurately and effectively.

Last updated: March 15, 2025 2:16 pm
Viral Nagda
PLC Tutorials
No Comments
Share
6 Min Read
SHARE

In this post, we will see how to assign values to a tag. This is similar to writing instruction in any language. In the earlier posts, we saw some basic rules on how to assign a value to a tag. Here, we will dive into some more syntax which can be explored in SCL language and used. Once you are through with the syntax of expressions having value assignments, you can then write any statement properly without any error.

Contents
Value Assignments in SCL LanguageSingle value statementsMultiple value statementsCombined value statements

Value Assignments in SCL Language

To those who do not know what a value assignment is, let us recall our earlier study. It is a statement which corresponds to a writing instruction. The general syntax is tag1 := tag2;. The left hand side of := is the tag where value will be written. The right hand side of := is the tag from which the value will be read and written. The right hand side can either be a tag or a constant. A semicolon is required in the end to terminate the statement. Let us now have a look at the various types of value assignment statements.

Single value statements

Value Assignments in SCL Language

The very first example we saw now is a single value statement. In this, the right hand side of := contains a tag, constant or an expression, and the value is written to a single tag on the left hand side. That is why the name is a single value statement. Refer to the above image for more understanding. As seen in the ladder logic above, a single tag of sys_running is being written. So, in the SCL language, we too write a single statement where either a 1 or 0 is moved in the tag of sys_running.

Multiple value statements

Structured Control Language (SCL) Elements

In this, the right hand side of := contains a tag, constant or an expression, and the value is written to multiple tags on the left hand side. Means, the data to be read will be written to more than one tag. That is why the name is a multiple value statement. Refer to the above image for more understanding. As seen in the ladder logic above, two tags of sys_running and sys_started are being written. So, in the SCL language, we too write a single statement where either a 1 or 0 is moved in both the tags of sys_running and sys_started.

The general syntax is tag1 := tag2 := tag3;. Here, the data flow starts from the right hand side and moves towards the left hand side. For this reason, multiple := are used to declare the statement as valid. The value of tag3 or the third expression is written to tag2 or the second expression. The value of tag2 or the second expression is written to tag1 or the first expression.

Combined value statements

PLC Value assignments

This is a very powerful tool which makes the TIA portal software very friendly to use. In this, you can combine the operators like +, – , * etc. with = or the assignment operator. Due to this, your code size reduces and you can create various shortcuts in the logic for minimising the memory consumption of the CPU.

The general syntax is tag1 += tag2;. The left hand side of += is the tag where the value will be written. The right hand side of += is the tag from which the value will be read and written. But here, the actual meaning of this syntax is – tag2 is added with tag1, and the result is written in tag1. So, in the other way, you could have written this in a single value style like – tag1 := tag1 + tag2;. This syntax too has the same meaning, but we reduced the coding here using combined value style.

As seen in the ladder logic above, we have added add_tag with itself to 1, and the result is written in add_tag. So, in the SCL language, we have written the same thing as – Add_tag +=1; One thing to note is that you can write combined style for either single value or multiple values. This makes value assignment very sharp and efficient to use in SCL language.

In the next post, we will see some general rules for writing a program in SCL language.

Read Next:

  • PLC Instruction List Program for Basic Instructions
  • How to do Scaling for Analog Input in RSLogix 500?
  • Standard Colors used in the PLC Automation Systems
  • Structured Text vs. Instruction List for PLC Programming
  • Advanced Skills Required for a PLC Programmer to Get a Job
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 PLC Reads the Data from Field Transmitters
#18 PLC Best Practices – Store PLC Hard Stop Events from Faults
Tank Level Control in PLC
Concept of Interlocking in PLC
Real-Time Clock in Omron PLC? – CX Programmer
Schneider PLC Programming Example for Beginners
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

Push button Motor PLC Logic
System Cabinet Health Checks – PLC and DCS Industrial Automation
Run 4 Motors Sequentially from Same Push button PLC Program
PLC Automatic Control of Two Outputs with one Input
Function of Racks in PLC – Types of SIEMENS S7-400 PLC Racks
Applications of SCADA
How to Work with Delta PLC Simulator?
Difference Between Wifi and Industrial Wireless

Keep Learning

Example of PLC Programming based on Logic Circuit

Example of PLC Programming based on Logic Circuit

Namur Digital Input Card

What is Namur Digital Input Card?

intouch Basics

How to Create Project in Wonderware Intouch?

Liquid management using PLC programming

PLC Programming for Loss in Weight Liquid Systems

Your First Steps Through STL Language

Your First Steps Through STL Language

PLC Analog I/O Potential Problems

PLC Analog I/O Potential Problems – Troubleshooting & Issues

Function Block Diagram - Studio 5000 Logix Designer

Define the Order of Execution in Functional Block Diagram of Studio 5000

FBD Logic

Why different PLC Programming Languages were Developed?

Learn More

On Delay Timer using PLC

ON Delay Timer using PLC

Differential Pressure Transmitter

Calculate Process Variable from 4-20mA using Fraction of Measurement

Digital Electronics Objective Questions

Digital Electronics Objective Questions – Set 10

Nuclear Plant Sensors and Detectors Quiz

Nuclear Plant Sensors and Detectors Quiz

A Large Gate Valve Failed Motorized Operation

A Large Gate Valve’s Failed Motorized Operation

As-Interface Protocol Overview

AS-interface and DeviceNet Communication

Water Treatment Industry

Water Softening Systems in Water Treatment Industry

Wood Sawing and Blower System PLC Control Design

Wood Sawing and Blower System: PLC Control Design

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?