Sunday, February 9, 2014

Interfacing to a Mettler Toledo PS60 using USB

Recently, I came across a scenario where I had to interface to a USB Mettler Toledo PS60 Scale. There are some scales in the market that work as a Keyboard Emulator (Wedge) out of the box but MT PS60 is not one of them and there is no special windows driver or tool. It can either function as a RS232 Serial device or a USB Human Interface Device (HID) with it's own proprietary protocol. I know I could have used a RS232 to Keyboard Emulation utility like TWedge but then I had to use another adapter for USB to Serial conversion and since not many PCs are equipped with a Serial Port these days I decided to go a different route. Here is what I end up doing:

MT (the manufacturer) has a nice FTP site with a few great published .NET demo applications and documents. One MT provided demo application is called HIDPOSScaleApp. This App connects to a MT PS scale (many different models) and receives weight information and displays it on screen. I simply modified it so it would emulate weight as a keyboard entry after scale stabilizes. This can be very useful if your application does not natively support scale integration. For instance you can enter weight in Excel Sheets etc.

You can download this application from here and place it in a directory. Make sure you have the Microsoft .NET runtime 3.5 installed.

When you execute this application, it should display your USB connected scale as shown below:



Make sure your scale is zero'ed out and showing Zero on the LCD display:





Select your Scale and click on "Open Device" button. It should immediately minimize itself under taskbar:



Now if you open any other application (Excel in my case), If would automatically "Key In" the weight information where your cursor is located. This is done immediately after weight is stabilized:




By default, it presses ENTER after wight information. You can change the "End of String" EOS value to TAB or SPACE or custom string:



That's it! Try it out and let me know if you have any questions. 

Please note that this application 100% based on MT Demo App mentioned above. All I did was to include a keyboard emulation feature.  All credits go to MT and their developers. 

Also, please remember that, as always, standard disclaimers apply. Please backup your system, Save settings, and other common precautions before trying anything new...


3 comments:

  1. Is this application still available for downloading? thanks,

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete