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
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 @
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 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 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 Output tab and click on Generate expression button at the bottom. This will add a new expression row as mentioned in below screen shot.
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.
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.
Please provide your valuable feedback , comments and suggestions