tags:

views:

647

answers:

3

I'm trying to figure out a method of connecting from C# code to a digital scale. The particular scale is an Ohaus SP202 digital scale which comes with a USB connection. I would like to read the weight measured on the scale programmatically. I don't have the scale yet, I'm just doing the research before hand.

Has anyone done this before? I've been doing research on the internet and didn't find anything worth mentioning yet.

+1  A: 

I haven't used that specific scale, but I have connected to other digital scales previously. Basically it is usually just doing serial communications via the USB to Com converter.

If the scale has an API for this all the better, but if not then you will just be using System.IO.Ports.SerialPort which is pretty standard serial programming. A starter article here

KiwiBastard
Second that. I have also done it against an industrial scale and all it takes is some serial communications and reading the manual to the scale to get the messages correct.
Stefan
A: 

I don't know any details on this scale, but I've done some USB stuff.

Its most likely using usb interrupt to transfer the data. All usb mice also use interrupt, so if you can figure out how to read the mouse signal (with using an HID api), then it should be exactly the same as the scale, except the data format returned would be completely different.

run on ftw

Pyrolistical
Very often the USB-device of this sort adds an emulated com-port so Its just as easy as if it was an scale connected to the ra232-port.
Stefan
actually it's more likely that data send over bulk pipe. excluding hid the interrupt pipe used for notification and not for data transfers. Data acquisition devices use bulk pipes if properly designed.
Ilya
+3  A: 

USB Hardware communication popularly works one of three ways.

  1. Proprietary software talks to hardware via proprietary driver.

  2. Devices have a Serial emulation chip (e.g. FTDI) When you plug in the scale you just need to install the Virtual Comm Port drivers and the device shows up as a comm port on your system. Then it is as easy as using System.IO.Ports.SerialPort to talk to the device.

  3. The device implements a HID profile and will be available through your OS's HID system. I've used this .NET HID library on Windows to successfully talk with barcode scanners that implement HID. The HID library will send data to you from the hardware in chunks that you decipher based on the hardware you are talking to.

With method 2 and 3 you will just need to find the data format for the scale that you are talking to. The scales that I have used send updates every second or so with the weight and other information shown on the hardware UI, such as if the load has stabilized or not.

Looking at their discussion forums it looks like their scales use method 2 (http://ohaus.com/support/forum_messages.asp?topicid=584) and that you need to Poll the scale by sending a "P\r\n" it will then respond with the characters that are shown on the display (http://ohaus.com/support/forum_messages.asp?topicid=802).

joshperry