fix(historian): map Boolean historization to Int2, not degenerate Int1 (#441) #442
Reference in New Issue
Block a user
Delete Branch "fix/441-boolean-historization-int2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resolves #441 (response to HistorianGateway #11).
Problem
HistorianTypeMappermappedDriverDataType.Boolean → HistorianDataType.Int1, but the historian's Int1 analog-tag creation path is server-degenerate —EnsureTags(Int1)stores an unusable stub (live-probed on the deployed 2023 R2 historian; root-caused + documented gateway-side in HistorianGateway #11 / PR #16). So Boolean historized tags failed auto-provisioning (the one red case in the R2-06Category=LiveIntegrationrun, 5/6).Fix — option 1 from #441: Boolean → Int2
Map
Boolean → Int2and store 0/1. Int2 is a proven-creatable analog type (type sweep: Int2/UInt2/Int4/UInt4/Float/Double all provision; only Int1 fails). The value-write path already sends every value as adoubleonWriteLiveValuesregardless of tag type, so a Boolean0.0/1.0round-trips cleanly into the Int2 tag. Both Float and Int2 are supported, so a pre-existing Float Boolean tag retypes cleanly on its next deploy.Changes
HistorianTypeMapper:Boolean => Int2(+ remarks explaining why not Int1)HistorianTypeMapperTests,GatewayTagProvisionerTests.Boolean_definition_carries_explicit_Int2_presenceEnsureTags_boolean_sandbox_provisions_as_Int2(was_Int1); retype probe reframed Float→Int2 (drops the dead Int1 leg)docs/Historian.md(new 'Boolean historization maps to Int2' section),CLAUDE.md, archreviewSTATUS.md(R2-06 live gate → 6/6)Test
dotnet buildclean; gateway driver unit 103/103. LiveCategory=LiveIntegrationleg is operator-gated (VPN) and now expects Int2.