You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@plc4x.apache.org by "patrickboisclair (via GitHub)" <gi...@apache.org> on 2024/02/27 15:33:33 UTC

[I] [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore

patrickboisclair opened a new issue, #1433:
URL: https://github.com/apache/plc4x/issues/1433

   ### What happened?
   
   Hi all,
   
   Beckhoff ads driver.
   
   When trying to write multiple TAGS at once, seems to be broken at the moment. 
   Doing the same thing with 0.9.1 works just fine.
   
   Example:
   
   ```java
               PlcWriteRequest writeRequest = plcConnection.writeRequestBuilder()
                                                           .addTagAddress("ValX", "MAIN.ValX", new PlcDINT(154))
                                                           .addTagAddress("ValY", "MAIN.ValY", new PlcDINT(178))
                                                           .build();
   
               PlcWriteResponse writeResponse = writeRequest.execute().get(); 
   ``` 
   Results in:
   
   Exception in thread "main" java.util.concurrent.ExecutionException: org.apache.plc4x.java.api.exceptions.PlcException: Error
           at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
           at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
           at com.epsilia.Beckhoff.execute(Beckhoff.java:48)
           at com.epsilia.Main.main(Main.java:6)
   Caused by: org.apache.plc4x.java.api.exceptions.PlcException: Error
           at org.apache.plc4x.java.ads.protocol.AdsProtocolLogic.lambda$84(AdsProtocolLogic.java:1108)
           at java.base/java.util.function.Consumer.lambda$andThen$0(Consumer.java:65)
           at org.apache.plc4x.java.spi.Plc4xNettyWrapper.decode(Plc4xNettyWrapper.java:183)
           at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81)
           at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
           at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
           at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
           at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
           at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
           at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
           at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
           at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
           at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
           at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
           at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
           at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
           at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
           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.base/java.lang.Thread.run(Thread.java:833)
   
   
   ### Version
   
   v0.12.0
   
   ### Programming Languages
   
   - [X] plc4j
   - [ ] plc4go
   - [ ] plc4c
   - [ ] plc4net
   
   ### Protocols
   
   - [ ] AB-Ethernet
   - [X] ADS /AMS
   - [ ] BACnet/IP
   - [ ] CANopen
   - [ ] DeltaV
   - [ ] DF1
   - [ ] EtherNet/IP
   - [ ] Firmata
   - [ ] KNXnet/IP
   - [ ] Modbus
   - [ ] OPC-UA
   - [ ] S7


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on issue #1433:
URL: https://github.com/apache/plc4x/issues/1433#issuecomment-2051883901

   Guess what line it's happening in?
   ![Bildschirmfoto 2024-04-12 um 16 34 54](https://github.com/apache/plc4x/assets/651105/d9d8ff94-a1fb-4b8d-b616-36ccc42ee371)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on issue #1433:
URL: https://github.com/apache/plc4x/issues/1433#issuecomment-1966862347

   Buuuuuuut ... now that you're mentioning it ... I am not doing a mixed bulk write of all of them ... hmmm ... possibly something I could look into. But still the above information would still be useful.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore

Posted by "patrickboisclair (via GitHub)" <gi...@apache.org>.
patrickboisclair commented on issue #1433:
URL: https://github.com/apache/plc4x/issues/1433#issuecomment-1978596206

   Oh nice !
   We got almost no snow this winter here, making skiing and snowboarding, almost undoable :(
   
   Thanks for the heads up, appreciate it !


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore

Posted by "IsmoLeszczynski (via GitHub)" <gi...@apache.org>.
IsmoLeszczynski commented on issue #1433:
URL: https://github.com/apache/plc4x/issues/1433#issuecomment-2052700669

   The issue was the IndexOffset being set to the amount of bytes instead of tags, and the size of the tag types pointed to the data type table entry length instead of the data type size from said entry.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on issue #1433:
URL: https://github.com/apache/plc4x/issues/1433#issuecomment-2051951178

   So the root cause is an "invalid size" in the multi-item write ... if anyone is able to spot the issue, happy to have some assistance here.
   [ads-driver-multi-item-write-error.pcapng.zip](https://github.com/apache/plc4x/files/14960440/ads-driver-multi-item-write-error.pcapng.zip)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore

Posted by "patrickboisclair (via GitHub)" <gi...@apache.org>.
patrickboisclair commented on issue #1433:
URL: https://github.com/apache/plc4x/issues/1433#issuecomment-1977345792

   Hi all,
   
   Just askin if there's any news on this ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on issue #1433:
URL: https://github.com/apache/plc4x/issues/1433#issuecomment-1977438588

   Haven't had any time yet... Also probably not in the next week, as I'll be snowboarding. I'll try to have a look after that. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore

Posted by "patrickboisclair (via GitHub)" <gi...@apache.org>.
patrickboisclair commented on issue #1433:
URL: https://github.com/apache/plc4x/issues/1433#issuecomment-2051868519

   Ty Chris for taking time to look into this.
   Really appreciated.
   
   I can test on my hardware when a fix will be available if it can helps.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on issue #1433:
URL: https://github.com/apache/plc4x/issues/1433#issuecomment-2051853232

   I was able to confirm the issue by extending the ManualTest class to not only do single-item write tests, but also the random multi-item tests. Here the test failed, as you described. Also did the S7 manual test of the quick-tests that I was able to run on my hardware.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz closed issue #1433: [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore
URL: https://github.com/apache/plc4x/issues/1433


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on issue #1433:
URL: https://github.com/apache/plc4x/issues/1433#issuecomment-2117530764

   Issue was resolved by Ismo's PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on issue #1433:
URL: https://github.com/apache/plc4x/issues/1433#issuecomment-1966860337

   The thing is that this is explicitly tested in the ManualADS test ... there I read each tag sepatately, write it separately and then read all of them in one big read, but with random order of the tags ... this test always passed.
   
   I guess there must be something else odd going on.
   
   Could you possibly provide a bit more information:
   - Which Type of PLC are you using?
   - Which version of TwinCat is it running on?
   - A Wireshark recording when running above test.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore

Posted by "patrickboisclair (via GitHub)" <gi...@apache.org>.
patrickboisclair commented on issue #1433:
URL: https://github.com/apache/plc4x/issues/1433#issuecomment-1966879179

   I'll provide the info in 1 or 2 hours


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: ads driver, writing multiple tags in 1 writeRequestBuilder doesnt work anymore

Posted by "patrickboisclair (via GitHub)" <gi...@apache.org>.
patrickboisclair commented on issue #1433:
URL: https://github.com/apache/plc4x/issues/1433#issuecomment-1967353852

   - PLC Type: CX8190 / Standard
   - TwinCat: v3.1.4024.11
   - WireShare recording attached (NOTE: I launched the APP 3 times, it simply do the writeRequest as mentionned in the original post)
   [plc4x_0_12_0_ads_multiple_writes.zip](https://github.com/apache/plc4x/files/14424210/plc4x_0_12_0_ads_multiple_writes.zip)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org