Editors 'Insert' 'New Declaration ' With this command you bring a new variable into the declaration table of the declaration editor. If the present cursor position is located in an field of the table, then the new variable will be pasted in the preceding line; otherwise, the new variable is pasted at the end of the table. Moreover, you can paste a new declaration at the end of the table by using the right arrow key or the tab key in the last field of the table. You will receive a variable that has " Name " located in the Name field, and " Bool " located in the Type field, as its default setting. You should change these values to the desired values.
Name and type are all that is necessary for a complete declaration of variables. Pragma command The pragma instruction is used to affect the properties of a variable concerning the compilation process. It can be used in with supplementary text in a program line of the declaration editor or in its own line. The pragma instruction is enclosed in curly brackets, upper- and lower-case are ignored: { } If the compiler cannot meaningfully interpret the instruction text, the entire pragma is handled as a comment and read over. A warning is issued, however:
„Ignore compiler directive ‚ ’!“ Depending on the type and contents of pragma, the pragma either operates on the line in which it is located or on all subsequent lines until it is ended by an appropriate pragma, or the same pragma is executed with different parameters, or the end of the file is reached. By file we mean here: declaration part, implementation portion, global variable list, type declaration. The opening bracket may immediately follow a variable name. Opening and closing brackets must be located on the same line. The following pragma may currently be used: {flag}: {flag [ ] [off|on]} This pragma allows the properties of a variable declaration to be affected.
can be a combination of the following flags: With the „ on “ modifier, the pragma operates on all subsequent variable declarations until it is ended by the pragma {flag off}, or until overwritten by another {flag on} pragma. Without the „on“ or „off“ modifier, the pragma operates only on the current variable declaration (that is the declaration that is closed by the next semicolon). Examples: The variable a will not be initialized and will not be monitored. The variable b will not be initialized: VAR a : INT {flag noinit, nowatch}; b : INT {flag noinit}; END_VAR VAR {flag noint, nowatch on} a : INT {flag noinit on}; b : INT; {flag off} END_VAR Neither variable will be initialized:
{flag noinit on} VAR a : INT; b : INT; END_VAR {flag off} VAR {flag noinit on} a : INT; TX1200 123 Version: 1.3 noinit The variable will not be initialized. nowatch The variable can not be monitored. noread The variable is exported to the symbol file without read permission. nowrite The variable is exported to the symbol file without write permission. noread, nowrite The variable is not exported to the symbol file.