Defined Words

AADvance projects support the use of identifier names, called defined words. Defined words are replaced by the variables and expressions these represent when building. Defined words have a common scope making these available for use in any program organization unit (POU) of any controller of a project.
For POUs, a defined word replaces literal expressions, boolean expressions, reserved keywords or complex ST expressions.
These are examples of defined words:
lrf_dw
When an equivalence is defined, its identifier is available anywhere in an ST program to replace the attached expression. This ST programming example uses defined words:
If OK Then angle := PI / 2.0; isdone := YES; End_if;
Defined word names are limited to 128 characters beginning with a letter or single underscore followed by letters, digits, and single underscores. The last character for a defined word name must be a letter or digit; defined word names cannot end with an underscore character. Names cannot be reserved words, defined words, data types, structures, or arrays. The same type of elements within a scope must have unique names. The definition of a defined word cannot contain a defined word.
TIP: Defined words must have unique names. Create defined words in a library for use in a project. Build errors occur when a project and library contain the same defined word.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal