You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by Maximilian Tan <ma...@gmail.com> on 2022/05/28 01:31:24 UTC
Issue with Modbus Write -- PLC Connection Exception: Error Creating Channel
Hi!
Thanks for supporting this library.
I'd like to seek your advice on an issue I'm having surrounding writing to
modbus registers.
I have a code snippet as follows:
[image: image.png]
I'm able to make about ~150 requests successfully, until I encounter a PLC
Connection Exception: Error creating channel error. This is consistent with
multiple tries.
I've tried using CachedDriverManagers / PooledDriverManagers, but this will
result in a NullPointerException when I tried to use its PlcConnection
object to create a PlcWriteRequest.Builder. Essentially, the "builder"
object is null:
[image: image.png]
However, I'm able to create PlcReadRequest builders for reading data; no
NullPointerExceptions:
This is how I'm creating the CachedDriverManager:
[image: image.png]
I've noticed that I will never encounter a maximum buffer limit reached for
connections created from the CachedDriverManager, used to make Modbus read
requests. Hence, I considered using connections created from the
CachedDriverManger to make Modbus write requests, however I get a
NullPointerException for the "builder".
Hope you could help point me in the right direction, been stuck at this for
a couple of days.
Thanks!
Regards,
Max