Skip to main content

Dear Reader, today I have the pleasure of introducing you to the intricacies of SCL (Structured Control Language) – a powerful tool for programming Siemens PLC controllers. This language, part of the IEC 61131-3 family, enables the creation of complex control algorithms in an organized and efficient manner, making it indispensable in modern automation systems.

The goal of this article series is not only to acquaint you with the theoretical aspects of SCL but, more importantly, to show its practical applications in real scenarios. Through collaboration with the Factory IO environment, we will delve into the world of industrial process simulation. We’ll present scenes that illustrate basic programming techniques in SCL, and you will be able to follow and analyze various use cases of this language step-by-step.

Don’t worry if everything isn’t clear at first. Programming in SCL, while it may seem complex initially, becomes much simpler with experience and the right guidance. This is precisely why we’ve prepared a comprehensive training program for you, which will guide you through the nuances of programming, from simple to more advanced projects. In this article, we’ll focus on one basic project – a conveyor scene, which serves as an excellent starting point for beginner programmers.

I invite you to join this journey into the world of PLC programming in the SCL text-based language. Together, we’ll discover how a few lines of code can control the world. Are you ready to begin this adventure? Prepare yourself for a series of articles that will open up new perspectives for you in the field of industrial automation.

Let’s start with the simplest scenario…

Variable List:

Variable NameTypeAddress
xStartButtonBool%I0.0
xStopButtonBool%I0.1
xConveyorStartBool%Q0.0

Scenario #1: Button Activates the Conveyor 🤓


Pressing the Start button activates the conveyor. When the button is released, the conveyor stops.

How to write this in SCL? 🤔

"xPodajnikUruchom" := "xPrzyciskStart";

Scenario #2: Self-Holding Circuit 😀

Assumptions:

  • Pressing the Start button activates the conveyor.
  • After releasing the button, the conveyor keeps running.

Let’s program this in LAD language!

Here, you need to use a ladder structure with feedback.

Notice that after releasing the button, the variable xPodajnikUruchom maintains its high state!

How to write this in SCL? 🤔

"xPodajnikUruchom" := "xPrzyciskStart" OR "xPodajnikUruchom";


Scenario #3: Start-Up Circuit with Start and Stop Buttons 😀
Assumptions:

  • Pressing the Start button activates the conveyor.
  • After releasing the button, the conveyor keeps running.
  • Pressing the Stop button stops the conveyor.

Let’s program this in LAD language!

Note that the signal from the Stop button is of the NC (Normally Closed) type – meaning that when it is not pressed, it provides a high state (logical 1 – TRUE) to the controller.

How to write this in SCL? 🤔

"xPodajnikUruchom" := "xPrzyciskStart" OR "xPodajnikUruchom" AND "xPrzyciskStop";

What’s next? 😀

Go to part 2, where we’ll expand the functionality of our program. I’ll show you new instructions in the SCL language!

  1. Boolean Operations – PLC Programming in SCL Language #1
  2. IF… THEN Instruction – PLC Programming in SCL #2
  3. Trigger, Timer in SCL – PLC Programming in SCL Language #3

Author

Matthew Kurantowicz

Author Matthew Kurantowicz

More posts by Matthew Kurantowicz

Leave a Reply