Integrating with weighbridge or weigh scale machines with SAP system is a common scenario in shop-floor integration. Reading data from weighbridges or weigh scales is crucial in the manufacturing industry for a multitude of reasons, impacting everything from cost control and efficiency to safety and compliance. Manufacturers need to precisely track incoming raw materials to ensure they receive the correct quantities from suppliers. This prevents discrepancies, helps with accurate billing, and ensures production is not halted due to material shortages. For outgoing products, accurate weight data is essential for billing customers correctly, managing shipping costs, and maintaining accurate records of what has left the facility. This makes weighbridge integration very crucial in WMS and SD modules.
In this blog I am showcasing how SAP MII can connect Weighbridge\weigh scale using RS232 port via SAP Plant Connectivity. In order to achieve this, we need to purchase additional hardware which converts RS232 port to TCP\IP. Please make sure that your weighbridge \ weigh scale is compatible with the hardware before you buy. It is important to know what the protocol is being used to transmit the data via RS232. It could be a Modbus RTU or plain serial data. In my case it is plain serial data, so I purchased hardware which converts serial data into TCP sockets. Installation of this hardware is pretty straight forward; you can follow the steps mentioned in the documentation and get it done. Once you complete the hardware installation, it is going to give you an IP address and port where the data from the weighbridge is going to stream. You can use SAP Plant connectivity (SAP Pco) to read the data from this IP address using TCP socket connection.
System Architecture Diagram
The following are the steps to read data from TCP socket using Pco.
1)Create a source system through menu Plant Connectivity-> New-> Source System
Select Source System Type as Socket Source System, Give the name and description as you prefer
2) Provide the details at General Setting. Provide Name, IP Address, Port, Terminator or Length.
Data streams are divided into individual strings using a terminator or a message length you define. In my case I have mentioned a terminator as @ General Settings
3) Add an Agent Instance through menu Plant Connectivity-> New -> Agent Instance
Select the Source System as the one you created above. Give a name to Agent Instance
4) Select the Agent you created and move it to Subscription Items tab. Then click on Browse for Tags button at bottom.
5) In Browse window click on the Browse button at top right side which will display the Address root node. Expand the Address Root Node and select the Data Item (Data is the name you have given above in General Settings). Then click on Add Selected Items
6) Select your Agent from the list, right click on it and select Add Notification. Then move to the Output tab and click on Generate expression button at the bottom. This will add a new expression row.
7) Open Destination tab and click on Add Destination System. You may select the destination system where you want to stream the data. In my case I am selecting MII destination (MII server should be added as a destination system earlier). After that you can browse the transaction (BLS) from MII server, and which has an input property defined to receive the data streaming from TCP socket.
8) Once all the above steps are completed, please ensure to start the agent instance you created. This will allow the agent to start looking at the messages which are being received at TCP Socket and send the notification to their respective destination.
Challenges
1. Different weighbridges send different signals (data format). It was difficult to identify the meanings of different characters in the signal. We had to connect to the weighbridge vendor and understand this.
2. There is a sporadic network drop between weighbridge and SAP Pco due to network fluctuation at site which will disrupt the data flow.
3. SAP Pco Socket connection provides an option to check the connection on regular interval and restore it as required. This feature helped us to restore the connection automatically.
4. Some weighbridge models do not support auto-restoring connection. For those we have provided a Restart service which will restart the Pco agent and resumes the connection.
5. S/4 HANA screen cannot display real-time data
6. Ensuring low latency
Summary
In summary this blog explains how to integrate weighbridge\weigh scale (with RS232 Port) with MII via Plant Connectivity. In order to achieve this, the additional hardware required to convert serial data to TCP sockets.