[
https://issues.apache.org/jira/browse/PLC4X-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17181098#comment-17181098
]
Christofer Dutz commented on PLC4X-240:
---------------------------------------
The more I think of it, the more I think the 0.6 solution works, but is sub
ideal ... in your case you just wanted to read "test" which is actually 4 bytes
... from the wireshark dump I can see that indeed the S7 seems to send first
the max number of chars, then the actual number of chars and then finally the
char data itself.
So in almost every case with a S7 1200 the request has to be split up into two
requests anway as the box just isn't big enough. So I would instead propose for
every STRING element not to read the full array, but instead just to read the
second byte and then to request that Amout of bytes. This should drastically
reduce the amount of data sent over the wire.
> Protocol error in reading string
> --------------------------------
>
> Key: PLC4X-240
> URL: https://issues.apache.org/jira/browse/PLC4X-240
> Project: Apache PLC4X
> Issue Type: Bug
> Components: Driver-S7
> Affects Versions: 0.8.0
> Reporter: Stefano Bossi
> Assignee: Christofer Dutz
> Priority: Major
> Attachments: Screenshot 2020-08-20 at 09.35.58.png,
> captureString_v_0_6_0.pcapng, captureString_v_0_8_0_wrong.pcapng
>
>
> Dear Christofer,
> unfortunately I have found an another issue.
> Via the HelloPlc app I am trying to read a string from my 1200 PLC; here
> attached you could find the screenshot of the DB as configured in the PLC.
> The command line I am using is:
> {code:java}
> "--connection-string 's7:tcp://192.168.1.192?controller-type=S7_1200'
> --field-addresses '%DB1:6.0:STRING'"
> {code}
> With the library Version 0.8.0 after the patch Julian introduced here: [Pull
> 175|https://github.com/apache/plc4x/pull/175] which fix the reading of Array
> of numbers, the reading of Strings doesn't work any more.
> The error I could read via wireshark is:
> {noformat}
> [Error code: S7 protocol error: Wrong frames (0x8500)]
> {noformat}
> With the library version 0.6.0 the string is correctly read.
> To help you in your work I have attached a capture with both the library
> version.
> Hope to be useful to fix the bug.
> Regards,
> Stefano Bossi
> P.S. just to let you know, I am trying to read a complex DataBlock and this
> is the reason I am experimenting with a lot of different types of variables.
> In the near future I will try to read some many other and to write some too.
> Unfortunately your code is far too complex for my java knowledge and I am not
> able to fix the bug by myself but I could test the library and send detailed
> report if I found some trouble. Hope this could help anyway.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)