Beckhoff Automation GmbH & Co. KG TX1200 — 5.1 Declaration Editor

Editors Example: VAR CONSTANT con1:INT:=12; (* 1. Constant*) END_VAR You will find a listing of possible constants here in the appendix. See there also regarding the possibility of using typed constants (Typed Literals). External Variables Global variables which are to be imported into the POU are designated with the keyword EXTERNAL . They also appear in the Watch window of the declaration part in Online mode. If the VAR_EXTERNAL declaration does not match the global declaration in every respect, the following error message appears: "Declaration of ' ' does not match global declaration!" If the global variable does not exist, the following error message appears: "Unkown global variable:

' '!" Example: VAR EXTERNAL var_ext1:INT:=12; (* 1st external variable *) END_VAR Keywords Keywords are to be written in uppercase letters in all editors. Keywords may not be used as variables. Variables declaration A variables declaration has the following syntax: {AT }: {:= }; The parts in the braces {} are optional. Regarding the identifier, that is the name of a variable, it should be noted that it may not contain spaces or umlaut characters, it may not be declared in duplicate and may not be identical to any keyword. Upper/ lowercase writing of variables is ignored, in other words VAR1, Var1 and var1 are not different variables. Underlines in identifiers are meaningful, e.g.

A_BCD and AB_CD are interpreted as different identifiers. Multiple consecutive underlines at the beginning of an identifier or within a identifier are not allowed. The length of the identifier, as well as the meaningful part of it, are unlimited. All declarations of variables and data type elements can include initialization. They are brought about by the ":=" operator. For variables of elementary types, these initializations are constants. The default-initialization is 0 for all declarations. Example: var1:INT:=12; (* Integer variable with initial value of 12*) If you wish to link a variable directly to a definite address, then you must declare the variable with the keyword AT .

For faster input of the declarations, use the shortcut mode . In function blocks you can also specify variables with incomplete address statements. In order for such a variable to be used in a local instance, there must be an entry for it in the variable configuration . Pay attention to the possibility of an automatic declaration! AT Declaration If you wish to link a variable directly to a definite address, then you must declare the variable with the keyword AT. The advantage of such a procedure is that you can assign a meaningful name to an address, and that any necessary changes of an incoming or outgoing signal will only have to be made in one place (e.g., in the declaration).

Notice that variables requiring an input cannot be accessed by writing. A further restriction is that AT declarations can only be made for local and global variables, and not for input- and output variables from POUs. (Program Organization Units). Examples: TX1200 119 Version: 1.3