Skip to content

Animation

An animation is an SVG file plus the behaviour bound to the objects inside it. This page covers building a screen from scratch.

The Animation screen — the design canvas and its toolbar

The new animation form

FieldRequiredDescription
NameYesScreen name — unique within the project
DescriptionNoDescription
Join AnimationNoAnother animation this screen joins
BackgroundNoBackground colour; Follow shell theme hands it to the interface theme
DurationYesUpdate period (ms)
Play OrderYesOrdering, when there is more than one screen
Play at Main?NoWhether it opens as the main screen
Page IconNoIcon shown beside the name in the runtime page list
AlignmentYesHow the screen is aligned within the window
Start fromYesA blank canvas, a template, or an uploaded SVG
Resolution—Canvas size; a typical SCADA screen is 1920×1080

Start from offers three routes, and decides how you build the screen:

OptionWhat it does
Blank canvasStarts empty; you draw in the platform’s own designer
TemplateStarts from a ready-made template
Upload SVGBrings in an SVG prepared elsewhere

The built-in designer has select and pan tools, snapping and keyboard shortcuts — simple screens need no external editor at all.

For complex schematics, scaled layouts, or a corporate drawing library, preparing the SVG in an external editor such as Inkscape and bringing it in with Upload SVG is the practical route. You do not have to manage SVG id values when you do: the platform walks the tree and makes every object selectable, though meaningful ids still make your life easier later.

You click an object on the screen and open the Element Editor, where you choose what that object should do. Each binding is an animation element.

FieldDescription
DOM IDThe selected SVG object’s id — filled in automatically
TypeWhat the object does (table below)
Expression TypeHow the value is arrived at
ExpressionThe value itself — a variable name, a formula, or a configuration
PropsExtra settings specific to the type
StatusActive / inactive

Detail on the editor: Element Editor →

The type decides what the object does.

TypeWhat it doesDetail
GetWrites the value as text→
GetSymbolShows a symbol according to the value—
ColorChanges the object’s colour→
BarFills a bar according to the value→
ScaleScales the object→
OpacityChanges opacity→
BlinkBlinks on a condition→
RotateRotates the object→
MoveTranslates the object→
PipeFlow animation along a pipe or line→
TooltipInformation balloon on hover→
ImageSwaps the image according to the value→
AlarmIndicationShows alarm state→
AnimateAnimation driven from a script→
ChartChart component→
DatatableTable component→
SliderWrites a value with a slider→
ClickClick event→
MouseDown / MouseUp / MouseOverMouse events→
IframeEmbeds an external page→
FaceplateOpens a faceplate→
QRCodeGenerationGenerates a QR code—

The type list is filtered by the kind of SVG object you selected, because not every type means anything on every object. You cannot write text into a circle, and a group cannot be filled like a bar.

Available on any object:

Color · Rotate · Move · Opacity · Scale · Blink · Bar · Pipe · Tooltip · AlarmIndication · Click · MouseUp · MouseDown · MouseOver

Added according to the object:

SVG objectAlso offered
text, tspanGet
rectChart, Datatable, Iframe, Image, Slider, GetSymbol, Faceplate, QRCodeGeneration
g (group)Animate, Iframe, Faceplate — while Bar drops off the list
imageIframe

When the type you want is not in the list, this is usually why: the wrong object is selected. Binding a chart needs a rect; displaying a value needs a text.

The expression type decides where the value comes from. It is independent of the animation type: the same Color binding can take its value straight from a tag or from a formula.

TypeWhere the value comes from
TAGA variable, directly
EXPRESSIONAn expression you write
NUMERICA fixed number
TEXTFixed text
SWITCHA lookup table keyed on the value
SETWriting to a variable (with interaction types)
TETRAA four-state colour mapping
ANIMATIONAnother animation
FACEPLATEA faceplate
SUBVIEWA sub-view
CUSTOM HTMLA Custom HTML page
ALARMAlarm state
ROLEThe user’s role — display driven by role
HARD LOCKHardware lock state

Two scripts can be attached to a screen, and both run on every evaluation round — not once as the screen opens and closes:

Each round:
1. Pre code
2. Element expressions (every binding)
3. Post code
↓ wait for Duration
↑ round again

So Pre is for preparing something the elements will read, and Post for tidying up once they have been computed.

Bindings that are already there, in Pre/Post code and in element expressions:

VariableTypeDescription
__firstScanBooleantrue on the first round, false afterwards
__animNameStringThe running animation’s name. When a join template is being evaluated, the joined animation’s name
__parametersObjectThe screen’s placeholder parameters — delivered already parsed from JSON
langStringThe active language

__parameters is an object; you read its fields directly (__parameters.motorId). Do not call JSON.parse on it — that throws.

__firstScan is how you separate work that should happen once, such as fetching history. Without it that query repeats every round, which on a one-second screen means once a second:

// Pre: fetch history on the first round only
if (__firstScan) {
var endMs = ins.now().getTime();
var logs = ins.getLoggedVariableValuesByPage(
['ActivePower_kW'],
ins.getDate(endMs - 3600000), ins.getDate(endMs), 0, 30
);
}

The same screen at run time, with all four bindings driven by live values

The screen above is an example built with the steps on this page: two Get bindings write the values as text, a Color binding drives the motor lamp, and a Bar binding fills the tank level.

While a screen is open the browser sends the server an evaluation request at the interval given in Duration; the server runs every element’s expression on the screen in one pass and returns the results, and the bindings update by themselves. Nothing has to be refreshed.

If a round does not come back in the time allowed — ten times Duration — the browser starts the round again, so a momentary break does not leave the screen frozen.

One design can serve several pieces of equipment. A “motor detail” screen is prepared once and opened for each motor with a different set of variables.

What makes that work is the animation’s placeholder definitions: instead of hard-coding variable names, the screen takes them as parameters, which a script reads through __parameters. At the level of a screen fragment, Faceplate does the same job.

The animation itself carries no list of roles. Access is governed in two separate places:

LevelHow
Access to the screenThe screen is opened from a custom menu; which roles see that menu is set by the role-menu grants
Access to an object on the screenEach binding can be bound to an access group. The element is not shown to a user outside that group

The element-level binding is made in the ACCESS section of the Element Editor form. By default a binding belongs to no group and is visible to everyone.

The designer’s preview carries a View as selector: it shows the screen as a role or an access group would see it, rather than as you see it (“Me”). It is the practical way to see which objects are hidden without saving.