Getting data from the OPCQualityMap table
- Last UpdatedMar 20, 2025
- 1 minute read
In general, an OPC quality has 16 significant bits. The lower 8 bits contain the quality as described in the table, while the upper 8 bits hold server-specific information. To ensure correct results, it is important to consider only the lower 8 bits in a query or join involving the OPCQualityMap table.
For example:
SELECT h.DateTime, h.TagName, h.Value, o.Description FROM History h
INNER JOIN OPCQualityMap o
ON (h.OPCQuality & 255) = o.OPCQuality
WHERE TagName in (…)
AND …