[co7io] Industrial integrations with Beckhoff ADS/Siemens S7

Hello Łukasz,

I am currently testing your Beckhoff binding with openHAB 4. I have 3 different Beckhoff controllers in my local network: CX2030, CX1100 and BX9000. All controllers are detected by ADS binding, with the exception that during detection BX9000 AMS Net Id is set to the value of openHAB AMS Net Id (the IP address is correct). In CX2030 and CX1100 controllers, all symbilc links are properly scanned and assume the ONLINE status in openHAB. However, BX9000 does not support symbolic links scanning and variables can be read/written using indexes. And this is where the problem arises, because openHAB reports errors when establishing communication with this controller:

09:45:29.812 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'co7io-amsads:network:192_168_7_10_1_1:192_168_7_21' changed from INITIALIZING to UNKNOWN
09:45:30.635 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'co7io-amsads:network:192_168_7_10_1_1:192_168_7_21' changed from UNKNOWN to OFFLINE (HANDLER_INITIALIZING_ERROR): Could not retrieve data type and symbol information from ADS device org.apache.plc4x.java.api.exceptions.PlcException: Result is null
09:45:47.010 [ERROR] [.connection.DefaultNettyPlcConnection] - unknown error, close the connection
java.net.SocketException: Connection reset
	at sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:394) ~[?:?]
	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:426) ~[?:?]
	at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:256) ~[?:?]
	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132) ~[?:?]
	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:357) ~[?:?]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[?:?]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[?:?]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[?:?]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[?:?]
	at java.lang.Thread.run(Thread.java:840) ~[?:?]

I tried setting discoverChannels to false, but the binding still tries to scan symbolic links when establishing a connection. I also created my own channel definitions with indexes to variables and in this case errors occurred.
I would like to point out that I tested all controllers from the openHAB server using the pyAds tool and in the case of all three controllers, ADS communication worked without any problems. This means that the problem is with openHAB binding.