Technical Articles
SAP MII and Weighbridge\Weigh scale (RS232 Port) Integration via Plant Connectivity
Integrating with weighbridge or weigh scale machines with SAP system is a common scenario in shop-floor integration. Data from these machines such as quantity of produced material or quantity of outbound\inbound delivery need to be read and integrated with SAP system. 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 . I am sharing the link of hardware I have used for this purpose. Please make sure that your weighbridge \ weigh scale is compatible with the hardware before you buy. It is important to know, what is the protocol 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 a 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 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.
Following are the steps to read data from TCP socket using Pco.
- 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
Adding Source System
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 defined. 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
Add Agent Instance
4) Select the Agent you created and move to Subscription Items tab. Then click on Browse for Tags button at bottom
Subscription Items
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 given above in General Settings). Then click on Add Selected Items
Browse Message
6) Select your Agent from the list , right click on it and select Add Notification . Then move to Output tab and click on Generate expression button at the bottom. This will add a new expression row as mentioned in below screen shot.
Generate Expression
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 is having a input property defined to receive the data streaming from TCP socket.
Add Destination
8) Once all 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 respective destination.
In summary this blog explains how to integrate weighbridge\weigh scale (with RS232 Port) with MII via Plant Connectivity. In order to achieve this an additional hardware required to convert serial data to TCP sockets. If you would like to know more about creating TCP Socket and Agent Instances please go through the below SAP documentation URLs.
How to create a Source System in Pco
How to create an Agent Instance
Please provide your valuable feedback , comments and suggestions
Hi Shaji,
Glad to see you got it too work.
Kevin
Yes Kevin, thanks for your support
Hi Shaji,
This is a very useful blog.
We are trying to connect an MT Scale using SAP PCo. We have started using the RS232 port to TCP\IP convertor and trying to send the command to Scale using PCo query but not getting back any response.
What can be options to try?
Suresh,
I have not tried yet to send the command to scale. I only tried to read the weight from weigh bridge.
Sorry I have not tried other way.
Thanks
Shaji
Thank you for the prompt response. What is the weight bridge? is this something at scale end or PCo?
Hi Shaji - Thanks for the explanation here. Could you clarify if this is with SAP ECC or HANA S/4? Can this be done on ECC?
Thanks
Varun
Hi Varun,
I am looking to do this for S/4 PCE and came across this post from another colleague Weigh Bridge integration in S/4HANA Public Cloud | SAP Blogs
The solution described involves writing a node.js script communicating via SAP Cloud Connector (available with a default BTP account) see article for more details.