繁体   English   中英

电能表数据读取和写入以使用COM在串行端口中显示

[英]Energy meter data read and write to display in serial port using COM

我正在使用电表。 如何用Java读取电表数据并编写代码?

这将是电力线节点发送和传输数据,它将转换为RS232中的集中器以显示在串行端口中。 Windows使用Java。

读取仪表值的输出示例是:

A 00 09 14 03 81 0C 03 10 03 00 30 B0 03 3A 00   :.........0°.:.
09 14 03 81 02 03 10 03 00 30 B1 2D 3A 00 09 14   ........0±-:...
03 81 02 03 10 03 00 04 B0 FA 3A 00 09 14 5C 81   .......°ú:...\
02 03 10 03 00 04 B0 FA   

为了在Windows下读写数据到串行端口,我建议使用rxtx

http://rxtx.qbang.org/wiki/index.php/Main_Page

有一些读写示例:

http://rxtx.qbang.org/wiki/index.php/Using_RXTX

甲骨文提供了一个com api,但实际版本仅具有Solaris SPARC,Solaris x86和Linux x86的实现。

http://www.oracle.com/technetwork/java/index-jsp-141752.html

我为Windows使用了较旧的版本,但是很难找到并且存在一些缺点(例如,在没有'help'的情况下找不到com4之上的端口,dll路径中的空间有问题等等)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM