Naar de inhoud springen

Sander van de Velde

Microsoft MVP Azure | IoT Platform Architect | Speaker about IoT | Let me add some value

  • Home
  • Public speaking
  • About Sander van de Velde

How to start programming a Siemens Logo PLC

Sander van de Velde | Microsoft MVP | IoT Solution Architect | Speaker | Maker PLC 14 oktober 20191 december 2020 4 Minutes

If you visit my blog on a regular basis, you see me blogging a lot about Azure IoT Edge. This means that logic is deployed from the cloud onto Industrial PCs (or a more moderate, non-industrial, Raspberry Pi).

But this is just the ‘third’ generation of automatically controlling machines.

The first generation are magnetic contactors or relay like this one:

The logic is ‘hardcoded’. If some inputs are set, some outputs are set; or not. With each kind of relay comes some internal schematics:

It’s easy to see the limitations of these kind of relays. Wouldn’t it be great to program a similar relay a bit more dynamicaly using a little bit of software?

Enters the second generation: PLCs or Programmable Logic Controllers:

I got my hands on a Siemens LOGO! 230R. Although this model is not sold anymore, its programming model is still valid. Newer models have more capabilities but still rely on the same basic functionality.

Let’s check out on how to program this PLC.

This PLC is running on 220V which is standard in Europe. Please check your wiring twice before touching anything 🙂

The PLC comes with a manual which tells you with icons how to program it by hand using that little display and the cursor buttons.

But you can also program it using software running on your PC with a serial connection. Yes, this module is still programmed using a serial cable.

Note: Newer models are programmed over the local IP network.

I’m not afraid of serial cables but this is a special Siemens cable which costs as much as a new PLC! This is what you get:

Impressive, isn’t it?

Programming mode

Now it’s time to put your PLC in programming mode. The trick is to shutdown the PLC, plug in the cable into both the PLC and the PC and then powering up the PLC. This will bring up the programming mode:

Note: Later on I found some magic key combinations on the PLC to change the behaviour of my PLC (switching between programming and running or even clearing the PLC).

Software

I use Siemens LOGO!Soft Comfort 8 for this PLC. This is an older version but still sufficient for programming this device.

Once the application starts, checkout the layout:

Automatically, an empty circuit diagram is shown to the right. On this, you can add instructions taken from the left. After placing the instructions of your interest, you can connect them by drawing lines between instruction output points and input points.

But first, you have to tell the LOGO!Soft application which kind of device you have, because this will probably limit the supported instructions. I had to double click on the ‘0BA7.Standard’ at the status bar. In this new dialog, I was able to select the right Hardware type:

It was not intuitive which to choose. Luckily, I had the original package of the PLC with some kind of serial number on it. The last part was 0BA0 which was also in the list. I noticed the number of instructions was drastically reduced; this is an older type of a Siemens LOGO PLC.

Circuit diagram

So I wrote this simple diagram:

The steps are simple:

  1. I take the value from input 1 (false)
  2. I invert it (true)
  3. I send this to a Symmetrical Pulse Generator running at 1 Hz (1 second). It starts due to the incoming ‘true’
  4. If the pulse is ‘true’, output 1 and 3 are ‘true’ too.
  5. If the pulse is ‘false’, output 1 and 3 are ‘false’ too.
  6. The signal coming from the pulse generator are splitted towards output 2 and 4. But that splitted signal is inverted first. Therefor, if the pulse is ‘true’, output 2 and 4 are ‘false’, etc.

Note: Both the NOT and the splitting indicator of a signal are represented by a black sphere.

After that, I only have to program the PLC with this application by transferring it.

Press CTRL-D to start the transfer from PC to PLC:

First, check if the right type of connection is select: the LOGO serial cable.

Then, check if the right serial port (here it’s COM1) is selected.

You can try the TEST button.

Finally, select OK to start the actual transfer.

Once ready, detach the cable and take the power from the PLC.

After you reattach the power to the PLC, it will start executing the application.

Or you can press ESC on the Logo, select Start and press OK:

As you can see, output 2 and 4 are activated. Can you trace this back to which step of the logic shown above?

Note: Do not forget to re-attach the protective cap back on the PLC where the serial cable was attached.

To go back into programming mode, press the LEFT and the RIGHT arrows together with OK on the LOGO. Select PC/Card (OK) and then select PC<->LOGO (OK).

Simulation

The Logo!Soft Comfort also has a nice simulation option. Press F3 to get into the simulation mode:

As an example, I can activate input 1 and the rest of the instruction will stop executing. Once I deactivate input 1, the execution (the switching outputs) will continue again.

Security

While checking out the software, I was shown the ability to transfer the application running on a PLC back into the software application. While this seems a nice feature (if your project gets lost, you can still retrieve it back from a PLC) this is also a potential security risk. A hacker can retrieve the PLC app, alter it and upload it without any security questions as long as he has a time window and physical access to the PLC. Nobody will notice this probably until it’s too late!

Luckely, Siemens has taken some counter measures in the form of this warning text:

Conclusion

Programming a Siemens Logo PLC is pretty easy once you have figured out how to set the LOGO application to the right hardware device.

Of course, this is a very simple PLC. Still, the actual capabilities of this PLC are quite impressive. I leave this in the hands of skilled engineers.

But the limitations are also clear: you need physical access to program it. And the complexity can be as extravagant as the amount of available programming instructions (a couple of hundred).

Adv: Interested in running your own WordPress blog? Click this link

Advertentie

Share this:

  • Twitter
  • Facebook

Vind ik leuk:

Vind-ik-leuk Laden...

Gerelateerd

  • Getagged
  • Logo
  • Logo!Soft
  • Siemens

Gepubliceerd door Sander van de Velde | Microsoft MVP | IoT Solution Architect | Speaker | Maker

I started as an IT consultant in 1993. I like to get my hands dirty with software innovations and I try to implement these in my daily work. Currently, I am involved in the IoT Platform part of Azure (eg. IoT Hubs, IoT Edge, StreamAnalytics, Azure Functions, etc.) and Azure in general. I've been presented with the 2017, 2018, 2019, 2020, 2021, 2022, 2023 Microsoft Most Valuable Professional (MVP) Award and I'm a member of the Microsoft Azure Advisory Board. For me, it is important to share knowledge. And I am committed to doing so by writing blogs, articles for magazines, and giving lots of presentations. When offline, I like cutting down trees using Gränsfors Bruks axes, sailing, motorcycling or geocaching with my wife and my sons. Alle berichten van Sander van de Velde | Microsoft MVP | IoT Solution Architect | Speaker | Maker weergeven

Gepubliceerd 14 oktober 20191 december 2020

Berichtnavigatie

Previous Post IoT sessions at Microsoft Ignite 2019
Next Post Bridging the gap from third party cloud to IoT Central

Recent

  • Does your Azure IoT (Edge) Ubuntu device survive the Baltimore certificate migration?
  • Azure IoT Community, unified edge event with Microsoft Nederland
  • FutureTech event in 2023 (Dutch)
  • Exploring Azure Digital Twins Graph history
  • ADX Kusto plug-in for Azure Digital Twins history

Tags

3D Accelerator Ajax AMS ASP.NET MVC Azure Azure Functions Azure Gateway SDK Azure Portal C# Client Side Validations commands Core DATAJS DDWA Debugging Deployment deployment manifest Devices Device template Device Twin Direct Methods DirectMethods dps edgeAgent edgeHub etag EventData Firmata Functions GABC gpio GPS Grafana I2C Ignite IoT IoT Edge IoT Hub IoTHub Json keynote KnockoutJS Linux Ubuntu metrics Microsoft Moby module twin moduletwin MVC MVVM NRF24L01+ ODATA opcpublisher PowerBi RDP reported properties routes Routing Service tags Shell SignalR SSH Tags Techdays TechEd Teched 2010 TFS The Things Network TPM UDF Unittest VSCODE Watchdog WPF

Category

Twitter

  • Does your @Azure #IoTEdge #Ubuntu device survive the Baltimore certificate migration? See how you can check the cer… twitter.com/i/web/status/1…- 1 day ago
  • Join the @Azure_IoT_Com for a free event about Unified Edge on 09-02-2023 from 1600 till 2000 CET, @microsoftnl Sch… twitter.com/i/web/status/1…- 1 week ago
  • RT @pete_codes: My next book is well under way.... Teehee.. . https://t.co/3nh1lBBOTj- 2 weeks ago
  • The @AzDataExplorer plugin for @Azure Digital Twins offers graph traversal using #Kusto. It gives access to the cur… twitter.com/i/web/status/1…- 2 weeks ago
  • What if you could collect and query historical data of @Azure #DigitalTwins. And join it with Digital Twin graph qu… twitter.com/i/web/status/1…- 1 month ago
Follow @svelde

Archief

  • januari 2023 (4)
  • december 2022 (4)
  • oktober 2022 (2)
  • september 2022 (2)
  • augustus 2022 (4)
  • juli 2022 (2)
  • mei 2022 (4)
  • april 2022 (4)
  • maart 2022 (1)
  • februari 2022 (1)
  • januari 2022 (2)
  • december 2021 (2)
  • november 2021 (4)
  • oktober 2021 (4)
  • september 2021 (4)
  • juli 2021 (6)
  • juni 2021 (4)
  • mei 2021 (5)
  • maart 2021 (2)
  • februari 2021 (2)
  • januari 2021 (4)
  • december 2020 (2)
  • november 2020 (3)
  • oktober 2020 (2)
  • september 2020 (1)
  • augustus 2020 (3)
  • juli 2020 (2)
  • juni 2020 (3)
  • mei 2020 (5)
  • april 2020 (4)
  • maart 2020 (6)
  • februari 2020 (3)
  • januari 2020 (1)
  • december 2019 (4)
  • oktober 2019 (7)
  • september 2019 (1)
  • augustus 2019 (6)
  • juli 2019 (4)
  • juni 2019 (2)
  • mei 2019 (2)
  • april 2019 (2)
  • maart 2019 (1)
  • februari 2019 (3)
  • januari 2019 (4)
  • december 2018 (3)
  • november 2018 (3)
  • oktober 2018 (2)
  • september 2018 (3)
  • augustus 2018 (3)
  • juni 2018 (4)
  • mei 2018 (1)
  • april 2018 (3)
  • maart 2018 (2)
  • februari 2018 (1)
  • januari 2018 (5)
  • december 2017 (8)
  • november 2017 (3)
  • oktober 2017 (2)
  • september 2017 (4)
  • juli 2017 (5)
  • juni 2017 (5)
  • mei 2017 (2)
  • april 2017 (2)
  • maart 2017 (3)
  • februari 2017 (4)
  • januari 2017 (2)
  • december 2016 (3)
  • november 2016 (3)
  • oktober 2016 (5)
  • september 2016 (2)
  • juli 2016 (5)
  • juni 2016 (4)
  • mei 2016 (1)
  • april 2016 (2)
  • maart 2016 (4)
  • februari 2016 (5)
  • januari 2016 (6)
  • december 2015 (2)
  • november 2015 (1)
  • oktober 2015 (2)
  • september 2015 (3)
  • augustus 2015 (2)
  • juli 2015 (1)
  • juni 2015 (4)
  • mei 2015 (4)
  • april 2015 (1)
  • maart 2015 (6)
  • februari 2015 (1)
  • november 2014 (2)
  • oktober 2014 (6)
  • juli 2014 (1)
  • april 2014 (2)
  • oktober 2013 (1)
  • april 2013 (2)
  • maart 2013 (2)
  • februari 2013 (2)
  • januari 2013 (1)
  • december 2012 (2)
  • november 2012 (2)
  • augustus 2012 (1)
  • juni 2012 (6)
  • mei 2012 (3)
  • april 2012 (1)
  • oktober 2011 (1)
  • september 2011 (3)
  • augustus 2011 (1)
  • juni 2011 (2)
  • mei 2011 (2)
  • april 2011 (2)
  • maart 2011 (2)
  • januari 2011 (2)
  • december 2010 (2)
  • november 2010 (4)
  • mei 2010 (1)
  • april 2010 (3)
  • maart 2010 (1)
  • februari 2010 (2)
  • januari 2010 (1)
  • december 2009 (2)
  • november 2009 (2)
  • oktober 2009 (2)
  • juli 2009 (2)
  • maart 2009 (1)
  • februari 2009 (2)
  • januari 2009 (1)
  • december 2008 (1)
  • november 2008 (2)
  • oktober 2008 (2)
  • september 2008 (1)
  • augustus 2008 (2)
  • juli 2008 (2)

RSS

  • RSS - Berichten
  • RSS - Reacties
Maak een gratis website of blog op WordPress.com.
Privacy en cookies: Deze site maakt gebruik van cookies. Door verder te gaan op deze website, ga je akkoord met het gebruik hiervan.
Voor meer informatie, onder andere over cookiebeheer, bekijk je: Cookiebeleid
  • Volg Volgend
    • Sander van de Velde
    • Doe mee met 47 andere volgers
    • Heb je al een WordPress.com-account? Nu inloggen.
    • Sander van de Velde
    • Aanpassen
    • Volg Volgend
    • Aanmelden
    • Inloggen
    • Korte link kopiëren
    • Deze inhoud rapporteren
    • View post in Reader
    • Beheer abonnementen
    • Deze balk inklappen
 

Reacties laden....
 

    %d bloggers liken dit: