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

Create an Application in HMI using Tia Portal
How to Communicate with Excel from Intouch SCADA?
Conveyor Speed Logic using Structured Text in PLC
Auto Tiffin Box Filling Station
Siemens HMI Training – Using UDTs with Faceplates
Flexible Input Output Modules
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

How to Filter Digital and Analog Inputs in a PLC?
Relay circuits
PLC Motor Logic with START, STOP, TEST Push buttons
PLC Ladder Logic for Tanks Filling as per Priority
Compare Online and Offline PLC Programs
The Purpose of Marshalling Cabinet or Marshalling Panel
Types of Noise in Electronics
Schneider Electric PLC Timer Problem: Vacuum Cleaner

Keep Learning

Relay Permissive and interlock circuits

Basics of Permissive and Interlock Circuits

Alarm prioritization

What is Alarm Prioritization? – Types of Alarms

Instrumentation Earthing

Instrumentation Earthing

Automated Test Bench - Complex PLC Programming Examples

Automated Test Bench – Complex PLC Programming Examples

Sequencer Output in PLC

PLC Sequencer Instruction with Example

How to Activate the Schneider PLC Software License

How to Download EcoStruxure Machine Expert? Schneider PLC Software

PLC Programming Classroom Bell System

Classroom Bell System – PLC Programming Practice Examples

Types of PLC

#14 PLC Best Practices – Restrict Third-party Data Interfaces

Learn More

Pneumatic Moment-balance Differential Pressure Transmitter

Pneumatic Moment-balance Differential Pressure Transmitter

Questions on Level Switches

Questions on Level Switches

Functional Block Diagram in PLC for Oil and Water Process

Functional Block Diagram in PLC for Oil and Water Process

Contact less Tachometer

Types of Tachometers – Mechanical and Electrical Tachometers

Guide Wire Level Measurement

Float Level Measurement

Simatic 300 Station Configuration

Monitor and Modify Variables in Simatic Manager

Types of Pressure

Types of Pressure – Instrument Questions and Answers

Doubtful Temperature Readings

Doubtful Temperature Readings threatens Soaking Pit Wrecks 

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?