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: Use of Comments in SCL Language
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 > Use of Comments in SCL Language

Use of Comments in SCL Language

Learn the use of comments in SCL language to enhance clarity and reduce troubleshooting time in your programming.

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

In an earlier post we saw how to write a while do statement. It is particularly important if we are executing repetitive statements. Now, apart from executing and writing statements, the SCL language provides one more option to bypass the statements if not required. It is called a comment. A comment is used to add descriptions to a line or bypass statements. Programmers can make very good use of this feature, which helps in reducing troubleshooting time. In this post, we will see how to use comments in SCL language.

Contents
What is a comment in SCL language?How to write comments in SCL language?

What is a comment in SCL language?

As you saw earlier, a comment is a part of SCL language which is used to describe what is the use of the statement that you are writing. Similar to how we write comments in ladder language or any other language for describing what is the meaning of the logic that you are writing, a comment is used similarly in the SCL language for the same purpose. Comments do not affect the execution of the logic written inside the statement. Yes, but it depends on what you’re commenting and why you are commenting.

Also, if you do not require logic to execute, then you can use a comment to bypass that statement. The PLC scan time will not execute that comment or statement. The PLC scan time will not execute that statement during runtime.

Let us see below some general types of comments used in a program:

  1. On a single line –

 (* statement *) or // statement

  1. More than one line –

(*

Statement-1

Statement-2

*)

As you can see, // syntax is used when you are commenting on only a single line. But, (*…*) syntax is used for all the types of lines, whether single line or multiple lines. This syntax is thus very powerful in executing. In the later part, we will see examples on how to write comments.

How to write comments in SCL language?

Let us understand three examples on how to write comments in SCL language.

  1. In the first one, we will describe the use of the logic written. For that, suppose we write the line as shown in the image below, we see that we are describing one whole construct with a single line. It gives an overall description of the logic written. We write it as a – // while-do statement. It is simply describing or naming our logic. This helps in easier troubleshooting for the programmers in a longer run.
Use of Comments in SCL Language
  1. In the second one, we will bypass this whole construct and not allow the PLC scan time to execute it. For that, suppose we write the line as shown in the image below, we see that we are bypassing one whole construct with two  lines. It gives an overall impression to the programmer that this logic is not in use currently. We write it as a – (* statement *). It is simply bypassing our logic. This helps in easier troubleshooting for the programmers in a longer run. You can easily identify commented parts by the green color shown. This is an added feature of PLC software.
What is a comment in PLC language
  1. In the third one, we will comment on the wrong line and see how it impacts our program. For that, suppose we write the line as shown in the image below, we see that we are bypassing a single line. But when we bypass that line, we see that the while keyword becomes red in color. It means that it did not find any end keyword for the construct. Due to this, the statement remains incomplete and the compile error will occur. So, do not just randomly comment on any line. You need to comment in such a way that it does not affect other logic too by bypassing it.
How to write comments in SCL language?

In the next post, we will see how to write regions in the SCL language.

Read Next:

  • Flip-Flop PLC Programming Examples
  • PLC Hoist Crane Programming Example
  • Automatic Railway Crossing Gate Control
  • Siemens PLC Program Course for Beginners
  • PLC Exercise for Students in Automation

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

Top 100+ SCADA Questions
Create a User-Defined Function Block in Codesys
Compare Modbus, Fieldbus, and Profibus
Scheduled Daily Plant Watering PLC Program
How to Program a Star-Delta System using 1 Button in PLC?
How-to do Security of SCADA Systems?
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

Vendor Document for Project Systems Architecture
How to Train Your Maintenance Team for Industrial Automation Systems?
PLC Counter Instructions
VFD Simulator Download – Free Yaskawa V1000 Software
PLC Pneumatic Circuit Control
Allen Bradley SLC 500 PLC Programming
Upgrading and Migration of PLC Systems
PLC Analog Signals Wiring Techniques

Keep Learning

Static and Temp Variables in PLC

Static and Temp Variables in PLC

How to Start Writing SCL in Siemens PLC

Rules for Writing SCL Language in Tia Portal

Node-RED in PLC Automation

Node-RED in PLC Industrial Automation

PLC Training Course

#17 PLC Best Practices – Log PLC Uptime and Trend it on HMI

Introduction to GOC controllers

Mitsubishi Electric GOC Controllers

PLC Program

PLC Program to Heat and Bend Glass Tubes

Multi-Tank Liquid Level Control System with Fill Priority [PLC]

Multi-Tank Liquid Level Control System with Fill Priority [PLC]

SCADA backup too has been configured

FactoryTalk Studio and SQL Server for Data Logging

Learn More

Capacitance Type Level Transmitter Working Principle

Capacitance Level Transmitter Animation

Instrument Air Compressor Control Philosophy

Instrument Air Compressor Control Philosophy

Pressure Gauge Maintenance and Troubleshooting

Pressure Gauge Maintenance and Troubleshooting

Infrastructure Monitoring in Your Business Operations

Infrastructure Monitoring in Your Business Operations

Reflex Level Gauge Parts

What is Reflex Level Gauge?

Piston Check Valve

What is Piston Check Valve ?

Independent-Voltage-Source-circuit-ideal-battery

Circuit Elements and Types of Circuits

Remote User Authentication

Security of Industrial Automation Systems

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?