Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

OC in Argentina - Low-level programming in the factory

43 views

Published on

Vortragsfolien vom Digital Xchange 2019, weitere Informationen auf digital-xchange.de

Published in: Technology
  • Be the first to comment

  • Be the first to like this

OC in Argentina - Low-level programming in the factory

  1. 1. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlich  Überraschend mehr Möglichkeiten © OPITZ CONSULTING 2019 Low-level programming in the factory Stephan Rauh OC in Argentina
  2. 2. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlichWelcome Days – Strategie@OC Mission Mit unserer Leidenschaft für neue Technologien und unserem Anspruch an herausragende Beratung sind wir bei unseren Kunden der Motor der digitalen Transformation. Wir entwickeln überraschend mehr Möglichkeiten!» Seite 2
  3. 3. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlich Seite 3 … in Argentina Image source: Wikimedia (CC BY-SA 3.0) Let‘s Control the Assembly Line!
  4. 4. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlichPLC programming for Java developers Seite 4 What is a PLC? Image source: https://de.wikipedia.org/wiki/Speicherprogrammierbare_Steuerung#/media/File:Programmable_logic_controller.jpg
  5. 5. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlich Seite 5 Controlling Hardware Half a World Remote Image source: https://pixabay.com/de/illustrations/welt-karte-weltkarte-erde-mercator-2169041/ (Pixabay license); https://en.wikipedia.org/wiki/File:Server-multiple.svg
  6. 6. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlich Seite 6 Performance Image source: https://pixabay.com/de/illustrations/welt-karte-weltkarte-erde-mercator-2169041/ (Pixabay license); https://en.wikipedia.org/wiki/File:Server-multiple.svg 12.000 km / 300.000 km/s = 40 milliseconds real-world latency: ≥ 75 ms 133 network calls: ≥ 10 seconds
  7. 7. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlichPLC programming for Java developers Seite 7 Programming a PLC 1. Reading input registers and coils 2. Executing the program 3. Processing communication requests 4. Executing CPU diagnostics 5. Writing output registers and coils
  8. 8. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlichPLC programming for Java developers Seite 8 Registers and Coils Coils little endian read- only big endian Registers memory address
  9. 9. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlichPLC programming for Java developers Seite 9 Java Modbus Adaptor JBoss Application Server PLCModbus Adaptor Modbus TCP SOAP over JMS • 12.000 km distance • cyclic polling
  10. 10. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlichPLC programming for Java developers Seite 10 Putting our project in perspective Manufacturing Execution System running on: • JBoss Application Server • JBoss Fuse ESB • Active MQ • SOAP over JMS • Much more
  11. 11. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlichPLC programming for Java developers Seite 11 Modbus Library How to speak Modbus/TCP?  Implement the protocol from scratch  Possible but tedious  Buy a library  There ain’t none!  At least not for Java  Use an open source library  Many C++-based libraries  … but we’re not familiar with JNI  Found a Java library at https://github.com/klymenek/modjn
  12. 12. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlichPLC programming for Java developers Seite 12 Getting started with the Modbus Library  Modjn offers a fairly simple API  Got up to speed quickly  We added a small abstraction Java-friendly layer
  13. 13. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlichPLC programming for Java developers Seite 13 Modbus Library surprises  Most Modbus libraries have been written by engineers  Not software developers ☺  If it runs, it’s good  Modjn is great for proof of concepts  Not reliable in the long run  Errors piled up:  Lost messages,  wrong messages  Many reconnects  Performance problems (150+ messages in a 10 second time frame)
  14. 14. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlichPLC programming for Java developers Seite 14 Modbus Library surprises  We started to analyze and dissect the library  Modjn offers a synchronous API using asynchronous Netty  We could have sent the 150+ messages in parallel!  But switching to async wasn’t an option  We forked the library to make it more resilient  Tried to contact the author  No response  Conclusion: We’re using an abandoned library!  Luckily it’s simple  We can maintain it ourselves Unexpected project risk!
  15. 15. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlichPLC programming for Java developers Seite 15 Talking past Each Other Image source: Wikipedia (public domain)
  16. 16. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlichPLC programming for Java developers Seite 16 Talking at Cross Purposes 0x0030 0x0060 0x0090 MVSK NGA LGL ONT moveSkid() dropItem() pickItem() Image source: https://commons.wikimedia.org/wiki/File:Mailbox.svg published under a CC BY-SA 3.0 license WebService names Legacy telegram names What’s really happening
  17. 17. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlichPLC programming for Java developers Seite 17 Mailboxes 0x0030 0x0060 0x0090 Telegram 1 Telegram 2 Telegram 3 Telegram 4 Image source: https://commons.wikimedia.org/wiki/File:Mailbox.svg published under a CC BY-SA 3.0 license
  18. 18. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlichPLC programming for Java developers Seite 18 Mailboxes 0x0030 0x0060 0x0090 Telegram 1 Telegram 2 Telegram 3 Telegram 4 Memory address content 0x0060 Command ID 0x0062 Skid Number 0x0063 Target position 0x0064 … Image source: https://commons.wikimedia.org/wiki/File:Mailbox.svg published under a CC BY-SA 3.0 license
  19. 19. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlich Seite 19 Any Questions?  It's your turn! PLC programming for Java developers
  20. 20. © OPITZ CONSULTING 2019 Informationsklassifikation: öffentlich  Überraschend mehr Möglichkeiten @OC_WIRE OPITZCONSULTING opitzconsulting opitz-consulting-bcb8-1009116 WWW.OPITZ-CONSULTING.COM Seite 20 Let‘s make the web a place to be! Stephan Rauh CC „moderne Clients und agile Architekturen“ 0172-205 59 66 Stephan.Rauh@opitz-consulting.com @beyondjava http://www.beyondjava.net PLC programming for Java developers

×