Genie instance
A genie is an equipment drawing from the project library where tag names and labels are replaced by substitutions %Tag%, %Label%. A genie instance on a screen sets the substitution values: Tag = Pump1. Editing the genie changes all its instances at once. Creating genies and faceplates is described in Genies; ready-made genies with tag types are in the object library.
In the operator client a genie instance expands into a group: its Item.Type is Group, and the drawing’s elements are available through Children.
Properties
Section titled “Properties”Besides the properties of every element — name, position, size, tooltip, rotation, transparency and the operate right:
| Property | Values | Default | Description |
|---|---|---|---|
Genie |
genie name | Genie |
From scripts
Section titled “From scripts”Item.Type = Group. 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”An element inside an instance — each instance has its own elements with the tags already substituted.
var pump = Screen.Items("Pump1");pump.Children("Current").FlashBackground = Tags("Pump1.Current").Value > 40;All instances of one kind on the screen — for example, hide the labels of all pumps.
Screen.All().filter(function (e) { return e.Type === "Group" && e.Name.indexOf("Pump") === 0; }) .forEach(function (g) { g.Children("Label").Visible = false; });A genie’s faceplate is opened with a system function.
HMI.SysFct("ShowGeniePopup", "LibMotorFace", "Tag=Pump1");