Previous: , Up: Expressions: The Engine of STARTER   [Contents]


2.3.6.6 I/O Flags in Rules

Every Input and Output carries a flags field (see I/O Flags). In rules.conf you can read or write those bits with the FLAG qualifier on the same targets and expressions you already use—no new statement kinds.

Read (any defined flag name) — yields 1 or 0:

SET Manual:OutWest WHEN Manual:OutWest FLAG USR1;
SET 0 WHEN Lamp:switch FLAG MANUAL_OVERRIDE;
SET 0 WHEN Valve:cmd FLAG SOFTWARE_OVERRIDE;

Write — USR1…USR4 and SOFTWARE_OVERRIDE actually change state. Other system flags (MANUAL_OVERRIDE, NO_HISTORY) are accepted by the syntax, but the engine logs a warning and skips the write:

Manual:OutWest FLAG USR1 {
    SET FALSE WHEN TIME:hour == 0;
}

TRIGGER WHEN TIME:hour == 0
  SET Manual:OutWest FLAG USR1 = FALSE;

Valve:cmd FLAG SOFTWARE_OVERRIDE {
    SET TRUE WHEN Supervisor:takeover;
    SET FALSE WHEN Supervisor:release;
}

Writing a writable flag uses the peer SetOutput / SetInput methods (value unchanged, flags updated); InputChanged / OutputChanged already carry the new flags to the Core. Variables do not have flags; they may only reference a live id FLAG name expression.