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

What is a PLC Retrofitting Project? – Importance, Procedure
Instrumentation Engineer in Process Plant Project
What is SCADA System?
Distributed IO Sharing Between PLC Systems – Technical Insights
Siemens PLC Organization Blocks (OB)
Web-based SCADA HMI Software
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

T-Junction Traffic Control System – PLC Programming
Parking Garage Indicator: PLC Automation System
How to Interchange ON Delay Timer and OFF Delay Timer in a PLC
How is Data Stored in Standard Modbus Protocol?
User Defined Data Types (UDT) – Purpose, Need, Tutorial
3 Phase Motor Control using PLC Ladder Logic
Function Block (FB) for Motor Control Logic
4-20 mA Transmitter Wiring Types : 2-Wire, 3-Wire, 4-Wire

Keep Learning

Put Get PLC communication

PUT Command in Siemens PLC – TIA Portal Basics

Siemens TIA Portal program blocks

Tia Portal – Optimized and Standard Data Block Access

Factory IO PLC Course

Factory I/O PLC Automation Training Course (Free)

Counter Count Down Bit

Down Counter PLC Program

OSI Reference model

SCADA Communication and Protocols

Falling Positive and Falling Negative Instructions in PLC

Positive and Negative Edges using Statement List Language

PLC FBD Example for Tank Liquid Heating Control by Steam Flow

PLC FBD Example for Tank Liquid Heating Control by Steam Flow

SR Flip Flop Logic

How to implement SR Flip Flop using PLC Ladder Logic

Learn More

Magnetostrictive Tank Gauging Probe

Magnetostrictive Tank Gauging (MTG)

Inherent vs Installed Control Valve Flow Characteristics

Inherent vs Installed Control Valve Flow Characteristics

Economics of Power Generation Objective Questions

100+ Economics of Power Generation Objective Questions and Answers

phototransistor-circuit

Phototransistor Circuit Example

Resistive Transducers Objective Questions

Resistive Transducers Objective Questions

failure rate of a component - 1

Failure rate and MTBF of Safety Instrumented Systems

Redundant system communication cable

What is Interface Module in Siemens PLC?

Test Questions on Safety Instrumented System

Test Questions on Safety Instrumented System

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?