Troubleshooting
Stop duplicate InTouch alarms in Historian on TSE
Short answer
Every TSE session runs a full InTouch instance, and each one submits its own alarm and event records to Historian, so one transition lands once per session. $HistoricalLogging = false stops value historization only. Split the project: a server application that owns alarm generation and all Historian logging, and client applications with neither, with every alarm display reading the server's provider.
On this page
- Why every session writes the same alarm
- First checks before changing anything
- Counting the duplication factor for one forced alarm with one console and two client sessions
- Why $HistoricalLogging does not stop the alarm records
- The fix that worked: two applications
- The alternative: one project with console-owned alarms
- Questions asked
Every Terminal Services session that launches the project runs a complete InTouch instance, and each instance historizes the alarm transitions it sees, so one alarm lands in Historian once per session. Setting $HistoricalLogging to false stops value historization only; the alarm and event path keeps writing. The arrangement that resolved the reported case is a split project: one server application that owns alarm generation and all Historian logging, and client applications with neither, every operator display reading the server's alarm provider.
Why every session writes the same alarm #
A terminal server hosts several sessions on one machine. Each session running the project is a full application instance with its own alarm evaluation and its own Historian logging. Identical project files do not merge those instances into a single alarm owner: with several sessions running, one alarm transition is evaluated and submitted once per session, and Historian stores what it receives.
The reported installation carried a useful marker. The classic path through WWAlmDb, the Alarm DB Logger utility that writes alarm records to a SQL database, produced single records, while the repeats appeared once alarm and event historization to Historian ran in every session. That difference points at who submits records on each path; it is a reported observation about that installation, not a property promised for the utility.
Deliberately running two writers is a different design with an ownership rule, the situation covered where redundant InTouch historians log the same tags in parallel, whereas a TSE deployment has the writers without the rule.
First checks before changing anything #
- Pull the stored records for one alarm condition and compare the alarm identity, the transition type, the timestamp and any node or provider fields the client exposes. The same transition stored several times under different sessions is duplication; an activation followed by its return-to-normal and its acknowledgment is one alarm's lifecycle.
- Count the InTouch instances actually running, the console session plus every Remote Desktop session, and hold that number against the repeats from one controlled alarm.
- Watch the tag value through a transition. A value crossing its limit repeatedly generates real records that no logging change removes; correct the signal or the deadband first.
- Check which alarm provider each operator display reads: the console session's provider, its own session's provider, or several. Only the first survives centralization.
Counting the duplication factor for one forced alarm with one console and two client sessions #
The inputs, for a typical TSE arrangement of the kind reported in the field:
- Application sessions running: 3, one console session and two Remote Desktop client sessions.
- Controlled transitions forced for the test: 2, the condition driven active and then returned to normal.
- Instances with alarm and event historization enabled: 3, one per session, which is the misconfiguration under test.
The rule in words: the records Historian stores for one alarm equal the number of transitions times the number of running instances that historize alarms and events.
The arithmetic:
- Stored records: 2 transitions × 3 instances = 6 records.
- Correct records: 2 transitions × 1 owner = 2 records.
- Duplication factor: 6 ÷ 2 = 3.
The factor equals the running instance count of 3, which is the signature of session-level duplication: split the project so one application owns alarms and logging. A factor of 1 with records still accumulating over time means the tag is cycling across its limit or two collection paths are live, and the fix belongs in the signal or the collector, not the architecture.
Why $HistoricalLogging does not stop the alarm records #
The system tag does what its name says for values: value historization to AVEVA Historian follows it, so a session with $HistoricalLogging false stops writing tag values. In the reported TSE installation, alarm and event historization kept writing with the tag false, and the behavior was passed to the vendor's development team. The startup line proposed for this, $HistoricalLogging = TseQueryRunningOnConsole() > 0; , therefore gates values only and was never a working suppression of alarm records.
| Control or function | Where it lives | What it does here | Limit |
|---|---|---|---|
| $HistoricalLogging | InTouch system tag | Toggles value historization to Historian | Alarm and event records continued with it false, in the reported installation |
| $System.AlarmEnabled | Alarm generation control | Stops a session raising alarms at all | Displays still bound to the session's own provider lose their alarms |
| TseQueryRunningOnConsole() | Application startup script | Reports whether the instance runs in the console session | Identification only; the call disables nothing |
| GetNodeName() and TseGetClientNodeName() | Application script | Identify the node and the client node | Same limit: identity, not suppression |
| WWAlmDb, the Alarm DB Logger | Classic logging path | Writes alarm records to a SQL database | Produced single records in the reported installation |
The fix that worked: two applications #
This split resolved the reported duplication, and it is the route to take when two variants of the project can be deployed and maintained:
- Record what runs today: every application instance, the alarm provider each display reads, and the current Historian logging configuration.
- Choose the owner: the application that runs independently of operator logins, in the console session or on a dedicated node. A TagServer application is the same idea taken further, one application owning the tags and the logging while every other application reads from that machine.
- Keep all historization in the server application: value logging and alarm and event logging together.
- Build the client application without historization, removing the alarm and event logging explicitly rather than trusting $HistoricalLogging to cover it.
- Point every operator alarm display at the owning application's alarm provider.
- Rerun the forced-alarm count above; the duplication factor must come back as 1.
After the split, verify logging where it is configured, because historian logging that never restarts after an SMC re-enable is a separate fault with its own diagnosis.
The alternative: one project with console-owned alarms #
When two variants cannot be maintained, keep one project and centralize alarm generation instead:
- In startup logic, enable alarms only for the console role: drive $System.AlarmEnabled from TseQueryRunningOnConsole(), true in the console session, false in every client session.
- Direct every alarm client to the console session's alarm provider, the arrangement the InTouch documentation describes for session-wide alarm ownership.
- Leave value historization on the same console session so values and alarms share one owner.
Two limits come with it. Role detection must be right at startup, before an operator acts on a display. And the change that hurts: a display left bound to its own session's provider shows no alarms once that session stops generating them, so operators lose alarm visibility, which is the one failure mode to avoid. For keeping alarm views consistent across sessions in a single project, the InSource technique note TN IT269 covers synchronizing alarms between Terminal Services sessions in InTouch.
The decision between the routes: separate applications when two variants are maintainable, because that is the demonstrated fix and it gives an explicit configuration boundary; console-owned alarms when only one project can exist. In neither case is the $HistoricalLogging startup line the alarm fix.
Questions asked
Why did the same project log single records through WWAlmDb?
In the reported installation the classic path ran through one node-level utility, the Alarm DB Logger, so the sessions did not multiply it, while Historian alarm and event historization ran inside each session's application. That points to per-session submission on the Historian path, not to a guarantee about the utility, so on any path verify which instance actually writes.
Are activation, return-to-normal and acknowledgment three duplicates?
No. One alarm condition normally produces an activation record, a return-to-normal record and an acknowledgment record; that is its lifecycle. A duplicate is the same condition and the same transition stored more than once. Compare the transition type and the session or provider attribution before deleting anything from the history.
Where should the alarm history database sit?
For consolidation, keep the alarm history in its own database on the same node as the Historian. Once a single owner writes the records, that keeps alarm storage and queries separate from tag history while everything stays manageable in one place.
Can a script gate Historian alarm logging per session?
Not with the functions named here. TseQueryRunningOnConsole(), GetNodeName() and TseGetClientNodeName() identify where an instance runs; none disables the alarm and event path, and $HistoricalLogging gates values only. The working controls are application separation or $System.AlarmEnabled with every display repointed to the owner's provider.
What is the acceptance test after the split?
Force one alarm active and return it to normal, then count the records Historian stored for that condition. Two transitions from one owner must give exactly 2 records; any higher count means an instance is still historizing alarms, so re-check the client variant's alarm and event configuration.