Syntax rules

Syntax rules for the
FactoryTalk Design Studio
programming language 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:
tag dint myTag ;
  • Not every property, setting, or value must be specified in the programming language. If a setting is not specified, then its default value is used.
    • If you don’t specify a desc value, its default is an empty string.
    • If you don’t specify a value of a tag, the default value is zero. For example:
tag dint myTag;
In the
myTag
example, the value, description, and other parameters are not specified, so their default values are zero (or an empty string for string datatypes).
  • Multiple statements can exist on the same line when they are separated by a semicolon. For example:
tag dint myTag ; tag dint myOtherTag
  • In ladder routines, a semicolon denotes the end of a line or rung.
  • You can insert white space characters in the code to make it more readable. White space characters include non-printing characters such as spaces, tabs, and returns. You cannot insert white space characters inside keywords, literals, enumerated values, and identifiers.
  • Use double quotes for descriptions (desc). Use single quotes for tag string values.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.