<legend id='WJv2H'><style id='WJv2H'><dir id='WJv2H'><q id='WJv2H'></q></dir></style></legend>
  • <small id='WJv2H'></small><noframes id='WJv2H'>

    1. <tfoot id='WJv2H'></tfoot>
        <bdo id='WJv2H'></bdo><ul id='WJv2H'></ul>

    2. <i id='WJv2H'><tr id='WJv2H'><dt id='WJv2H'><q id='WJv2H'><span id='WJv2H'><b id='WJv2H'><form id='WJv2H'><ins id='WJv2H'></ins><ul id='WJv2H'></ul><sub id='WJv2H'></sub></form><legend id='WJv2H'></legend><bdo id='WJv2H'><pre id='WJv2H'><center id='WJv2H'></center></pre></bdo></b><th id='WJv2H'></th></span></q></dt></tr></i><div id='WJv2H'><tfoot id='WJv2H'></tfoot><dl id='WJv2H'><fieldset id='WJv2H'></fieldset></dl></div>

        使用Java &amp; 的串口通信Eclipse 中的 RXTX

        Serial Port Communication Using Java amp; RXTX in Eclipse(使用Java amp; 的串口通信Eclipse 中的 RXTX)

        <i id='Nch07'><tr id='Nch07'><dt id='Nch07'><q id='Nch07'><span id='Nch07'><b id='Nch07'><form id='Nch07'><ins id='Nch07'></ins><ul id='Nch07'></ul><sub id='Nch07'></sub></form><legend id='Nch07'></legend><bdo id='Nch07'><pre id='Nch07'><center id='Nch07'></center></pre></bdo></b><th id='Nch07'></th></span></q></dt></tr></i><div id='Nch07'><tfoot id='Nch07'></tfoot><dl id='Nch07'><fieldset id='Nch07'></fieldset></dl></div>
          <bdo id='Nch07'></bdo><ul id='Nch07'></ul>
          <legend id='Nch07'><style id='Nch07'><dir id='Nch07'><q id='Nch07'></q></dir></style></legend>

          1. <small id='Nch07'></small><noframes id='Nch07'>

            • <tfoot id='Nch07'></tfoot>
                    <tbody id='Nch07'></tbody>
                  本文介绍了使用Java &amp; 的串口通信Eclipse 中的 RXTX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在windows环境下编写一个java应用程序与串口设备通信,在google上浏览似乎转向了很多方向,也喜欢一些第三方工具库,如RXTX JavaComm.关于使用 Eclipse 尝试使用 RXTX 示例代码 参考.

                  To write an java application to communicate with serial port devices on windows environment , browsed in google seem to be divert to many directions also fond some of the third party tools library like RXTX JavaComm. On trying with RXTX sample codes using eclipse Reference.

                  输出中没有显示串口,只是空白

                  No serial ports were displayed in output just blank

                  输出:

                  稳定库

                  本机库版本 = RXTX-2.1-7

                  Native lib Version = RXTX-2.1-7

                  Java 库版本 = RXTX-2.1-7

                  Java lib Version = RXTX-2.1-7

                  我犯了什么错误?

                  让我知道这种方法更好还是建议我更好的解决方案?

                  Let me know that is this approach is the better or suggest me better solution ?

                  请让我知道这个问题的替代方案,我想使用 java 通过串行端口与设备通信,数据将从设备发送并且应该写入文件.

                  Kindly let me know the alternatives for this problem , i wanna communicate with device via serial port using java, the data will be sent from the device and it should be written to the files.

                  提前致谢

                  推荐答案

                  如果链接示例失败,则表示RXTX没有检测到您机器上的任何个串口.您的机器上可能有一个串行端口,但您的操作系统无法识别它的原因之一可能是因为它实际上是一个串行到 USB 适配器,并且被识别为 USB港口.

                  If the linked example fails it means that RXTX hasn't detected any serial ports on your machine. You may have a serial port on your machine but one of the reasons it isn't recognized by your OS might be because it is actually a serial-to-USB adapter, and is being recognized as an USB port.

                  如果您在 Linux 上,串行端口通常如下所示:

                  If you are on Linux, serial ports usually look like this:

                  ls /dev/ttyS*
                  

                  输出:

                  /dev/ttyS0
                  /dev/ttyS1
                  /dev/ttyS2
                  

                  调整后的端口可能如下所示:

                  the adapted port might look like this:

                  /dev/ttyUSB0
                  

                  如果您可以在串行连接设备(例如 POS 打印机或 LCD 显示器)上看到一些输出,您可以像这样测试它:

                  If you can see some output on your serial attached device (e.g. POS printer or LCD display) you can test it like this:

                  echo 'hello' > /dev/ttyUSB0
                  

                  如果设备连接到该端口并且一切正常,则设备应显示hello"字符串.

                  and the device should show the 'hello' string if it is attached to that port and everything is working properly.

                  但是,我肯定会推荐 Java 简单串行连接器 库在 RxTx 上.我们已经在商业 POS 应用程序中尝试过这两种应用程序(目前 >100 万张票).

                  However, I would definitely recommend Java simple serial connector library over RxTx. We have tried both in an commercial POS application (>1M tickets at this time).

                  RxTx 已成功用于顺序打印.在打印场景中,RxTx 库被顺序调用并仅用于将数据发送到端口.只有一些串行标志是红色的,以检测设备的业务.

                  RxTx is being used for sequential printing successfully. In the print scenario the RxTx library was called upon sequentially and used only to send the data to the port. Only some serial flags were red the detect to buissiness of the device.

                  但由于它的限制,我们根本无法使用它来读取来自串行连接的 IButton 的输入.在 iButton 场景中,预计数据将从端口异步接收.当我们尝试使用 RxTx 实现它时,经常会出现错误和挂起,但使用 JSSC 几乎是立即实现的.

                  But because of its limitations we simply could not use it for reading input from a serially connected IButton. In the iButton scenario the data is expected to be received asynchronously from the port. There were constant bugs and hangs when we tried to implement it with RxTx, but with JSSC it was implemented almost immediatley.

                  这篇关于使用Java &amp; 的串口通信Eclipse 中的 RXTX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)
                  <tfoot id='ptyOm'></tfoot>
                    <legend id='ptyOm'><style id='ptyOm'><dir id='ptyOm'><q id='ptyOm'></q></dir></style></legend>

                    <small id='ptyOm'></small><noframes id='ptyOm'>

                      <bdo id='ptyOm'></bdo><ul id='ptyOm'></ul>

                          <i id='ptyOm'><tr id='ptyOm'><dt id='ptyOm'><q id='ptyOm'><span id='ptyOm'><b id='ptyOm'><form id='ptyOm'><ins id='ptyOm'></ins><ul id='ptyOm'></ul><sub id='ptyOm'></sub></form><legend id='ptyOm'></legend><bdo id='ptyOm'><pre id='ptyOm'><center id='ptyOm'></center></pre></bdo></b><th id='ptyOm'></th></span></q></dt></tr></i><div id='ptyOm'><tfoot id='ptyOm'></tfoot><dl id='ptyOm'><fieldset id='ptyOm'></fieldset></dl></div>
                              <tbody id='ptyOm'></tbody>