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
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
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
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

PLC Ladder Logic Simulator Mobile Apps For Android
Testing and Validation in PLC Development
PLC Alarm and Trip Documentation
How to Get a PLC Programming Job With NO Experience?
Start Stop of one Motor from the same Push button PLC program
PLC Programming Example on Bottle Line Control
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

Pump and Mixer Operations Example: PLC Timer-Based Control
PLC Timer Programming Examples – TON, TOF, TP and TONR
Top Non-PLC Certification Courses for Automation Professionals
Jog Function in Motor Start Stop Logic using PLC
Ferrules and Cross Ferruling
Mitsubishi PLC Programming Tutorials
Understanding the Scan Cycle of SIEMENS PLC
Node-RED in PLC Industrial Automation

Keep Learning

Count the Number of Cartons in a Storage Area PLC Logic

Count the Number of Cartons in a Storage Area PLC Logic

Most Asked Questions on SCADA

Most Asked Questions on SCADA with Answers

PLC Program for Control Valve Scaling

PLC Program for Control Valve Scaling

TIA Portal MOVE Instruction

MOVE Instruction in PLC – What You Need to Know?

PLC Timer Program

PLC Timer Instructions

Standard Colors in PLC Automation Systems

Standard Colors in PLC Automation Systems

PLC Program for Trash Compactor

PLC Program for Trash Compactor

Field Instrument package

Package System Architecture – Control & Instrumentation

Learn More

Top 10 Facts about HART Technology

Top 10 Facts about HART Technology

Supplied Screen Vibrators Perennial Problems

Supplied Screen Vibrators Perennial Problems

Wedge Flow Meter

Wedge Flow Meter Principle

Calculate Density and Specific Gravity

Calculate Density and Specific Gravity

PLC Example on Manufacturing Line Assembly

PLC Example on Manufacturing Line Assembly

Stepper Motor Parts

Stepper Motor MCQ

Thin Client in SCADA

What is Thin Client in SCADA? – Purpose, Advantages

Motor Feedback Fail Logic in PLC

Motor Feedback Fail Logic in PLC

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?