How to Retrieve OPC Variable Engineering Units When Pulling Data into Excel

OPC tags carry metadata properties beyond their numeric value, and engineering units are one of those properties. Whether those units are accessible depends on whether the OPC server exposes them and what OPC standard is in use. OPC UA provides a standardized mechanism for publishing engineering unit information as part of the node’s attribute set, while OPC Classic DA servers vary in how consistently they expose item properties.

Engineering Units in OPC UA

OPC UA defines engineering units as a structured attribute that can be read from a node alongside its value. When OPC Expert connects to an OPC UA server that populates this attribute, the engineering unit information is available for retrieval. In the OPC Expert interface, you can browse the node’s properties to inspect available attributes. Pulling this data into an Excel cell follows the same mechanism as pulling any other OPC attribute: the item reference is specified in the Excel formula or drag-and-drop configuration, and the value, including metadata properties where available, is delivered by OPC Expert’s RTD server into the worksheet.

Engineering Units in OPC Classic DA

OPC DA servers can expose item properties, and engineering units are one of the standard property identifiers defined in the OPC DA specification. However, not all OPC DA servers populate these properties. If the server does expose the engineering unit property, OPC Expert can access it through the item’s property collection. If the server does not provide this information, it is not available at the OPC layer and would need to be maintained in a separate reference table within the Excel workbook itself.

Practical Approach for Labeling Units in Excel

In many industrial deployments, engineering unit labels are added manually to the Excel workbook as static text cells adjacent to the data columns rather than retrieved dynamically from the OPC server. This is because OPC server configurations vary widely and tag naming conventions often encode the unit implicitly. For environments where OPC UA servers consistently expose engineering unit attributes, dynamic retrieval is straightforward. For OPC DA environments where this data is inconsistently available, a static label approach is reliable and predictable.

Relevant Tools

OPC to Excel is the OPC Expert module that delivers OPC data into Excel workbooks. It supports access to OPC DA item properties and OPC UA node attributes, providing a pathway to engineering unit metadata where the source server exposes it.

OPC Viewer is the OPC Expert module for browsing and inspecting OPC data in real time. It is useful for examining what properties and attributes a given OPC server exposes before building an Excel report, confirming whether engineering unit data is available from a specific server and tag.

Summary

Engineering units can be retrieved from OPC tags when the source server exposes them as item properties (OPC DA) or node attributes (OPC UA). OPC Expert provides access to this metadata where available. For servers that do not populate engineering unit properties, the practical solution is to label units statically in the Excel workbook. OPC Viewer is useful for confirming what metadata a server exposes before building a report.