namespace ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway.Mapping; /// /// The OPC UA status codes this driver publishes, as named constants. /// /// /// The driver layer is deliberately free of an OPC UA SDK reference, so status codes are spelled /// as bare uints. The cost of that is a value nobody checks against the name it is written /// under — the defect class Gitea #497 found in six places across four drivers, one of them the /// BadNoData in that was really BadServerHalted. /// Named, not inline, on purpose. StatusCodeParityTests guards these by reflecting /// over const uint fields and comparing each against Opc.Ua.StatusCodes in the pinned SDK. /// A literal written at a call site is invisible to that guard, which is exactly how /// kept an incorrect Good_LocalOverride through every test it /// had. Add a constant here rather than a literal in a switch arm. /// internal static class HistorianStatusCodes { // ---- Good family ---- /// The value is good; no qualification. public const uint Good = 0x00000000u; /// The value has been overridden locally (OPC DA quality 216). public const uint GoodLocalOverride = 0x00960000u; // ---- Uncertain family ---- /// The value is uncertain; no specific reason. public const uint Uncertain = 0x40000000u; /// Communication has failed; the last known value is returned (OPC DA quality 68). public const uint UncertainLastUsableValue = 0x40900000u; /// The sensor is known not to be accurate (OPC DA quality 80). public const uint UncertainSensorNotAccurate = 0x40930000u; /// The value is outside the engineering-unit range for the sensor (OPC DA quality 84). public const uint UncertainEngineeringUnitsExceeded = 0x40940000u; /// The value is derived from fewer sources than required (OPC DA quality 88). public const uint UncertainSubNormal = 0x40950000u; // ---- Bad family ---- /// The value is bad; no specific reason. public const uint Bad = 0x80000000u; /// A configuration problem prevents the value being produced (OPC DA quality 4). public const uint BadConfigurationError = 0x80890000u; /// The source is not connected (OPC DA quality 8). public const uint BadNotConnected = 0x808A0000u; /// The device reported a failure (OPC DA quality 12). public const uint BadDeviceFailure = 0x808B0000u; /// The sensor reported a failure (OPC DA quality 16). public const uint BadSensorFailure = 0x808C0000u; /// Communication with the source failed (OPC DA quality 20). public const uint BadCommunicationError = 0x80050000u; /// The source is out of service (OPC DA quality 24). public const uint BadOutOfService = 0x808D0000u; /// No initial value has arrived from the source yet (OPC DA quality 32). public const uint BadWaitingForInitialData = 0x80320000u; /// /// The historian returned no data for the requested tag/interval. Distinct from a transport /// failure: the query succeeded and the answer was empty. /// public const uint BadNoData = 0x809B0000u; }