Skip to content

Fix IEC 61850 millisecond timestamp rounding - #155

Merged
masarray merged 11 commits into
mainfrom
fix/fat-timestamp-rounding
Aug 13, 2026
Merged

Fix IEC 61850 millisecond timestamp rounding#155
masarray merged 11 commits into
mainfrom
fix/fat-timestamp-rounding

Conversation

@masarray

@masarray masarray commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Customer issue

Relay and ABB SAS can show an IEC 61850 event as 31.201 while ARSAS showed 31.200 for the same source timestamp.

Root cause

ARSAS formatted sub-millisecond DateTime / DateTimeOffset values directly with .fff. That exposes the millisecond component without first rounding the full timestamp. A source value such as 31.2006000 therefore rendered as 31.200.

Fix

  • introduce one IEC 61850 nearest-millisecond presentation helper
  • midpoint (.0005000) rounds forward
  • correctly carry across second/minute boundaries
  • preserve the original full-resolution timestamp in evidence; rounding is presentation-only
  • use the same rule for FAT live/current IED time and ON/OFF evidence
  • align FAT Excel export, standard PDF report, executive PDF report, and HTML evidence output
  • use the same rule in the general IEC 61850 value formatter
  • add permanent regression coverage for 31.2006 -> 31.201, midpoint behavior, second/minute carry, and raw evidence preservation

Scope

The patch intentionally does not change IEC 61850 acquisition, report timestamps at source, NTP/SNTP behavior, GOOSE capture clocks, or stored evidence precision. It corrects only millisecond-resolution presentation.

Validation

Final head 803179408d9052f7b53daeb14fcea292e9429c83 passed:

The earlier bot-generated report-alignment commit produced action_required checks with no jobs because GitHub does not recursively trigger normal PR workflows from the bot push. A final human-authored no-logic comment update retriggered CI on the exact final source above.

@masarray
masarray marked this pull request as ready for review August 13, 2026 07:35
@masarray
masarray merged commit 5ea92d9 into main Aug 13, 2026
3 checks 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