General syntax rules
Syntax rules for the
View Designer
.hmi files align with the IEC 61131-3 standard. Follow these basic syntax rules:
- Syntax is case insensitive. For example, the identifiers abcd, ABCD, and aBCd are treated as identical.
- Element names, or identifiers, can contain up to 40 characters.
- All elements appear in the same general format:
[keyword identifying element] <modifiers for element> [element name];
When an element contains content or sets properties, the code format is extended:
[keyword identifying element] <modifiers for element> [element name] {<element content>< properties := property value >}
- Every statement ends in a semicolon. For example:
Opacity := 90;
- Not every property, setting, or value must be specified. If a setting is not specified, then its default value is used.
- Multiple statements can exist on the same line when they are separated by a semicolon. For example:
- Bound properties appear in the general format:
Opacity := 90; ^Visible := true;property := "<Initial_Value>" -> "<Bound_Value>"
For example:
Text := "Text Display" -> "::Local:HMIDevice.AutoLogoff.RemainingTime";
Keywords
Keywords are specific identifiers used as individual syntactic elements. Keep these guidelines in mind when using keywords:
- Keywords cannot contain embedded spaces.
- The case of characters is not significant in keywords. For example, the keywordsFORandforare syntactically the same.
- Keywords cannot be used for any other purpose; for example, as variable or element names.
- Certain keywords can be used as variable or element name only if preceded with a caret (^). For example, you could use the keyword^Screenas an element name.
The following keywords can be used by preceding the keyword with a caret:
- action
- addongraphic
- alarm
- and
- aoi
- artifact
- banner
- behavior
- commanddefinition
- const
- continuous
- controller
- converge
- datalog
- datalogentry
- dev
- directedlink
- diverge
- enum
- event
- extends
- extern
- false
- fbd
- function
- graphicelement
- gsv
- gsv_only
- gsvssv_able
- gsvssv_only
- hi
- hidden
- hide
- hihi
- inout
- input
- instruction
- ld
- lo
- lolo
- mathfunction
- motion
- namespace
- nullable
- output
- parameterconnection
- periodic
- phase
- popup
- program
- property
- required
- rll
- roc_neg
- roc_pos
- routine
- safety
- screen
- selectbranch
- sfc
- shortcut
- show
- simulbranch
- ssv
- ssv_only
- st
- statedefinition
- statetabledefinition
- step
- stopstep
- struct
- stx
- tag
- task
- textbox
- thiscontrollerapp
- thisprogram
- thisroutine
- thistask
- transition
- triggerbasedefinition
- trip
- true
- type
- union
- unsupported
- userproperties
- using
- view
- viewfolder
- viewproject
- visible
- wire
Other keywords cannot be used as a variable or element name even if preceded with a caret. These reserved keywords are:
- by
- case
- else
- elsif
- end_case
- end_for
- end_if
- end_repeat
- end_while
- exit
- for
- if
- mod
- nod
- of
- or
- repeat
- then
- to
- until
- while
- xor
Provide Feedback