Skip to content

Check binary event time by the clock state, and an option for TB2017-003a - #99

Merged
jadamcrain merged 1 commit into
mainfrom
tb-bulletins
Oct 22, 2026
Merged

jadamcrain merged 1 commit into
mainfrom
tb-bulletins

Conversation

@jadamcrain

Copy link
Copy Markdown
Member

Closes #98.

What changes

  • outstation.bulletins: the technical bulletins a device implements, comma separated, e.g. TB2017-003a. Empty by default, so a run checks each revision as published; an unknown id is a configuration error.
  • IntegrationPlugin.timeQuality (new, default None): whether the device's clock is synchronized, for events it records now. dnp3c asks before and after each batch of binary and double-bit input events it has the plugin generate, and records the answers for the procedure.
  • 3.1r1: the binary and double-bit event tests that check 8.14.1.1 (8.14.2c–f, j–l, n–o, their 8.22 counterparts, and 8.15.2) use the plugin's clock state where the procedure doesn't establish one. 8.14.2m keeps the states its own steps set. This is 3.1r1's own rule, so it doesn't depend on the bulletin option. A batch during which the clock changed may report each event in its own form within one response. 8.14.2p is unchanged: its steps accept either CTO.
  • 2.7 with TB2017-003a listed: 8.14.2.9–8.14.2.11 and 8.22.2.9–8.22.2.11 check the bulletin's 5.1.3.1.2 in place of g2v2/g4v2 only. Synchronized events must be in g2v2/g4v2, unsynchronized events in g2v3/g4v3 after g51v2. The result notes the bulletin. No other 2.7 test changes.
  • Without a plugin answer, the checks behave as before: either form, used throughout the response.
  • The shared rules move from v31r1.EventRules into common.EventTime.

Compatibility

timeQuality has a default, so existing plugins compile and run unchanged. A plugin needs it, and its device needs the bulletin listed, to pass 2.7's tests while reporting unsynchronized events with g51v2.

Testing

  • Unit tests: EventTimeTest covers the option, the recorded clock (latest and all batches, changed, unknown), 2.7 with and without the bulletin, 3.1r1 by clock state, mixed batches, a device without relative time, and the note. The full suite passes.
  • Against the dnp3 outstation from Report unsynchronized binary events with relative time dnp3#646, with its plugin implementing timeQuality and outstation.bulletins = TB2017-003a, run locally:
    • 2.7 at level 2: 145 procedures passed, none failed (released 0.2.0 fails 8.14.2.9 and 8.22.2.9 against that outstation).
    • 3.1r1 at level 3: 177 passed, none failed, 8.26.2 excluded as dnp3 configures.

…003a

outstation.bulletins lists the technical bulletins a device implements,
none by default. With TB2017-003a listed, 2.7's 8.14.2.9 to 8.14.2.11
and 8.22.2.9 to 8.22.2.11 check its rule (5.1.3.1.2) in place of
absolute time only: events recorded while the clock is synchronized in
g2v2/g4v2, those recorded while it's unsynchronized as g2v3/g4v3 after
g51v2. The result notes the bulletin.

IntegrationPlugin.timeQuality, with a default of None, reports whether
the device's clock is synchronized. dnp3c asks before and after each
batch of binary and double-bit input events, and 3.1r1's 8.14.1.1
checks, and 2.7's with the bulletin, use that state where the procedure
doesn't know it. A batch the clock changed during may be reported each
way in one response. Without the plugin's answer, the checks accept
either way throughout, as before.
@jadamcrain
jadamcrain added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit babe28f Oct 22, 2026
4 checks passed
@jadamcrain
jadamcrain deleted the tb-bulletins branch October 22, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to validate against the technical bulletins a device implements

1 participant