Skip to Content
Technical Articles
Author's profile photo Shaji Chandran

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.

  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

Adding%20Source%20System

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%20Settings

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%20Agent%20Instance

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%20Items

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%20Message

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%20Expression

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%20Destination

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

 

 

 

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Kevin Hunter
      Kevin Hunter

      Hi Shaji,

      Glad to see you got it too work.

      Kevin

      Author's profile photo Shaji Chandran
      Shaji Chandran
      Blog Post Author

      Yes Kevin, thanks for your support

      Author's profile photo Suresh Andhale
      Suresh Andhale

      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?

      Author's profile photo shaji chandran
      shaji chandran

      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

       

      Author's profile photo Suresh Andhale
      Suresh Andhale

      Thank you for the prompt response. What is the weight bridge? is this something at scale end or PCo?

      Author's profile photo Varun Anand
      Varun Anand

      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

      Author's profile photo Alp Mahavera Mohamad Shakir
      Alp Mahavera Mohamad Shakir

      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.