Skip to content

Prioritize first-click IEC 61850 control and restore dynamic dchg - #12

Merged
masarray merged 9 commits into
mainfrom
fix/control-first-click-report-dchg
Jul 13, 2026
Merged

Prioritize first-click IEC 61850 control and restore dynamic dchg#12
masarray merged 9 commits into
mainfrom
fix/control-first-click-report-dchg

Conversation

@masarray

Copy link
Copy Markdown
Owner

Field evidence

The supplied 1.6.5 diagnostic shows every command that reached the runtime completed successfully in about 420–426 ms, including positive CommandTermination and process feedback. The intermittent perceived delay therefore occurs before or around dispatch, not in the IED operating time recorded by the current diagnostic.

The same report repeatedly says that MMS validation found a CB-position change that the armed dynamic report did not deliver. That stale event path can leave the command row behind the real process state and can make the intended first click appear unavailable or ineffective.

Command-path corrections

  • Remove stale displayed process value from the Open/Close button enable decision. Only armed/test, command readiness, and active-command busy state control button availability.
  • Log Control click accepted immediately at the UI boundary, then log runtime intent and click-to-result/client/engine timings separately.
  • Remove the duplicate UI-side control inspection/status read. The native command transaction now owns exactly one live MMS preflight.
  • Serialize the complete command transaction per IED.
  • Pause background report draining, polling, ctlModel preload, and heartbeat traffic while a command owns the association.
  • Keep safety unchanged: no automatic Operate retry and no hidden second SBOw/Operate sequence.
  • Suppress a redundant command only after the native live preflight proves that the IED is already at the requested state.

Report and stale-state corrections

  • Enforce dchg qchg dupd integrity GI and required optional fields on the actual free RCB selected for a dynamic DataSet, rather than inheriting possibly GI/integrity-only TrgOps.
  • Feed confirmed command process feedback directly into the monitor state.
  • Use process sequence ordering in the 100 ms UI batching queue so an older report/poll snapshot cannot roll a command-confirmed Open/Closed value backward.

Load and responsiveness

  • Reduce per-loop polling work.
  • Serialize ctlModel preload to one request and skip it while a command is active.
  • Slow the background command-panel UX scan.

Validation target

After CI, field diagnostics should distinguish:

  1. click-to-runtime delay,
  2. runtime/client queue delay,
  3. native SBOw/Operate/CommandTermination duration,
  4. process-feedback duration.

A first click must either produce one command sequence or a clear Already at requested state result based on a live MMS read. It must never disappear silently.

@masarray
masarray marked this pull request as ready for review July 13, 2026 20:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a7858807b0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Log("WARN", session.Device.Name,
$"Control requested: {request.Signal.ObjectReference} value={request.ValueText}; test={request.TestMode}; interlock={request.InterlockCheck}; synchro={request.SynchroCheck}.");
Log("INFO", session.Device.Name,
$"Control intent accepted: {request.Signal.ObjectReference} value={request.ValueText}; test={request.TestMode}; interlock={request.InterlockCheck}; synchro={request.SynchroCheck}.");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep control diagnostics in sync with renamed intent log

When an Open/Closed command is sent, MainWindow.ControlDiagnostics.cs still recognizes only messages matching Control requested: to call BeginPositionCommand/RememberControlDiagnosticActivity (see ControlRequestedPattern and IsControlRequestDiagnostic). Renaming this runtime message to Control intent accepted: means real controls no longer arm the CSWI position stabilization path or the recent-control window used to downgrade expected ambiguous report diagnostics, so transient command-facing position echoes can leak back into the command row despite the command succeeding.

Useful? React with 👍 / 👎.

@masarray
masarray merged commit 501a738 into main Jul 13, 2026
1 check passed
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.

1 participant