views:

74

answers:

4

I'm going to need to integrate a Java application that I wrote with a medical device that uses a serial port for communications. This device is rather expensive, and also not so portable.

I'd like to be able to test code wherever I happen to be, but you can only do so much before you need to plug in your serial device and start testing.

So, I'm looking for a cheap, portable electronic device that uses a serial port for communication. It only needs to communicate one way (i.e. I only need to collect data from it). In this way, I can be sitting at my local coffee shop, plug in my serial to USB connector, hook up this mystery device, and start receiving data.

EDIT:
For those interested in my strange predicament, I'm connecting to a Tanita scale TBF-300A
web site
Communication Standard: EIA RS-232C Compatible
Communication Method: Asynchronous
Baud Rate: 2400bps
Data Length 7bits
Parity: EVEN
Stop Bit: 1bit

Someone scans a barcode, steps on the scale, and my program feeds the info into a database like this:
adobe air -> blazeds -> java -> hibernate/spring -> HSQL db file

My guess is that I'm going to write a java app that takes the serial port information and redirects it to a TCP port that my air app can listen to. This is my guess, for now.

A: 

I'm pretty sure that you have a computer already!

There are usb to serial cables which might do the trick. Just loop from your own motherboard serial port to a usb port.

Eric
I've got a USB to serial cable, but I don't have a portable device that will send information down that cable to my computer. That's the part I want to test, receiving the information.
Stephano
+1  A: 

You might look at some sort of Microcontroller dev board. An Arduino or an MSP430 probably would fit the bill. You will need to write a small amount of code for it, but you could get it to send exactly what you want.

Philip T.
+1 I looked into Arduino but not the MSP430. Thanks for the link!
Stephano
+5  A: 

You might want to look at com0com. This lets you create virtual COM ports on your computer and connect them together in pairs. With this, you can write a small test application that emulates the behavior of your "mystery device" and writes data to one of these virtual COM ports, and have your other application read data from the other COM port.

With this setup you can do any testing that does not require plugging the actual medical equipment, without purchasing any external device. To your application it will look like a real COM port.

Edit:

com0com is Windows-only, but here are some alternatives for non-Windows platforms:

Grodriguez
Interesting idea... I'm programming on a Mac and my other machine runs Ubuntu. Would this still work for me?
Stephano
com0com itself is Windows-based, but you can do the same on Linux (e.g. http://www.dest-unreach.org/socat/) and Mac (e.g. http://members.iinet.net.au/~mgl/MartysPlace/MultiCom.html).
Grodriguez
+1 Awesome idea. Thanks for all the links and info!
Stephano
+1  A: 

Do you need to actually have an external hw device... can you get away with using a serial port emulator (ex: http://com0com.sourceforge.net/)?

chrismh