推荐便宜的串口设备 [英] Recommendations for a cheap serial device

查看:49
本文介绍了推荐便宜的串口设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将我编写的 Java 应用程序与使用串行端口进行通信的医疗设备集成.这个设备相当昂贵,也不那么便携.

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.

因此,我正在寻找一种使用串行端口进行通信的廉价便携式电子设备.它只需要以一种方式进行通信(即我只需要从中收集数据).通过这种方式,我可以坐在我当地的咖啡店,插入我的串口转 USB 连接器,连接这个神秘设备,并开始接收数据.

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.


对于那些对我的奇怪困境感兴趣的人,我将连接到 Tanita 秤 TBF-300A
网站
通讯标准:EIA RS-232C 兼容
通讯方式:异步
波特率:2400bps
数据长度 7bits
奇偶校验:偶数
停止位:1bit


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

有人扫描条形码,踏上秤,我的程序将信息输入到数据库中,如下所示:
adobe air -> blazeds -> java -> hibernate/spring -> HSQL db 文件

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

我的猜测是,我将编写一个 Java 应用程序,该应用程序获取串行端口信息并将其重定向到我的 air 应用程序可以侦听的 TCP 端口.这是我目前的猜测.

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.

推荐答案

你可能想看看 com0com.这使您可以在计算机上创建虚拟 COM 端口并将它们成对连接在一起.有了这个,您可以编写一个小型测试应用程序来模拟您的神秘设备"的行为并将数据写入其中一个虚拟 COM 端口,并让您的其他应用程序从另一个 COM 端口读取数据.

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.

通过此设置,您可以进行任何不需要插入实际医疗设备的测试,而无需购买任何外部设备.对于您的应用程序来说,它看起来就像一个真正的 COM 端口.

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.

com0com 仅适用于 Windows,但这里有一些适用于非 Windows 平台的替代方案:

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

这篇关于推荐便宜的串口设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆