Skip to Content
Author's profile photo christian libich

Industrial Label Printing with MII?

Often there will be a label printing requirement as part of an MII implementation. Possible solutions range from commercial offerings from Bartender or Loftware, writing a custom action or jsp in MII, or simply having the user print from their workstation. Well with the release of MII version MII14.0 SP4 Patch 3+ and the new ability to push messages from MII over a socket connection thru PCo as discussed here: , there is now another option. This is because the Intermec and Zebra type industrial label printers we often find in shop floor environments have the ability to receive print commands directly via a socket connection. I will walk thru a simple example you can use as launching point for you own investigations. If you are new to PCo or are looking for more information I suggest starting with the PCo application help here:

To begin open the PCo Management Console and create a Socket Agent type source system.


Configure a Communication Port to connect to the printer. Set the Length to 1 so all messages from MII will be pushed to the printer.


Now create an Agent Instance for our Socket Agent Source system.


Configure the Query Port so MII can connect to our Agent.


Now Start the Agent and also make sure the PCo Management Host service is running.

Now we need to configure a PCo Data Server connection in MII.

From the MII Admin Menu navigate to Data Services –> Data Servers and create a new PCoConnector connection.




Now that we have a connection we can create a PCo query to send our print commands to our printer.

In the MII workbench create a new PCo query and select our new connection as the  server and TagFixedQuery as the mode.


On the Tag Fixed Query tab you will use something like the following:

CALL SEND(address=’123.456.789.101′, port=’9100′, message=’FT \”Swiss 721 BT\”




Your actual address, port and message will differ based on your specific printer.


We can now run the query in the workbench. If all goes well we should get a successful return code (0) and a nice label should print.


And here it is:


Of course an actual implementation would take a bit more planning and development than the simple solution demonstrated here. I hope many of you will be able to take advantage of this new functionality. Please let us know if you do.


Update: 2/25/2015 SAP has added integration with NetWeaver Adobe Document Services that can provide another printing option.

ADS Printing – SAP Manufacturing Integration and Intelligence – SAP Library

A version of this blog was published here

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Steve Stubbs
      Steve Stubbs


      Nice article and a great use of the functionality of the PCoQuery TagFixedQuery mode.

      Regards, Steve

      Author's profile photo Former Member
      Former Member

      Hi Christian,

      Thanks for sharing the knowledge.


      Rohit Negi.

      Author's profile photo darshan sheth
      darshan sheth

      Hi Christian,

      Nice and useful article. We have a custom action block that currently triggers the printing of tickets from MII to Zebra printers. We are now looking to replace it with PCo tag query.

      I did try replicating the steps that you have provided above and was able to print ticket.

      One issue that i am facing is on PCo side, where i have one agent linked to the socket agent and others are linked to kepware agents. I can activate multiple agent instances that are connected to the kepware source agent, but when i try to Start the agent instance that is connected to Socket source agent, i get the error "Error starting agent instance. [Only one usage of each socket address (protocol/network address/port) is normally permitted]".

      Is it that we cannot have two different agent instances activated at the same time or there is some configuration/setting to avoid this.

      Author's profile photo christian libich
      christian libich
      Blog Post Author

      Are you asking if you can have multiple agent instances connected to a single socket agent source system? If so I don't know I never tried. If I get a chance I will try it.  

      Author's profile photo Steve Stubbs
      Steve Stubbs

      Hi Darshan,

      The connections defined in a Socket Agent are opened when the associated Agent Instance is started. So if you define two or more Agent Instances referencing the same Agent, both instances will attempt to open the defined connections to the server.  Unless the server is designed to support multiple connections to the same port the second connect attempt will fail with a Connection Refused error.

      The error you get stating "Only one usage of each socket address (protocol/network address/port) is normally permitted" is due to the fact that you have the same port defined in the Query Ports tab of two or more agent instances.

      Note that the CALL SEND() custom function, used in the PCoQuery TagFixedQuery mode, will allow you to send the data to a different IP address and port than is defined in the Source Agent as long as PCo can route to the IP address. So you can define a single Socket Agent Instance in PCo and use it through MII to write socket data to different destinations (in Christians case, printers...).

      Regards, Steve

      Author's profile photo Paul Radulescu
      Paul Radulescu

      Awesome article and _very_ useful while using smart printers! I guess it's time to move out of the Kepware / RS232 and/or Bartender monitored processes!

      Author's profile photo Former Member
      Former Member

      Great article! I'll be trying this out myself.

      Author's profile photo Swaroop Anasane
      Swaroop Anasane

      Thanks Christian. Another nice article.

      Warm Regards,


      Author's profile photo Ruchir Batra
      Ruchir Batra

      Thanks for the article. It's really simple straightforward and enriching everyone's knowledge with small simple example everyone can relate to..

      Author's profile photo Former Member
      Former Member

      I want to try this example SAP MII Installation has been done. I am able to open workbench  but I am  unable to find out  How to open PCo Management Console  ?

      Author's profile photo Shridhar Nagarhalli
      Shridhar Nagarhalli

      Hi Ankit,

      Have you installed PCo? If not, refer

      Refer Installation Guide