Skip to Content
Technical Articles
Author's profile photo Dominik Tylczynski

Free, open source PLC emulator for SAP EWM MFS

Introduction

PLC Sim is a free, open source, platform independent tool to test SAP EWM MFS connectivity and facilitate SAP EWM MFS implementation projects.
The software has been made available under copyleft GNU Affero General Public License v3.0

Main Features

The current release of PLC Sim supports:

  • Optional automatic telegram acknowledgment with handshake response
  • Optional LIFE telegrams filtering
  • Multiple communication channels
  • Structural display of telegrams with dynamic determination of the telegram structure from SAP data dictionary
  • Direct TCP/IP (ABAP Push Channel) and SAP Plant Connectivity PLC communication layers
  • Configurable handshake request and response indicators
  • Configurable telegram structure
  • Configurable switching of sender and receiver fields in handshake response telegrams
  • Configurable telegrams logs styling based on telegram types and handshake indicators
  • Application logging implemented with Apache log4j2 library

Architecture and Usage

PLC Sim consist of two independent Java applications working together

PLC simulation application

It implements a TCP/IP server that receives and sends telegram messages either directly to SAP EWM MFS through ABAP Push Channel or indirectly through a RFC connectivity adapter like SAP PCo or TCP/IP-RFC bridge that is part of the project.

The application is implemented with the Sim class and is operated with a single window:
SAP EWM MFS PLC

Double click on a telegram line brings a structural telegram display/edit dialog:
SAP EWM MFS PLC

TCP/IP-RFC bridge

The bride implements an intermediate communication layer between SAP RF and TCP/IP server. The application is implement with the Bridge class. It is started with two arguments:

  • RFC server Id as defined with a .jcoServer properties file – refer to SAP JCo documentation on how to define it
  • the application configuration properties file

While running the bridge supports the following console commands:

  • help, ? – displays help message with supported commands
  • status – prints the RFC server and communication channels statuses
  • stop, exit, bye – stops and exits the bridge

The commands are case insensitive.

Current Limitations

  • PLC communication layer type B “Proprietary Communication Layer” is not supported yet
  • One telegram structure only – all telegram types have to have the same structure
  • Channel synchronization is not implemented yet
  • PLC Sim is not localized yet. English version is implemented.
  • Life telegram has to be of LIFE type.
  • Login credentials for SAP Java Connectors need to be defined in a JCo properties file.

Acknowledgments

I would like to express my deepest gratitude to:

This project would have not been possible without them.

GitHub repository

The project is available on GitHub in the repository mfs-plc-sim

It is still in its infancy and being actively developed. I would appreciate any comments, feature requests or bug notifications – post them with GitHub issues.

!!!Contributors are most welcome!!!

Assigned Tags

      20 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Daniil Mazurkevich
      Daniil Mazurkevich

      Looks good, Thanks Dominik.

      Author's profile photo Dominik Tylczynski
      Dominik Tylczynski
      Blog Post Author

      Thank you! Please spread the word as an open source project won't thrive without the community support and contribution.

      Author's profile photo Lothar Streb
      Lothar Streb

      In the limitations I see the following:

      • One telegram structure only – all telegram types have to have the same structure

      Is this a limitiation

      • in general, or
      • per PLC, or
      • per PLC and Communication Channel

      ?

      Kind Regards for your answers

      Lothar

      Author's profile photo Dominik Tylczynski
      Dominik Tylczynski
      Blog Post Author

      Hello Lothar Streb

      For now the limitation is general. It means that the emulator doesn't allow to reflect different telegram structures as defined in SAP EWM-MFS configuration: SCM Extended Warehouse Management -> Extended Warehouse Management -> Material Flow System (MFS) -> Telegram Processing -> Define Telegram Structure.

      That is one of the features to be implemented. I am here in a bit of Catch 22 situation. The emulator interprets telegrams with JCoStructure functionality. I need to know a telegram structure as defined in SAP Data Dictionary to determine its type from the TELETYPE field. On the other hand if I allow different structures per telegram type, then I need to determine the telegram type before creating JCoStructure. I have a rough idea of how to solve the issue, but I'd appreciate any insights of yours.

      Best regards

      Dominik Tylczynski

      Author's profile photo Lothar Streb
      Lothar Streb

      Hello Dominik Tylczynski,

      in SAP EWM you define a telegram header structure on PLC level which is similar for all telegram types. The header structure contains information like sender, receiver, sequence no and also the telegram type.

      Based on the telegram type the overall telegram structure (header and data) can be defined.

      So on receiving a telegram, first the telegram type is determined out of the telegram header and than the received telegram is moved to the overall telegramm structure which is configured for the telegram type.

       

      Kind Regards

      Lothar Streb

      Author's profile photo Dominik Tylczynski
      Dominik Tylczynski
      Blog Post Author

      Thank you Lothar Streb

      I'm putting that on my to-do list - to implement different PLC types / interface types in the emulator. For now, I'm only concerned with different communication channels.

      Hope this project will get off the ground and fly high.

      Author's profile photo Shaikh Masir
      Shaikh Masir

      Hello Dominik Tylczynski,

      Where can i find PLC SIM EMULATOR file to download ? Can you guide me.

       

      Best regards

      Shiakh Masir

      Author's profile photo Dominik Tylczynski
      Dominik Tylczynski
      Blog Post Author

      Hello Shaikh Masir

      The source code of the emulator is made available in the GitHub repository - https://github.com/dominik-tylczynski/mfs-plc-sim

      You need to clone the repository, install SAP JCo and build the application yourself. The process is as follows:

      1. Download and install SAP JCo - https://support.sap.com/en/product/connectors/jco.html?anchorId=section_2129803369
      2. Clone the emulator source code to your favorite Java development environment. I like to use Eclipse.
      3. Add SAP JCo as an external library to the Java project.
      4. Download, install Apache log4j2 library and add it to the project or use provided pom.xml file to get the library from Maven central repository.
      5. Build, run, enjoy.

      I'll update the README file with detailed description of the build process.

      Best regards

      Dominik Tylczynski

      Author's profile photo Simon Scheuring
      Simon Scheuring

      Hey,

      the tool is a nice idea.  For me as a non  Java Expert ist was really hard to launch the application.

      With help of an experienced java devolper - we made it.

      This comment was really helpful.

      Dominik Tylczynski : I would be very helfpul to have more details about to install or let's better say launch the application. Maybe you can add there something inside your blog posts. Thanks

      Author's profile photo Dominik Tylczynski
      Dominik Tylczynski
      Blog Post Author

      A blog on how to build and run the emulator is on my to do list. Stay tuned.

      Author's profile photo Dominik Tylczynski
      Dominik Tylczynski
      Blog Post Author

      Simon Scheuring Here it is: How to setup and run PLC emulator for SAP EWM MFS

      Author's profile photo Marek Kamiński
      Marek Kamiński

      Hello Dominik,

      It's a really impressive solution. Thank you for sharing your tool!

      You probably never rest 🙂 the better for all of us 😉

       

      Best Regards,
      Marek

      Author's profile photo Dominik Tylczynski
      Dominik Tylczynski
      Blog Post Author

      It do rest when having fun - cranking up projects like that is so much fun  🙂 🙂 🙂

      Author's profile photo Hendrik Schulte-Bahrenberg
      Hendrik Schulte-Bahrenberg

      Hi Dominik,

      great initiative! I think this is the way forward. If everybody would open source some of his/her enhancements we could make much larger steps towards a more advanced warehouse management environment based on EWM. I am happy that my blogs could provide some useful input here.

      Will explore your tool for sure once I find the time!

      Regards,

      Hendrik

      Author's profile photo Dominik Tylczynski
      Dominik Tylczynski
      Blog Post Author

      Hi Hendrik,

      I could not agree more. Just imagine a SAP space with enhancements marketplace like Eclipse plugins or central repository of ABAP developments like Maven. That would be so cool. Maybe SAP will embrace that idea?

      Let me know your thoughts once you had time to review the emulator. I definitely want to continue with it.

      Best regards

      Dominik

      Author's profile photo Hendrik Schulte-Bahrenberg
      Hendrik Schulte-Bahrenberg

      ...unfortunately it does not look like they are going that way. I've been waiting since years already for the 'App Store' for EWM where developers worldwide can offer/sell their enhancements/apps/add-ons and compete with the big consulting companies on one level.

      At the end would still be a net benefit for all parties involved in EWM projects. Right now the EWM community is implementing the same enhancements over and over again in parallel at different projects worldwide.

      Not very efficient. I guess at one point in time some company/startup will evolve and disrupt this space...

      Author's profile photo Dominik Tylczynski
      Dominik Tylczynski
      Blog Post Author

      Indeed they don't. I guess being software provider they don't see much value in that. Especially now with rush-to-the-cloud frenzy and "keep the core clean". In my opinion app store won't do here as it is more for ready made applications not for reusable enhancements.

      One approach could be to open enhancements on GitHub and have them published for instance on ABAP Open Source Projects repository.

      Author's profile photo Hendrik Schulte-Bahrenberg
      Hendrik Schulte-Bahrenberg

      ...might be one way. Question is whether this will thrive without monetary incentives. Probably not.

      I was rather thinking about some talented freelancing developers/consultants without direct access to projects developing Fiori-Apps, RF transactions, FMs for new monitor nodes etc. and sell those in an app-store.

      We will see. Maybe I think to simple here...

      Author's profile photo Wojciech Walczak
      Wojciech Walczak

      sounds very promising but I see a lot of arguments against it... truly speaking I do not imagine that a huge corporation with milions $ budgets on the logistics solution buys something that is not "official approved", tested, signed by SAP with quality assured.  I know SAP solutions are not always providing that, but the corporations stick to the rules...

      Author's profile photo Hendrik Schulte-Bahrenberg
      Hendrik Schulte-Bahrenberg

      ...I am not sure about this. There could be certificates for uploaded add-ons / developments. There could also be some kind of user reviews / ratings to qualify for good solutions. Contributers would gain credibility this way. Why do you think an app-store for apple is working but this should not for SAP?

      In any way I found this to be very risky not to give it a try from SAP perspective. Their moat is still huge but technology is moving quicker than ever and they will be attacked by small disrupters. Not sure whether they offer enough innovation to save their moat in the long term...