Repository navigation
fix: accept the null acknowledgement real PLCs send for set clock and session passwords - #940
Merged
Merged
Conversation
gijzelaerr
force-pushed
the
fix-set-clock-null-ack
branch
from
October 7, 2026 10:09
8754202 to
78576ce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #935.
A real S7-300 acknowledges a set-clock with a USER_DATA response whose parameter error code is 0 and whose data section is
0a 00 00 00(return code 0x0A, transport size 0, length 0).check_userdata_responsetreated every return code other than 0xFF as a failure, soset_plc_datetimeraised "Object does not exist" against such a PLC. The bundled server answered with 0xFF, which hid it.check_userdata_responsetakes a keyword-onlyaccept_null_ack. It is passed for set clock and the set/clear session password calls in both clients, the services that return no data. Every other service still requires 0xFF, and a nonzero parameter error code or any other return code is still a failure.parse_responsetolerates the null acknowledgement so the caller's stricter check decides.s7comm_reading_setting_plc_time.pcap(frame 44).I could only verify this against the captured acknowledgement, not a physical PLC.