Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommendations for a cheap serial device

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.

like image 681
Stephano Avatar asked Oct 01 '10 17:10

Stephano


2 Answers

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:

  • Linux: http://www.dest-unreach.org/socat/
  • Mac: http://members.iinet.net.au/~mgl/MartysPlace/MultiCom.html
like image 111
Grodriguez Avatar answered Sep 29 '22 21:09

Grodriguez


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.

like image 25
Philip Tinney Avatar answered Sep 29 '22 22:09

Philip Tinney