Skip to content
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

LDATE, LDT and LTOD types - incorrect units #539

Closed
mhasel opened this issue Aug 10, 2022 · 0 comments · Fixed by #542
Closed

LDATE, LDT and LTOD types - incorrect units #539

mhasel opened this issue Aug 10, 2022 · 0 comments · Fixed by #542
Assignees
Labels
bug Something isn't working language feature (norm) a missing language feature according to iec61131-3
Projects

Comments

@mhasel
Copy link
Member

mhasel commented Aug 10, 2022

Describe the bug
LDATE, LDT and LTOD types measure unix-timestamps in milliseconds when it should be in nanoseconds (see DIN-EN 61131-3 Table 10 - Elementary data types: notes m to q)

To Reproduce
Convert any date to a unix timestamp in nanoseconds (e.g. Utc.ymd(1984, 1, 1).and_hms(0, 0, 0).timestamp_nanos() ) and compare it to an LDATE, LDT or LTOD of the same date returned from StdLib functions.

Tests
Failing tests in branch https://github.com/PLC-lang/StandardFunctions/tree/13-endianess-functions-iec61131-table-37

@mhasel mhasel added the bug Something isn't working label Aug 10, 2022
@ghaith ghaith added the language feature (norm) a missing language feature according to iec61131-3 label Aug 14, 2022
@99NIMI 99NIMI self-assigned this Aug 17, 2022
@99NIMI 99NIMI added this to To do in Next via automation Aug 17, 2022
@99NIMI 99NIMI moved this from To do to In progress in Next Aug 17, 2022
99NIMI added a commit to 99NIMI/rusty that referenced this issue Aug 17, 2022
@99NIMI 99NIMI linked a pull request Aug 17, 2022 that will close this issue
99NIMI added a commit to 99NIMI/rusty that referenced this issue Aug 17, 2022
@99NIMI 99NIMI moved this from In progress to Review in progress in Next Aug 17, 2022
99NIMI added a commit that referenced this issue Aug 22, 2022
…rrect-units

#539 changed any date precision to nanoseconds
Next automation moved this from Review in progress to Done Aug 22, 2022
99NIMI added a commit to PLC-lang/StandardFunctions that referenced this issue Aug 22, 2022
ghaith pushed a commit to PLC-lang/StandardFunctions that referenced this issue Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working language feature (norm) a missing language feature according to iec61131-3
Projects
Status: Done
Next
Done
Development

Successfully merging a pull request may close this issue.

3 participants