-
Notifications
You must be signed in to change notification settings - Fork 646
Add DTL type #284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DTL type #284
Conversation
Add new class Types.Dtl by taking the DateTime type and adjusting things. Also add unit test with binary data calculated by hand. (Need to verify with actual S7 data)
|
No this is not in any way associated with #267 , nor did I get my implementation details from there. If you want me to make any changes, eg. to naming things, just let me know. Some of the implementation details (eg. using MemoryStream in ToByteArray) where done so I could reuse the existing Types.Word and Types.DWord implementions to do the conversion for year and nanoseconds. |
|
Yes of course. Since there is no code in the other PR, I can just assume that based on its title it attempted to implement the same thing as I did :-) About Naming: Do you prefer Dtl / DTL, or DateTimeLong? (Not to be confused with LDT (DATE_AND_LTIME) ) |
|
Honestly I'd prefer DateTimeLong, because it's most precise and with a proper IDE (or R# 😉) typing dtl will complete to DateTimeLong just as well. OTOH I'm not sure about the current conventions, they're not mine (I only did 'fixes' and write-multiple support, almost all of the other work is before I maintained S7NetPlus). |
mycroes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent implementation, very happy to see a contribution of good quality code.
|
Released as 0.6.0. |
Add new class Types.Dtl by taking the DateTime code and adjusting things.
Includes Unit Test (which is just the DateTime one adjusted for DTL as well)
I had an existing DTL converter to work from, but https://support.industry.siemens.com/cs/mdm/109773506?c=93833257483&lc=en-WW describes the data type pretty well.