How-to
Expose historian latest values over OPC UA or MQTT
Short answer
Yes — connect an integration gateway to the historian's classic I/O Server over SuiteLink (application name aahiosvrsvc, topic TagName) and publish the current values as OPC DA and MQTT. After a historian restart the I/O Server and the Live table return nothing until the source sends a new value, so a true last-known-from-disk read needs T-SQL or the historian SDK.
On this page
- Read the historian only when the source is out of reach
- Connect the gateway to the I/O Server over SuiteLink
- Expose the tags as OPC DA
- Publish the same tags over MQTT
- The restart limit
- Worked example: the stale window for a tag on a 300 s update after a restart
- Prove the path with one tag
- Get the last stored value from disk
- Questions asked
Yes — and without adding any load on the field controller. The classic historian I/O Server is itself a SuiteLink server (the vendor documentation names the process aahIOSvrSvc.exe), so an integration gateway can subscribe to it and republish the values it receives as OPC DA and MQTT. The third-party application connects to the gateway, never to the DCS or PLC. One limit shapes the whole design: from a historian restart, the I/O Server and the Live table return no value for a tag until the historian receives a new one, so a last-known-value-from-disk read is a T-SQL or SDK job.
Read the historian only when the source is out of reach #
In most plants something already feeds the historian — an OPC server, a SuiteLink source, InTouch or an Application Server. If the gateway can reach that source, connect to it instead: you read each value as the source produces it, and the historian's restart behavior never enters the path. Reserve the I/O Server route for tags that reach the historian through a path nothing else can tap — a file interface, a proprietary feed, a source behind a boundary the gateway cannot cross. "Real-time" on this route means forwarding each value the historian receives; it does not mean replaying stored history.
Connect the gateway to the I/O Server over SuiteLink #
- In Operations Management Console, open the gateway configuration under Operations Integration Server Manager — the example node here is OI.GATEWAY.3.
- Add a SuiteLink connection. Give the node any project name, set the server application name to aahiosvrsvc, and target the historian computer: localhost when gateway and historian share one machine, otherwise the historian server's name.
- Under that connection, add a topic connection and name it TagName. The connection and topic node names are yours to choose; they set the device-group name OPC clients will see when they browse.
- Save the configuration, then activate the gateway server.
Expose the tags as OPC DA #
Which transport fits the destination is its own question — the OPC UA vs MQTT Sparkplug from a controller to SCADA comparison covers that choice — but the input side above does not change. For OPC DA, open the topic's Device Items list and add the historian tags you want exposed. A listed tag appears in an OPC client's browse tree; an unlisted tag is still readable by its exact item name as long as it exists in the historian. Save, and a DA client reads values.
The documented configuration establishes the DA output. OPC UA is a separate output with its own endpoint and security settings: inspect them and prove the endpoint with a UA client before telling the destination that UA is live, because a successful DA read is not evidence about UA. If you would rather bridge at the edge, bridging OPC UA PLC data to MQTT with an edge PC is the alternative pattern.
Publish the same tags over MQTT #
- Add an MQTT_BROKER connection in the gateway configuration and enter the MQTT server address and connection details.
- Add an MQTTGroup connection beneath the broker and confirm it connects.
- Open the historian topic's MQTT Publish Items tab and select the new MQTT configuration under Publish User group — a working historian input publishes nothing until this is set.
- Add the items to publish, adjust Unique Item ID if the destination's syntax needs it, and check the MQTT topic syntax for the subscriber.
- Save the configuration, deactivate the gateway, then activate it again so the broker connection loads.
The restart limit #
The I/O Server exposes the most recent original value for a tag from the moment the historian starts. Reboot the historian computer and it returns nothing for that tag until the historian receives a new value for it; the Live table carries the same restriction. No item-name, topic or output-protocol change fixes this, because the gap is on the input side. Treat it as the design constraint it is: a destination that must show a value immediately after a restart is not served by this path.
Worked example: the stale window for a tag on a 300 s update after a restart #
Inputs:
- Restart duration: 300 s — illustrative; take this from your own maintenance restart length.
- Source update period for the tag: 300 s — illustrative; take this from the tag's scan configuration on the source.
- Rule: the documented behavior above — no value from the I/O Server until a new source value arrives.
The rule in words: in the worst case the restart ends just after the source sent an update that was lost, so the destination waits the full restart plus one full update period before any fresh value exists to publish.
Arithmetic, worst case:
300 s restart + 300 s update period = 600 s 600 s ÷ 60 s/min = 10 min
Best case, restart ending just as an update arrives: 300 s + 0 s = 300 s. The destination is therefore without a fresh value for 300–600 s, and an already-connected MQTT client displays its last received update throughout.
Decision: if the destination must see a value newer than restart duration plus one update period — 600 s in this case — the I/O Server path cannot deliver it after a restart; take that tag to T-SQL or the historian SDK for the last stored value. If a held last value for up to 10 min is acceptable, the configuration above ships as built.
Prove the path with one tag #
Trace one known tag end to end — input, mapping, output — before diagnosing anything from an empty browse tree or a silent subscription.
| What you see | What it means | What to do |
|---|---|---|
| Tag browses in the OPC client but reads no value | The item name resolves; the historian has no new value since startup | Confirm the feed into the historian is updating the tag |
| Tag missing from the browse tree | It was not added to Device Items | Add it, or type the exact item name in the client |
| MQTT group connects, nothing arrives on subscribe | The input side may be fine; the publish side was not selected | Open the topic's MQTT Publish Items tab and set the configuration under Publish User group |
| Values stop after a historian restart | Documented I/O Server behavior | Wait for the next source value, or move the tag to a disk read |
Get the last stored value from disk #
T-SQL and the historian SDK are the two routes that read what is actually stored, timestamp included, and they are the only ones that satisfy "last known value right now" after a restart. Verify the retrieved value and its timestamp against the tag before handing it to the destination as current. When the destination is another historian rather than a live client, this becomes a server-to-server transfer, the same family of job as when you move PI historian data to another PI server without MQTT.
Questions asked
Does this create a new connection to the DCS or PLC?
No. The only new connection is between the gateway and the historian computer over SuiteLink; the feed that already pushes values into the historian is untouched, and the controller never sees another client. The trade-off is that you read the historian's copy of the value, which is why the restart limit in this article exists at all.
Can I read the values with OData or the historian API instead?
Yes, for on-demand retrieval. The historian exposes OData and its own API as additional retrieval paths; they suit a client that asks for a value when it needs one, including the last value stored on disk. They do not push anything, so if the destination wants an unsolicited stream, the gateway output — OPC DA or MQTT — is the piece that publishes.
Do I have to list every tag in Device Items?
No. Device Items is a browse convenience: a tag listed there appears in an OPC client's browse tree, while a tag not listed can still be read by typing its exact item name, provided it exists in the historian. For large tag sets you can import the list from CSV instead of adding items one by one.
What does an MQTT subscriber see during a historian restart?
A client that was already connected keeps the last update it received and simply shows nothing new. No publication arrives until the historian receives a fresh source value and the gateway forwards it. A client that subscribes during the gap has nothing to show for that tag until the same thing happens, because the gateway does not republish values from disk.