Skip to content

LDATE, LDT and LTOD types - incorrect units #539

@mhasel

Description

@mhasel

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinglanguage feature (norm)a missing language feature according to iec61131-3

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions