How-to
Write calculated tags to AVEVA Historian readable via SuiteLink
Short answer
A calculated value becomes a tag a SuiteLink client can read when the SQL write targets the History table with wwVersion set to Realtime; the Live table is not an insertion target, and that one option is what makes the value appear through aahIOSvrSvc. If the calculation already runs in an object script, historize a user-defined attribute instead and use SetAttributeVT() when the stored timestamp must differ from execution time.
On this page
A calculated value becomes a tag that a SuiteLink client can read when the SQL write targets the History table with wwVersion set to Realtime. Historian does not accept a SQL INSERT on the Live table, so a write aimed there stores nothing and gives aahIOSvrSvc nothing to report. If the calculation already runs in an object script, the cleaner path is a user-defined attribute with historization enabled. There is no third option: Historian has no native facility that evaluates user-defined calculations on live values and stores the result.
Match the write path to where the calculation runs #
Three paths cover the requirement, and only two of them store anything.
| Write path | Where the calculation runs | What gets stored | Choose it when |
|---|---|---|---|
| Historized object attribute | A System Platform object script; InTouch and Plant SCADA scripting fill the same role | The result, written to a user-defined attribute with historization enabled | The calculation already belongs in application logic |
| Realtime history insertion | SQL analysis or an external program | A sample inserted into History with wwVersion set to Realtime | An externally owned result must be readable as a tag through aahIOSvrSvc |
| Ad hoc expression | Historian 2023 Advanced expression processing | Nothing; results exist only in charts and reports | The derived value is presentation-only |
The decision is ownership. If the platform already computes the value, historizing the attribute adds no database write at all. If the value comes out of SQL analysis or a separate program, the realtime insertion into History is the path that makes it a genuine Historian tag served back over SuiteLink.
Why the trend showed the value but the DI object did not #
A trend and a SuiteLink-bound display do not exercise the same read path. The trend retrieves stored samples over a time range; a DI object subscribes to a current-value item served by aahIOSvrSvc. A sample can satisfy the historical query without ever reaching the live subscription, so a value visible in a trend proves nothing about the DI object.
| What you see | Where the fault usually is | Decisive check |
|---|---|---|
| Historized object tags update; the manual tag does not | The manual tag's write path | Compare against a History insert with wwVersion set to Realtime |
| The value is in the trend but not the bound display | Historical retrieval versus live delivery | Read the DI object's value, quality and timestamp, not the trend |
| The DI object receives the value; the screen stays stale | OMI display binding | Compare the attribute the display reads with the one the DI object updates |
| A known-good tag and the manual tag both stop | The shared SuiteLink connection or I/O service | Check connection diagnostics before touching the calculation |
| The calculated tag updates with a wrong value | Inputs, units or destination mapping | Compare the computed result with the stored sample before suspecting delivery |
The settings that carry the write to aahIOSvrSvc #
AVEVA documents Transact-SQL INSERT and UPDATE support for the History table and the typed AnalogHistory, DiscreteHistory and StringHistory tables, in the release documentation on inserting or updating data with Transact-SQL statements. Within that support, two settings decide whether the write reaches the I/O server.
| Setting | What it is | Effect |
|---|---|---|
| History | Insertion target table | Takes the sample write used on this path |
| Live | Live-value query interface | Serves reads; an INSERT aimed at it stores nothing |
| wwVersion = 'Realtime' | Write option on the insert | Selects the realtime insertion behavior aahIOSvrSvc reports |
| aahIOSvrSvc | Historian I/O server | Serves tag items to SuiteLink clients such as DI objects |
Nothing about the I/O server's tag exposure has to be reconfigured. The delivery mechanism is the one described in how AVEVA Historian publishes collected data to a client: once the sample is stored through the realtime option, the I/O server reports it like any other current value.
Write and verify the realtime insert #
Take the column list, value and quality handling from the documented insertion form for the installed release; the two decisive elements are the History target and the wwVersion = 'Realtime' option. Commission in this order:
- Confirm the destination tag exists and its data type matches the calculated value. Record the tag name exactly as the writer uses it and the item name exactly as the DI object references it.
- Keep one known-good historized System Platform tag subscribed on the same SuiteLink connection. Its continued updates separate a tag-specific fault from a service-wide one.
- Build the insert: History as the target, wwVersion set to Realtime, with explicit tag, timestamp, value and quality.
- Append current samples in routine operation. In-order realtime appends are the efficient case; out-of-order inserts are much less so, so keep backdated corrections out of the routine path.
- Commission with a recognizable test value inside the tag's configured range, and write it only to a tag that no control or interlock logic consumes, because a stray value on a control tag can trip logic.
- Verify on the DI object: value, quality and timestamp. Then cross-check the same sample in a trend; the two checks prove different things.
- Connect the real calculation and repeat step 6 once.
Worked example: an hourly average of a reactor temperature is computed from twelve five-minute samples, in degrees C: 61.2, 60.8, 62.4, 63.1, 62.0, 61.5, 60.9, 62.2, 63.0, 62.7, 61.8 and 62.1. Their sum is 743.7, so the average is 743.7 / 12 = 61.975, stored as 61.98 at the tag's two-decimal resolution; the 0.005 difference is rounding, not a write error. The insert appends that sample with the current timestamp and wwVersion set to Realtime, and the DI object must show 61.98 with good quality and the written timestamp.
At one write per hour that is 24 inserts per day. At a five-minute cadence it is 24 x 12 = 288 inserts per day, all still in-order appends as long as each write carries a current timestamp.
When a historized attribute is the better path #
If the calculation already executes in an object script, write the result to a user-defined attribute and enable historization: the value rides the platform's own storage and reaches clients like any historized tag, with no database write to build or maintain. Use SetAttributeVT() in the script when the stored timestamp must differ from execution time; the timestamp-control concerns are the ones covered in writing timestamped history back into a SCADA server. For structuring such attributes, the approach in finding calculated attributes in Wonderware ArchestrA objects applies.
The realtime-insert path also serves the architectural goal of keeping database connections out of System Platform and OMI. The SQL work stays on the producing side, and the DI object consumes the result over the existing I/O connection, with no new database connection in the platform.
What expression processing will not do #
Starting with Historian 2023 Advanced, expressions calculate over stored history for charts and reports, and the results are not stored. An unstored result cannot back a SuiteLink item, so expressions answer reporting questions only. When anything must read the calculated value live, whether a DI object, an OMI display or another subscriber, use the historized attribute or the realtime insert into History.
Questions asked
Why did my insert into the Live table never reach SuiteLink?
A write aimed there stores no sample and gives aahIOSvrSvc nothing to report. Move the write to the History table and set wwVersion to Realtime; the same statement then reaches the SuiteLink item.
Are backdated or out-of-order inserts just as efficient?
No. Appending newer values with the Realtime option is the efficient case, and out-of-order data is much less so. Keep routine writers appending current samples and reserve backdated corrections for one-off fixes.
Do expressions in Historian 2023 Advanced create a stored tag?
No. Expression processing performs ad hoc calculations for display in charts and reports, and the results are not stored as tag history. An unstored result cannot back a SuiteLink item, so use a historized attribute or a realtime insert into History when the value must be readable live.
Which Historian tables accept Transact-SQL INSERT and UPDATE?
The documented targets are the History table plus the typed AnalogHistory, DiscreteHistory and StringHistory tables. Match the table and column handling to the destination tag's data type per the release documentation, then verify a readback before relying on the writer.