Instruction bindings
An instruction claim is a requirement taken from one of a site's documents, such as "cure at 180 °C ± 5 °C", confirmed by a person (see Instruction claim drafting). A binding is what an integrator writes to say which tag of the plant's equipment that claim governs: one confirmed claim, one concrete OPC UA node id (or, beside a log or a broker, one field of each record), the unit the tag is in, the condition under which the claim applies, and a product and an operation as labels. Instruction conformance says each part of the feature in a few lines and links here for the detail.
A binding is part of an MES Node's configuration, in the instruction_bindings section. It needs the Node's
document_intake section, so it is for a Node that reads documents, and it works with any of the Node's three
sources: beside opcua it names tags and is polled, and beside mqtt or database_log it names fields of each
record and is judged as each record arrives (What is allowed beside which source
has the difference). A binding is written, checked, listed and previewed, and one in observe or alert mode
is also evaluated live: beside opcua the Node reads its tags, compares each reading with the claim's limits,
and keeps a summary of each run (see
What the Node does with an enabled binding). A binding
in alert mode also raises an alert when a reading stays outside a limit for as long as the binding says (see
Alerts); observe mode judges and summarises in exactly the same way and raises nothing.
A worked example
{
"oven1-cure": {
"claim_id": "7f3c1b52-2d0e-4c58-9a1f-6e4b8d2a9c10",
"node_id": "ns=2;s=Oven1.CureTemp",
"unit": "°C",
"condition": { "node_id": "ns=2;s=Oven1.Recipe", "equals": "ProductA" },
"product": "Product A",
"operation": "Cure",
"min_interval_seconds": 900,
"poll_interval_seconds": 10,
"persistence": { "readings": 3 },
"mode": "disabled"
}
}
The section is an object keyed by the binding's id (letters, digits, _ and -, up to 64 characters, starting
with a letter or digit). claim_id is the id claims prints beside the claim (below).
Configuration reference
Each binding takes these keys and no others.
| Key | Meaning | |
|---|---|---|
claim_id |
required | The id of the confirmed claim this binding is for, as claims prints it. |
node_id |
beside opcua |
The one OPC UA node id the claim governs. See Where a tag is read from. |
field |
beside a record source | The field of each record that holds the measured value. See Beside a record source. |
time_field |
beside a record source | The field of each record that holds when it was written, as UTC text. See Beside a record source. |
unit |
required | The unit the tag's readings are in. It must be the claim's unit; nothing is converted. |
condition |
required | When the claim applies: equals, the value (text, a number or true/false) it must have, and the second tag of the same endpoint, node_id, or, beside a record source, the field of each record, field. equals is always required, and so is the tag or the field. |
product |
required | A label naming the product the claim is for. |
operation |
required | A label naming the operation the claim is for. |
min_interval_seconds |
3600 | The shortest time between two alerts for the same cause, from 60 (a minute) to 604 800 (a week). See Why the interval works the way it does. |
poll_interval_seconds |
10 | How often the Node reads the binding's tags, from 1 to 3 600 seconds. Beside opcua only; a record source has no poll. |
persistence |
{"readings": 1} |
How long a crossing must last to count: exactly one of readings (a whole number, 1 to 10 000) or seconds (above 0, at most 86 400). |
mode |
disabled |
disabled, observe or alert. A Node may run at most 50 bindings in observe or alert mode; any number may be disabled. |
product, operation and unit take text without control characters (a new line, a tab or a NUL), and equals, when it
is a number, must be finite. A configuration that breaks either is refused when it loads, naming the binding and the key.
The condition exists because no reading says which product or operation is running. Equipment that is idle, or
making another product, would otherwise be held to a claim that does not apply to it. product and operation
are labels only; nothing in a reading is compared with them.
What is allowed beside which source
The Node's source decides which keys a binding takes. The rest of a binding, the claim, the unit, the labels,
persistence, min_interval_seconds and mode, is the same beside every source. The offline check and the Node's
start refuse a key that belongs to the other form, naming the binding and the key and never repeating a value.
Beside opcua | Beside mqtt or database_log | |
|---|---|---|
| What the binding names | A tag: node_id, and condition.node_id for the scope |
A field of each record: field, condition.field for the scope, and time_field for when the record was written |
| Where the names come from | The OPC UA server of the Node's own opcua section |
The fields the section's mapping (field_map) produces; a name the mapping does not produce is refused |
| Refused | field, condition.field, time_field |
node_id, condition.node_id, poll_interval_seconds |
| When it is judged | Every poll_interval_seconds, from a consistent pair of reads |
As each record arrives, for the record's own order |
| What a run is | The stretch of polls in which the condition holds; each is kept as a run summary | The records of one order outside a limit in a row; no summary is kept |
observe |
Judges and keeps run summaries, and raises nothing | Judges and keeps nothing anyone can see, so only alert is of use |
alert |
Raises an alert when a crossing is confirmed | The same, and the alert names its order |
| State | A run, in memory, for each binding | A run, in memory, for each binding and each order |
Also required beside every source: document_intake. A Node with a binding and no document_intake section is
refused.
Limits beside a record source
- A crossing that is followed by no further record is never confirmed, because a log says nothing about the value after its last row.
- There are no run summaries, so a run that never crossed a limit leaves nothing to read.
- State is in memory, so a restart begins every run again.
- A binding remembers at most 4 096 orders and 8 192 readings. An order it has forgotten starts its run again, and a reading it has forgotten counts again; either can only make an alert later or sooner on a record that really was outside the limit, never raise one for a reading that was inside.
- A time that is not UTC text is not judged. Beside a record source has the rest.
Beside a record source
A log has events and no current value to read, so a binding beside mqtt or database_log is judged as each
record arrives, not on a poll. It names two fields of each record in place of two tags, and a third field that says
when the record was written. Everything else about a binding, the claim, the unit, the labels, persistence,
min_interval_seconds and mode, is as above. The fields are the ones your mapping produces (field_map).
{
"oven1-cure": {
"claim_id": "7f3c1b52-2d0e-4c58-9a1f-6e4b8d2a9c10",
"field": "oven_temp",
"time_field": "recorded_at",
"unit": "°C",
"condition": { "field": "recipe", "equals": "ProductA" },
"product": "Product A",
"operation": "Cure",
"min_interval_seconds": 900,
"persistence": { "readings": 3 },
"mode": "alert"
}
}
A binding there takes field, condition.field and time_field, and refuses node_id, condition.node_id and
poll_interval_seconds; beside opcua it is the other way round. The offline check and the Node's start refuse the
wrong keys, naming each by key and never repeating a value. They also refuse a field, condition.field or
time_field that is not a field your field_map produces, because a record has no other fields and a binding
that names one would quietly judge nothing.
- The order is the record's own, and each order is judged on its own. A log interleaves orders, so the Node keeps the run outside a limit for each binding and each order. A record of another order between two of an order's records does not break its run. An alert names its order, and a second order's excursion is its own alert, not a repeat of the first order's. The Node remembers at most 4 096 orders for a binding, and an order it has forgotten starts its run again, which can only make an alert later.
- Every record is a reading, a repeat of the last value included. A record the Node is handed twice (a re-read, or a retried step) counts once; the Node remembers the last 8 192 records of a binding for that.
readingsis the number of consecutive records of that order.secondsis measured between the records' own times and is confirmed only by a record at or past that time. A crossing that is followed by no further record is never confirmed: a log says nothing about the value after its last row, so the Node never alerts on a time in which it has no evidence. This is a limit, and a shortreadingscount is the alternative.time_fieldmust hold UTC, as text in ISO 8601 ending inZor+00:00, such as2026-11-20T14:05:09Z. Adatabase_logtimestamp column is already given that way. A record whose time is missing, is not a time, has no zone or is in another offset is not judged: the run outside a limit starts over, and the Node writes one Activity Log entry naming the binding, the order and the field (never the value), when it begins and not again until a record with a usable time has come between, so a mis-mapped feed costs one entry for each order and not one for each record. The time the Node read the record is not used, because after an outage or a re-read it would measure the Node and not the log.- The measured value is a number, or text that is plainly a number (a log's
numericcolumns arrive as text). Anything else is not evaluable and starts the run over. - A reading back inside the limits ends the run, so the next excursion is counted as a recurrence of the alert
(inside
min_interval_seconds) or raises a new one. Nothing clears an alert by itself; acknowledging it is a person's act. - No run summaries. A run is a stretch of polls, and there are none here, so
observemode judges and raises nothing visible and onlyalertmode is of use. - While the Node's database is down at start, records are not judged and the order's own status and reconciliation go through; the start is tried again every 5 seconds and not for each record.
- The claim is judged when the first record arrives and again every minute, as for a polled binding, and a binding whose claim stops being current is stopped for good with one Activity Log entry.
What each mode does
| Mode | What it does |
|---|---|
disabled |
The binding is checked and kept. The Node never reads its tags. |
observe |
The Node reads the binding's tags, judges each reading against the claim's limits and keeps a run summary of each run. It raises nothing: no alert row, no alert entry and no Trigger. Beside a record source there is no run summary, so it judges and shows nothing. |
alert |
Everything observe does, and a reading confirmed as a crossing raises an alert. |
observe exists so that a binding can be watched on live data, and its run summaries read, before it is allowed to
raise anything. persistence decides when a reading outside a limit counts as a crossing, and
min_interval_seconds decides how often the same cause may raise an alert.
What the Node does with an enabled binding
Beside opcua, a Node with a binding in observe or alert mode reads that binding's tags from its own OPC UA
endpoint every poll_interval_seconds. (Beside a record source the Node reads no tag; see
Beside a record source.) Every reading is judged, including one that repeats the
last value, because a crossing that lasts is the point.
- A consistent pair. Each poll reads the condition tag, then the measured tag, then the condition tag again. If the condition changed in between, the poll is discarded and judged by nothing: a reading is never compared with a scope that stopped holding while it was read.
- What counts as a reading. A number, taken while the condition holds. A missing value, text,
trueorfalse, NaN and infinity are not evaluable, and are never a crossing, whatever the value would otherwise mean. - A tag that cannot be read. Nothing is judged for it, and the run of readings outside a limit starts over, so a crossing is never confirmed across a gap. The Node writes one Activity Log entry when a binding's tags first cannot be read (naming the binding and the claim by id, and whether the measured tag, the condition tag or the endpoint as a whole could not be read) and one when they can be read again. A failure of the endpoint itself ends that poll, so an outage costs one wait and not one for every tag; a refusal of one tag (an unknown node id) affects only the bindings that read it.
- A condition that is read but cannot be understood (no value, not a finite number, or a kind of value the binding does not expect) is recorded the same way: one entry when it begins and one when it ends.
- Run summaries. A run is the stretch in which the condition holds. Its count, smallest, mean and largest reading,
standard deviation, how many readings were outside a limit, the binding's labels and the claim's revision are
written to
instruction_run_summaries. A run the Node stopped during is recorded as interrupted at the next start. - At start the Node first completes any alert the last process left half written (see If the Node stops in the middle of raising one), and then judges each enabled binding's claim. A binding whose claim is not current, whose unit is not the claim's, or whose limits cannot be compared is not read; the Node logs which binding and claim (by id) and why, and writes one Activity Log entry for it, and goes on with the others.
- Every minute after that the Node judges the claims of the bindings it is still reading, all together, and a binding whose claim has stopped being current is stopped for good. See When a claim stops being current.
- Cost. A measured tag is read once per poll and a condition tag twice (before and after it), however many bindings name them. All bindings share one connection to the endpoint. At the limit of 50 bindings with their own tags at 1 second each, that is three reads per binding per second.
Alerts
A binding in alert mode raises an alert when a reading is outside one of the claim's limits, with the scope
condition holding, for as long as the binding's persistence says. The comparison is the same one observe mode
and the preview make; nothing is decided by a model.
An alert is never held for approval. A person confirmed the claim and an integrator wrote the binding, so the oversight is upstream of the alert, and a threshold that has been crossed is a fact and not a draft. Nothing waits for a model either: the alert is recorded first, and an explanation of it reaches a reader separately.
What an alert is
An alert is three records that share one id: a row in instruction_alerts,
an Activity Log entry, and a deviation Trigger.
The Activity Log entry has the task type instruction conformance: alert raised, the trigger
instruction_binding_limit and the outcome alert_raised. Its reference ids are:
| Key | Holds |
|---|---|
alert_id |
The alert's id, which is also the entry's id |
binding_id, claim_id |
The binding and the claim, by id |
rule |
<binding id>:lower or <binding id>:upper: the limit the reading crossed |
limit_name |
lower or upper |
measured_value, limit |
The reading that confirmed the crossing and the limit it crossed |
unit |
The binding's unit |
product, operation |
The binding's labels |
suppressed_before |
How many repeats the previous alert for the same cause had counted (see below) |
document, revision, locator |
Where the instruction is: the document's title (or its number when it has no title), the revision label and the locator, each left out when the claim has none |
The entry carries no sentence from the instruction and no value of the scope condition. It is published on the Node's Activity Log topic, where a site's own tools can read it, so it says where the instruction is and not what it says. It is written at once, and it is never changed afterwards; a repeat is counted in the table, not in the log.
The Trigger is a deviation Trigger with the alert's id as its own id, so queueing it twice is one Trigger. It
is what Case Triage turns into a drafted explanation for a person to review.
Because the explanation needs the instruction's wording, the payload carries it:
| Key | Holds |
|---|---|
alert_id, binding_id, claim_id, rule, limit_name |
As in the entry |
limit, measured_value, unit |
The limit, the reading and the unit |
claim_sentence |
The instruction's sentence, cut to 1000 characters |
claim_locator, document, revision |
Each cut to 200 characters |
product, operation |
The binding's labels |
held_readings, held_seconds |
How many readings, and how many seconds, the value had been outside the limit when it was confirmed |
raised_at |
When the confirming reading was taken |
suppressed_before |
As in the entry |
The whole payload stays under 4096 bytes. Text can be four bytes to a character, so if the cut texts still do not fit, the longest is shortened until they do; the numbers and ids are never cut. The payload holds no value of the scope condition and no node id. It does hold the instruction's sentence, which is plant wording: it goes to the model of a Node with inference enabled, and is listed as plain facts by a Node without it.
"Recorded, visible and published." That is the whole guarantee. The alert is recorded in the append-only, tamper-evident Activity Log and in the table. It is visible to anything that reads either. It is published on the Node's Activity Log topic, which is a live feed and not a delivery guarantee (see Restart behaviour for what a broker restart costs). Kindred does not page a person, does not send an alert again on a timer and does not escalate. A site's own alarm or notification tool can subscribe to the topic.
Which readings raise an alert, and which are only counted
Every alert has a root cause key, a SHA-256 of the binding id, the claim id, the limit that was crossed
(lower or upper) and the scope condition's tag and the value it must have. The same key means the same cause.
It is computed by the Node from those five things and from nothing else: no model decides it, and nothing about the
reading goes into it. Crossing the lower limit and the upper limit are therefore two causes, and so are two
bindings, two claims, or one binding edited to a different condition. The alert's own id is derived from the key
and the time of the reading that confirmed it.
Only a reading the binding's persistence rule has confirmed is considered at all. For each of those:
| The reading | The latest alert for this cause | What happens |
|---|---|---|
| Any | None | A new alert is raised |
| Any | Raised at least min_interval_seconds ago |
A new alert is raised, carrying the count the last one reached |
| Started a new run outside the limit (the value had been back inside) | Raised less than that ago | One is added to that alert's repeat_count. Nothing is sent, and the log entry is not touched |
| One more reading of a run already confirmed | Raised less than that ago | Nothing is written |
Why the interval works the way it does
- It is measured from the alert, and a repeat does not move it. A tag that keeps coming back cannot keep an old
alert alive for ever:
min_interval_secondsafter an alert, the next confirmed reading outside the limit raises another. A sliding interval would suppress a tag that comes back every few minutes without end. - Recurrences are counted, not readings. A count of readings would say how often the Node polled; a count of recurrences says how often the value went back inside and out again, which is what a person reading the alert wants to know.
- A sustained excursion is one alert per interval. A value that stays outside is still worth a person seeing again after the interval, and not at every poll. The new alert is raised by a reading that arrives and is still outside the limit; it is never raised by a timer, because that would be the Node sending an alert again, which it does not do.
- The table decides, not memory. The Node asks the alerts table whether this cause has an alert and how old it is, so a restart forgets nothing. The only thing kept in memory is a note of when the interval ends, so that a sustained excursion costs no query inside it. The cost of this is that a run which is still going when the Node restarts is confirmed again from nothing, and counts as one recurrence on the latest alert.
- The interval has a floor of a minute. An alert is read by a person, and each one costs a table row, a log entry, a Trigger and a drafted explanation. Without a floor, a value near zero would raise an alert on every reading of a sustained excursion: as often as once a second for each of up to 50 bindings. A binding below 60 seconds is refused when the configuration loads. The default is an hour.
- The count is advisory. A repeat is one atomic update; if the database commits it and the answer is lost, the retry could count it twice. An alert is never raised twice, because the new alert's id is derived and its row is checked for before anything is decided again.
When the database refuses
The log, the Trigger queue and the table are one database, so an outage stops all three together. The Node keeps judging readings, and nothing is dropped while it runs:
- A reading that would have raised an alert, or been counted as a repeat, becomes a request that waits in memory, in order, and is tried again with each later tick.
- A request for a cause that already has one waiting is folded into it: its repeats are added to the waiting request's count and no second request is queued. What waits is therefore bounded by the number of causes and the time elapsed (one request per cause for each interval), not by the number of readings, so no cap is needed and none is applied. If more than 100 are waiting, one warning is logged; none is dropped.
- Two limits keep the database from being overloaded. At most 20 waiting requests are settled in one call, so a database that has just come back is not met with everything that built up while it was away; each request keeps the time of its own reading. After a failure the Node waits one second before trying again, then two, doubling with each failure to at most 30 seconds, and starts again from one at the first success. Nothing is asked of a database that is being given time, so a down database does not stall the reading of tags.
- What is lost is what was only in memory when the Node stopped. A crash or a restart during an outage loses the requests that had not yet been written. Nothing in Kindred can make a record survive in a database that is not there.
If the Node stops in the middle of raising one
Postgres cannot wrap the table, the log and the queue in one transaction, so an alert is raised in four steps, each
of which can be repeated: the row is inserted with finished_at empty; the Activity Log entry is written; the
Trigger is queued; finished_at is set. The entry and the Trigger therefore only ever exist for a row that exists.
When the Node starts, before any tag is read, every row with no finished_at is completed by running the steps
again. The entry is written under the alert's id and a Trigger under the same id is queued, so one that already
exists is not written twice, and a stop at any step leaves one entry, one Trigger and a finished row. The claim's
sentence and place are read again from the claim's own record, so an alert is completed with the wording it was
raised against even if the claim has been superseded since. A row whose claim has no record is left as it is and
logged by its id on each start. Repair runs only when the Node starts: while it runs, a step that fails is tried
again by the same rule as an outage, above. Anything that lists alerts should list only rows with a finished_at,
because an unfinished row may not have its entry in the log yet.
Acknowledging an alert
An alert is recorded, visible and published the moment it is raised. Acknowledging it is a separate, later step that a person takes to say what they made of it. It is after the fact and gates nothing: an unacknowledged alert stops nothing, holds nothing and is not sent again.
Kindred acknowledges only the alerts it raises on its own determination, which are the alerts in this section. It does not acknowledge anything the site's MES or quality system holds (the deviation, the hold or the rework are that system's), and it cannot acknowledge an entry that is not an alert: a binding that stopped, a tag that could not be read, or the drafted explanation of an alert has no acknowledgement, and asking for one is answered "no such alert".
A person acknowledges an alert through the alert routes with a management token that carries
the alerts scope (a signoff token cannot). They choose one of three dispositions:
| Disposition | Means |
|---|---|
confirmed_issue |
Operations were outside the instruction: the alert was right |
dismissed |
The instruction is correct and there is nothing to act on |
instruction_needs_revising |
The instruction is out of date or wrong; it is the document that has to change |
There is no free text, because a person's words would sit in the append-only Activity Log for good. What is recorded is
who (the id of the token, never a name a caller sent), when and which disposition, in
instruction_alert_acknowledgements and in one Activity Log
entry with the task type instruction conformance: alert acknowledged, the trigger management_api, the disposition as
its outcome and the alert's id, the disposition and the token's id as its reference ids. The alert's own entry and its
row are not changed. An alert is acknowledged once, by one person; a second request is refused as already
acknowledged and the first stands.
A repeat of an acknowledged cause is not silenced. The rule in the table above does not look at acknowledgement. A new run outside the limit inside the minimum interval is counted on the acknowledged alert, as before, and the first confirmed reading at or after the interval raises a new alert, which has no acknowledgement, so it counts and waits for a person like any other. Acknowledging says what a person made of one alert; it does not tell Kindred to stop raising the next.
The count. The number of alerts no one has acknowledged, and when the oldest was raised, is answered by the count
route and announced by the Node in its pending counts for a reader that watches several
Nodes. A Node that has instruction_bindings announces a number, which is 0 when nothing waits; a Node that has none
announces null, which a reader shows as unknown and never as "no alerts". The count of Pending sign-off records is not
changed by alerts. An alert that is not yet finished (its entry and Trigger are still being written) is not counted.
Where a person sees an alert
An alert is recorded and published when it is raised. Three more places show it to a person, and none of them can make one or send one again.
The review page. The review page has an Alerts tab and a banner above its tabs. The banner says how many alerts wait for an acknowledgement and when the oldest was raised, and the open page asks for that count (and nothing else) every 30 seconds. A count that could not be refreshed stays on the page, marked as stale. The tab lists the alerts and takes the acknowledgement, and an alert's detail shows where the instruction is (the document, revision and locator from the alert's own entry, never the instruction's wording) beside the drafted explanation, labelled as a draft for review that is not part of the alert.
The shift handoff. Each shift handoff opens with the alerts nobody had acknowledged when its window ended.
- Kindred writes each line from the alerts table: when the alert was raised, the binding, the limit crossed, the measured value and the limit with the unit, the product and operation, how often it repeated and the alert's id. The repeat count is the count when the handoff was drafted, not as of the window's end.
- An alert raised in an earlier shift that nobody answered is listed again, because that is what a handoff is for. One acknowledged before the window ended is not.
- At most 20 are listed, the oldest first. The line above them always gives the whole count, with "and N more not listed" when the list is cut.
- No line, label or measured value is given to the model that drafts the handoff. It is told only the count, and a draft that states a different number of unacknowledged alerts is rejected and drafted again.
- The alert's own entry and the acknowledgement's entry are not counted as activity and are not shown to the model, and neither is the alert's drafted explanation, which holds the same labels and values in words: it is reviewed as its own record and is not counted as a case in the handoff.
- A Node that has no alerts table says nothing about alerts. A Node whose alert tables are not yet upgraded, or whose alerts cannot be read, says so in one line and still drafts its handoff; it never reads as "no alerts".
The drafted explanation. Case Triage turns the alert's deviation Trigger into a summary submitted as a case_summary record for review, linked to the alert by the Trigger's id. It is a separate record: the alert is never held for it and never changed by it.
- Inference disabled: the summary is the structured facts, written by code, and the alert reads the same.
- Inference enabled: every number the draft states must be a number in the alert's payload. A draft that states another is rejected and drafted again, within the inference profile's own attempts.
- A number counts as held when its value equals one in the payload, whether it stands alone or inside the instruction's sentence, a time or a locator. So "187.20" is "187.2", and "10:15" is in the time the alert was raised.
- A number rounded to the precision written ("187" for 187.2) is held.
- A number worked out from two others ("7.2 above the limit") is not held, and neither is a section number that is not in the locator.
- The words "zero" and "one" are not read as numbers.
- Every attempt states a stray number: the draft is not submitted. The structured facts stand in for it. The record carries
drafted_byfallbackanddraft_withheldstated_number_not_in_payload, and so does the Activity Log entry for the Case Triage run. No prompt is recorded for it, and the log line names how many attempts were made and none of the text.
Only an alert is checked this way; other deviations are summarised as before. A model that is unreachable is a failure of the run, as it was, and is never taken for a draft it got wrong.
Limits
| Limit | Value | Why |
|---|---|---|
Shortest min_interval_seconds |
60 seconds | An alert is for a person, and each costs a row, an entry, a Trigger and a drafted explanation |
| Requests settled in one call | 20 | A database that has just come back is not met with everything at once |
| First wait after a failure | 1 second | The next try is soon, because most failures are brief |
| Longest wait after failures | 30 seconds | A longer outage is tried about twice a minute, not every second |
| Sentence in the Trigger | 1000 characters | One sentence of an instruction, not a page |
| Locator, document, revision in the Trigger | 200 characters | A place in a document, not its text |
| Whole Trigger payload | under 4096 bytes | Case Triage reads it into a prompt and a sign-off record |
| Requests waiting before one warning | 100 | None is dropped; the warning says a restart now would lose them |
Where a tag is read from
Beside opcua, a tag is read from the Node's own OPC UA endpoint, the one in its opcua section, over its one
connection. That holds for the binding's node_id and for its condition's node_id. Beside a record source no tag
is read. Beside either, no binding key names an endpoint: a
binding that carries an endpoint key, on the binding or in its condition, is refused by name when the
configuration is loaded, and the message does not repeat the value (an endpoint can carry a user name and a
password). The Node refuses to start, the offline check reports it, and so does check.
A binding names one concrete node id, in one of the four forms of the OPC UA text notation:
| Form | Example |
|---|---|
| numeric | i=2253 or ns=3;i=5000 |
| string | ns=2;s=Oven1.CureTemp (the name has no ;) |
| GUID | ns=1;g=09087e75-8e5e-499b-954f-f2a9603db28a |
| opaque (base64) | ns=1;b=QUJDRA== |
The namespace index is at most 65535 and a numeric identifier at most 4294967295, the most OPC UA allows. An id past them is refused when the configuration loads and not at every read.
A * or a ? anywhere in a node id is refused as a wildcard, and so is anything that is not one node id (a list, or an empty name). A string name that really contains * or ? cannot be used.
When a claim stops being current
A document is revised or withdrawn while the Node runs, and the claim a binding names is then no longer what the site's instruction says. The Node therefore judges the claim of every binding it is still reading again every minute, the same way it did at start, and stops a binding whose claim fails.
What a stopped binding means:
- It is not read again. No tag of it is read, no reading is judged, no alert is raised. A run that was open ends
with the end reason
claim_stopped, and its figures are those of the readings taken before the stop. - One Activity Log entry says so, with the task type
instruction conformance: binding stopped. It names the binding, the claim, the standing (superseded,deactivated,out_of_force,rejected,unconfirmed,not_found,no_limit,unknown, orunit_missingorunit_differswhen the claim is current but the binding's unit is not its unit) and the fixed sentence for it, the same sentences as in Which claims a binding may name. It holds no wording from the claim, no limit, no tag and no label, because the entry is published on the Activity Log topic. A binding that is refused when the Node starts writes the same entry, so a Node that restarts onto a claim that is still not current does not leave a log that reads as if the binding were running. The standinglimits_unusableis written by that start-up case alone: a claim that is current, but whose limits cannot be compared. (checkrefuses the same case with the same sentence, and writes no entry.) - It stays stopped until the Node restarts. If the claim is current again a minute later, for example because a document was reactivated, the binding is still stopped. The Node judges it afresh only when it starts. The reason is that a binding that starts and stops by itself, on the word of three stores read one after the other, would leave a log that is harder to read than a binding that stops once and says why; a person who has fixed the document restarts the Node. A claim that has been replaced by an edit or a new revision has a new id, so the binding names that id in the configuration, which needs the restart anyway.
- It is written once for a stop, not once for each standing it passes through. Once a binding is stopped it is not judged again, so the entry cannot repeat. A second stop after a restart is a second episode and a second entry.
- A claim that cannot be judged stops the binding too (
unknown: the stores do not agree, or the document is gone). A claim that cannot be shown to stand is not one to alert against. - A minute that cannot be checked changes nothing. If the database refuses the question, every binding stays as it was, the Node logs one warning for the episode, with the kind of error and nothing else, and asks again a minute later. A binding is never stopped, and never kept, on a guess.
- A claim that is still current is read again, so the revision label on later run summaries and the wording on later alerts are the claim's now. The limits the Node compares are the ones it took at start; a claim's limits cannot change, because an edited claim is a new claim.
- An alert that was already waiting for the database is still completed. It holds the claim as it stood when the reading was taken, and the reading was outside the limit of a claim that then stood. The alert records what was true then and says so by its time; it is not withdrawn because the claim has ended since.
- A reading taken in the minute after a claim ends can still raise an alert. The Node looks once a minute, so an alert can be raised against a claim that was withdrawn less than a minute earlier.
- An unreadable-tag or unreadable-condition episode that was open when the binding stopped is not closed by an "available again" entry: the binding is no longer read, so nothing could say it was available.
All the bindings' claims are judged in one question to the database a minute, however many bindings there are, and a
disabled or already stopped binding is not asked about. A binding in observe and one in alert mode are treated
alike, because both read tags.
What is checked, and when
| When | What | Needs the database |
|---|---|---|
| The configuration is loaded (the Node starts) and in the offline check | Each binding's shape, its node ids, that the section has the sources it needs | No |
check |
The above, then whether each claim is current, whether the unit is the claim's, and whether the claim's limits can be compared (it tries them as the Node does at start-up) | Yes |
| The Node starts | Whether each enabled binding's claim is current and in the binding's unit, and whether its limits can be compared | Yes |
| Every minute after that | Whether each running binding's claim is still current and in the binding's unit | Yes |
The Node judges each enabled binding's claim when it starts and then every minute, and stops a binding whose claim has failed (When a claim stops being current).
check judges the same claims on demand without touching a running Node, and tries the limits of each claim that passes, as the Node does when it starts. One shared step builds the comparison for both, so the two cannot disagree about a limit. Run check after a document is revised or deactivated, or before a binding is enabled, to see what the Node will do.
Each stage names the binding and the field. None repeats a value, and check never prints any wording from a claim, only its id.
Which claims a binding may name
A binding may name a claim that a person confirmed and that is still current. check refuses the others and says
which:
| Refusal | Why |
|---|---|
no instruction claim has this id |
Nothing has this id, or it is another kind of record. |
the claim is not confirmed (it is still awaiting review) |
A person has not approved it. |
the claim was rejected |
A person rejected it. |
the claim is superseded by a later revision or an edit |
A later revision replaced it, or it was edited. |
the claim states a single value and has no limit to check against |
"Set the oven to 180 °C" has no tolerance, so there is nothing to compare with. |
the claim's document is deactivated |
The document was withdrawn. |
the claim's document is not in force today (outside its dates) |
The document's effective dates have ended or have not begun. |
the claim cannot be judged: its ledger entry, its document or its revision time is missing |
The stores do not agree, so the claim is not passed. |
the claim's limits cannot be compared |
The claim is current and in the binding's unit, but a limit is too large or too small for the number the Node compares with, is not a number, is not stored as text, or the lower limit is above the upper. The line names the binding and the claim's id and never the limit. The Node stops a binding it reads for the same reason at start-up, as limits_unusable; a disabled binding is not read, and check refuses it all the same. |
A claim is superseded in two ways. When a document is replaced by a new revision, the earlier revision's claims are marked superseded in the drafter's ledger and their records stay approved. A revision that is kept beside its successor is never marked: it stops being current when its document is deactivated or its effective dates end. Two kept revisions with no effective dates are therefore both current, and a claim of each can be bound.
Only the document's dates decide whether it is in force. A document can also be limited to a product, a
manufacturing order or a range of unit numbers. A binding cannot honour those, because nothing it reads carries
them, so check does not enforce them.
The declared unit is compared with the claim's unit after the spelling is normalised the way claims do it:
degC, ℃ and ° C are all °C. A different unit is refused; nothing is converted, so a °F tag against a
°C claim needs the claim or the tag changed.
Commands
Give every command the configuration file the Node itself runs. They read the Node's database, change nothing in it except to create a table that is missing, and can run while the Node runs.
python3 -m engine.instruction_binding_tools --config node.json claims
python3 -m engine.instruction_binding_tools --config node.json check
--node-type-dir names the Node Type directory (default node-types/mes) and --shared-config-dir the shared
fragments directory, if the configuration uses one.
claims lists the confirmed claims that are still current: the id, the quoted sentence, the kind, unit and
limits, the locator, the document and the revision. It is how to find a claim_id. It prints the sentence,
because choosing a claim needs it, so its output can hold the plant's own wording.
check judges every binding and prints one line per refusal, then a count. A binding whose claim is not current,
or whose claim's limits cannot be compared, is refused in every mode, disabled included (a binding the Node would
never read is still a binding someone will enable). A configuration with no instruction_bindings section has
nothing to check and exits 0.
preview replays a sample of readings through one binding before it is enabled; it has its own page,
Previewing an instruction binding, with its own exit codes.
The text printed is for a person to read and may change; the exit code is the promise.
| Exit code | Meaning |
|---|---|
| 0 | claims ran, or check refused nothing |
| 1 | check refused at least one binding |
| 2 | The request could not be used: a configuration or path that cannot be read, a configuration the loader refuses, or a Node that reads no documents |
| 3 | The Node's database could not be reached |
Release: v0.11.0