Skip to content

Context model

A context model is one configuration resource per collection: the project it belongs to, the alarms Alarm Health reads, and the assets of the area: each with its tags (role, unit, normal range, limits), its alarms, free-text rules and linked documents: and the relations between assets. It is what lets a run know that PT-101 is the inlet pressure of pump 3, that 40–60 psi is normal, and which SOP to quote.

{ "project": "Production", "displayName": "Line 2", "aiCutoff": false,
  "alarms": { "journal": "MainJournal", "include": ["[default]Line2/*"], "exclude": ["*|Diag*"] },
  "assets": [
    { "id": "line2.lact", "name": "LACT", "type": "meter", "parent": "line2",
      "tags": [ { "path": "[default]Line2/LACT/Runtime", "role": "measurement", "unit": "h",
                  "normal": { "min": 0, "max": 6 }, "limits": { "hh": 8 } } ],
      "alarms": [ "[default]Line2/LACT/Runtime|HighRuntime" ],
      "rules": [ { "id": "r1", "tag": "[default]Line2/LACT/Runtime", "condition": "Runtime > 6 h in one run",
                   "consequence": "damage to the LACT", "action": "stop and inspect", "source": "operator" } ],
      "documents": [ "<document id>" ] } ],
  "relations": [ { "from": "line2.oiltank", "to": "line2.lact", "type": "feeds" } ] }
  • alarms.journal may be left out when the gateway has one journal. Patterns are case-insensitive, * matches anything, and a pattern holding | matches <tag path>|<alarm name>; an empty include means every source. The policy's read.tagProviders and read.excludeTagPaths still decide first.
  • Tag role is measurement, state or setpoint; a measurement may carry kind (perPart or continuous, see Per-part results); relation type is feeds, controls, measures, sharesUtility or contains.
  • Any tag may carry a name: the words people at the plant use for that reading ("name": "intensifier response"), at most 100 characters, not blank. Every page names a reading the same way: the Findings list, the finding page's subtitle, the Anomaly Watch queue card, finding titles and texts, the digest email and the Alarm KPIs findings list: the asset's name, then the tag's name; with no name, the last part of the tag's path as the model writes it, split into words (IntResponseMs reads "int response", a trailing unit dropped or turned into the quantity it measures, so MetalTempF reads "metal temperature"). A path listed under several assets is named by the finding's asset; with none, it is led by its folder and uses a name only when every asset gives the same one. A name is shown, never matched: no check uses it to find or classify a tag (rules such as the station pump rule read the tag's path), and a finding's identity does not include it, so adding or changing one never changes what is filed. The one exception: on a tag with a source (section 7.7) the name is also the measurement name the source's rows are matched by. Until 1.5.21 a save refused name on a tag without a source, and pages that named a reading from the stored, lower-cased path showed "DCM-304 intresponsems".
  • A measurement tag may name its setpoint tag and the band it should hold, for Anomaly Watch's setpoint check (section 8.5): "setpoint": "[default]Cell2/DCM-203/MetalTempSp", "tolerance": {"abs": 10} (in the tag's unit) or "tolerance": {"pct": 2} (of the setpoint), not both. With no setpoint named, a setpoint-role tag on the same asset is paired by name when the match is unambiguous (MetalTempF with MetalTempSp). A save refuses a setpoint or tolerance on a tag that is not a measurement, a setpoint naming the tag itself, and a tolerance of 0 or less (or 100 % or more).
  • A measurement tag held on its setpoint by a controller may declare it, for the controlled-output check (section 8.5, A controller that hides a sensor): "control": {"manipulated": "[default]Plant/Aeration/TotalAirflowScfm", "load": "[default]Plant/Headworks/InfluentFlowMgd", "lab": {"source": "query:Plant/PlantDaily", "name": "avg_do_mgl"}, "acts": "raises"} next to its setpoint. manipulated (required) is the tag the controller moves; load (optional) is a demand signal that sets how much output is normal (BOD or ammonia load, throughput of the thing being controlled), not a hydraulic flow the output does not follow; lab (optional) is a second reading of the same quantity (a hand-held or lab value) read from a named query or script (query: or script: source) as a sourced tag is: it returns every measurements column, time, asset, product, name, value, unit, recordId (product, unit and recordId may be null but must be there, e.g. NULL AS product; a source missing a column is not read, and the finding's evidence labProblem names the missing columns); the lab's asset, which must be an asset of the model, defaults to the tag's own, and the rows' asset column must name it; a DATE column is read as midnight of that day in the plant's time zone; acts (optional) says whether more output raises or lowers the reading, and the finding says which way the sensor may be off only when it is given. Nothing is inferred: a save refuses a control with no setpoint, no manipulated, a manipulated that is the measurement or its setpoint, a lab with no name or a malformed source, an acts other than those two, or a control (or a setpoint) on a tag marked kind: "perPart" (a per-part result is judged by parts, never held on a setpoint; a tag only inferred to be per part is not covered, so mark it); a lab source is also checked the way a sourced tag's is (policy, project, the query and its start/end parameters).
  • aiCutoff: true stops every run on the collection before anything is gathered or sent (SKIPPED, ai-cutoff). Use it to pause a collection without touching its playbooks.
  • The collection name gateway is reserved for Gateway Health and cannot hold a context model.