[
https://issues.apache.org/jira/browse/PLC4X-239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17180664#comment-17180664
]
Christofer Dutz commented on PLC4X-239:
---------------------------------------
Ok ... so I was a little puzzled why the 0.6 driver asked for 8 bytes and the
0.8 one didn't ... actually what the 0.6 one is doing is not quite correct.
It's asking the PLC for "8 elements of type 0x02" (0x02 = 1 byte) ... the 0.8
driver asks for "1 element of type 0x02". The problem is that 0x02 isn't
correct. Unfortunately we would need a WireShark dump reading an element of
types: LTIME, DATE, TIME_OF_DAY and DATE_AND_TIME (Strangely the type for
"TIME" seems to be set correctly) ... LTYPE I won't manage doing, as only S7
1500 seem to support that. I'll try to setup my S7 with a field of each of them
and will try to produce some traffic with TIA that helps find the correct type
codes.
> Read DTL (Date and Time)
> ------------------------
>
> Key: PLC4X-239
> URL: https://issues.apache.org/jira/browse/PLC4X-239
> Project: Apache PLC4X
> Issue Type: Bug
> Components: Driver-S7
> Affects Versions: 0.8.0
> Reporter: Stefano Bossi
> Priority: Major
> Attachments: Screenshot 2020-08-19 at 17.02.58.png,
> correctDateAndTimeRead_v0_6_0.pcapng, wrongDateAndTimeRead_v0_8_0.pcapng
>
>
> Dear developers,
> I have found a bug in trying to read a Date and Time field from a S7 1200
> PLC, here are the informations to help you in fixing the code.
> I am using the HelloPlc4x application for testing, with this command line:
> {code:java}
> "--connection-string 's7://192.168.1.192' --field-addresses
> '%DB1:264.0:DATE_AND_TIME'"{code}
> The Data Block in the PLC is like in the uploaded jpeg.
> When I reach the line of code for the synchronous read request the code never
> return.
> Via Wire Shark I have captured the dialog and I found that in the Read Var
> request only 1 byte is requested instead of the expected 8.
> I have tried with the version 0.6.0 and in that release of the library are
> requested 8 byte correctly (the parsing after receiving the data fail for
> somewhat reason but via wireshark I could see that the data in the response
> is the correct Date and Time value I have on the PLC)
> I attach the pcap capture with the 0.8.0 version and for comparison the one
> with the 0.6.0
> Hope that this could help to have a more robust library.
> Regards,
> Stefano Bossi
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)