java 使用modbus协议通讯遇到的问题

在项目中使用了modbus通讯相关的jar如下:

modbus4J.jar

RXTXcomm.jar

seroUtils.jar

rxtxParallel.dll

rxtxSerial.dll

 

在使用过程中遇到了几个恶心的坑,主要是RXTXcomm.jar 和 rxtxParallel.dll、rxtxSerial.dll的版本一致性问题

还有modbus4J.jar和seroUtils.jar的版本也必须一致。

 

RXTXcomm.jar 和 rxtxParallel.dll、rxtxSerial.dll的版本不一致:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000180004465, pid=19324, tid=6140
#
# JRE version: Java(TM) SE Runtime Environment (11.0.1+13) (build 11.0.1+13-LTS)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.1+13-LTS, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C  [rxtxSerial.dll+0x4465]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

 

modbus4J.jar和seroUtils.jar的版本不一致:
modbusFactory.createRtuMaster(serialParameters);会报异常错误,关键是网上总是找不到合适的jar,所以我把整理好的jar包放到了网盘中,需要的可以下载

https://u19158142.pipipan.com/fs/19158142-329088777

你可能感兴趣的:(java 使用modbus协议通讯遇到的问题)