如何使用JAVA将数据发送到COM PORT? [英] How to send data to COM PORT using JAVA?

查看:119
本文介绍了如何使用JAVA将数据发送到COM PORT?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

Windows上的Java串行通信

朋友,
我想在JAVA中连接数据并将数据传输到COM PORT(虚拟或原始)?

Friends, I want to connect and transfer data to COM PORT (either virtual or original) in JAVA?

推荐答案

此问题已被提出并多次回答:

This question has been asked and answered many times:

使用Java从串口读取文件

用Java读取串口

从Java串行端口读取文件

是否有用于访问串行端口的Java库或框架?

Windows上的Java串行通信

以引用一些。

我个人推荐来自 http://serialio.com 的串行端口 - <罢工>这不是免费,但对于任何商业项目,开发商(无版税)许可费都是值得的。可悲的是,它不再免版税,而且SerialIO.com似乎已经将自己重塑为硬件销售商;我不得不在SerialPort上搜索信息。

Personally I recommend SerialPort from http://serialio.com - it's not free, but it's well worth the developer (no royalties) licensing fee for any commercial project. Sadly, it is no longer royalty free to deploy, and SerialIO.com seems to have remade themselves as a hardware seller; I had to search for information on SerialPort.

从个人经验来看,我强烈建议反对 Sun,IBM和RxTx实施,所有这些都是在24/7使用中不稳定。有关详细信息,请参阅我对上述某些问题的回答。为了完全公平,RxTx可能在我尝试之后已经走了很长一段路,尽管Sun和IBM的实现基本上已经被放弃了,即使在那时也是如此。

From personal experience, I strongly recommend against the Sun, IBM and RxTx implementations, all of which were unstable in 24/7 use. Refer to my answers on some of the aforementioned questions for details. To be perfectly fair, RxTx may have come a long way since I tried it, though the Sun and IBM implementations were essentially abandoned, even back then.

更新的免费选项看起来很有希望,可能值得一试的是 jSSC(Java简单串行连接器),如@Jodes评论所示。

A newer free option that looks promising and may be worth trying is jSSC (Java Simple Serial Connector), as suggested by @Jodes comment.

这篇关于如何使用JAVA将数据发送到COM PORT?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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