Valve (simple)
The simple valve is a flat gate valve icon colored by the state tag (open by a condition, TRUE or greater than zero by default) and the fault tag. A vertical valve is made with the “Rotation” property set to 90°.
For new screens the equipment symbol or the valve from the object library, with a faceplate and a discrepancy alarm, is handier.
Properties
Section titled “Properties”Besides the properties of every element — name, position, size, tooltip, rotation, transparency and the operate right:
| Property | Values | Default | Description |
|---|---|---|---|
StateTag |
tag name | State tag. Running / open — by the condition below (empty — TRUE or greater than zero) | |
RunCondition |
text | «Running» condition. Empty — TRUE or greater than zero. «= 3», «<> 0», «> 5» — comparison; «2..5» — range; «1;3;5» — one of the values; «bit 3» — word bit; «js: value == 3 || value == 5» — JavaScript expression | |
FaultTag |
tag name | Fault tag. Bool: fault (optional) | |
Label |
text | Label | |
Orientation |
Vertical, Horizontal |
Horizontal |
Direction |
From scripts
Section titled “From scripts”Item.Type = Valve. Any property is read and changed by name: Item.Width = 200. The common element members (Visible, Enabled, Value, Raise, Apply…) are described in Elements from scripts.
Events
Section titled “Events”Mouse, hover, focus and keyboard — as for any element (see Events and functions).
Examples
Section titled “Examples”Open by the position switch rather than the command: another state tag.
Screen.Items("Valve3").StateTag = "Valve3.OpenedLS";Highlighting closed valves on a line — the “Check line” button script.
Screen.All().filter(function (e) { return e.Type === "Valve"; }).forEach(function (v) { v.Transparency = Tags(v.StateTag).Value ? 50 : 0;});