Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]ModbusClinet.ReadHoldingRegisters Throw NullReferenceException(在我的程序具有重连功能时引发的异常) #75

Open
jkh404 opened this issue Jan 25, 2022 · 1 comment

Comments

@jkh404
Copy link

jkh404 commented Jan 25, 2022

QQ图片20220125133440
上面的图片是Visual Studio2019 Debug 调试运行时抛出的异常。出现的位置是EasyModbusTCP.NET项目的ModbusClient.cs的ReadHoldingRegisters 方法
注意:这个 BUG是偶尔发生的,按照以下说明操作可以大概率重现。
情景重现:
我的程序是具有掉线重连功能的,每隔一秒会检查是否断开连接,如果断开连接则调用 Connect() 重新连接。
image
当我启动我的程序,然后再立刻启动ModBus Tcp Server 监听端口,最后抛出了异常。

en:
Visual Studio2019 Debug debuts an exception thrown at runtime. The location where this occurs is the ReadHoldingRegisters method of the modBusClient. cs of the EasyModbusTCP.NET project
Note:This bug happens occasionally.Follow the instructions below to have a high probability of recurrence
Re-enactment:
My program is a disconnected reconnect function, every second will check whether to disconnect, if disconnected call Connect() to reconnect.
When I started my program and then immediately started ModBus Tcp Server listening port, finally threw an exception.

@jkh404
Copy link
Author

jkh404 commented Jan 25, 2022

我用的版本是5.6
en:
I'm using version 5.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant