Add missing data type setters and fix get_lword/get_wchar bugs#602
Open
gijzelaerr wants to merge 1 commit intomasterfrom
Open
Add missing data type setters and fix get_lword/get_wchar bugs#602gijzelaerr wants to merge 1 commit intomasterfrom
gijzelaerr wants to merge 1 commit intomasterfrom
Conversation
New setter functions: - set_wstring: S7 WSTRING write support (UTF-16-BE, max 16382 chars) - set_wchar: single UTF-16-BE character write - set_tod: TIME_OF_DAY write (milliseconds since midnight) - set_dtl: DTL write (12-byte extended date/time) - set_dt: DATE_AND_TIME write (8-byte BCD encoded) - set_lword: 64-bit unsigned word write (was NotImplementedError) New getter implementations: - get_ltime: LTIME read (64-bit nanosecond duration, S7-1500) - get_ltod: LTOD read (64-bit nanosecond time of day, S7-1500) - get_ldt: LDT read (64-bit nanosecond datetime since epoch, S7-1500) Bug fixes: - get_lword: was reading 4 bytes instead of 8, now returns int - get_wchar: used hardcoded index 1 instead of byte_index + 1 DB Row support: - set_value now handles WSTRING, WCHAR, TOD, DTL, DATE_AND_TIME Includes 19 new tests covering all additions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
set_wstring,set_wchar,set_tod,set_dtl,set_dt,set_lwordget_ltime,get_ltod,get_ldt(S7-1500 64-bit time types)get_lwordbug (read 4 bytes instead of 8) andget_wcharbug (hardcoded index)set_value()snap7.utilTest plan
🤖 Generated with Claude Code