Editors b : INT; {flag off} END_VAR The flags „ noread “ and „ nowrite “ are used in a POU that has read and/or write permission to provide selected variables with restricted access rights. The default for the variable is the same as the setting for the POU in which the variable is declared. If a variable has neither read nor write permission, it will not be exported into the symbol file. Examples: If the POU has read and write permission, then with the following pragmas variable a can only be exported with write permission, while variable b can not be exported at all. VAR a : INT {flag noread}; b :
INT {flag noread, nowrite}; END_VAR Neither variable a nor b will be exported to the symbol file: {flag noread, nowrite on} VAR a : INT; b : INT; END_VAR {flag off} The pragma operates additively on all subsequent variable declarations. Example: all POUs in use will be exported with read and write permission a : afb; ... FUNCTION_BLOCK afB VAR b : bfb {flag nowrite}; c : INT; END_VAR ... FUNCTION_BLOCK bfB VAR d : INT {flag noread}; e : INT {flag nowrite}; END_VAR "a.b.d": Will not be exported. "a.b.e": Will be exported only with read permission. "a.c": Will be exported with read and write permission.
Pragmas for Controlling the Display of Library Declaration Parts During creation of a library in TwinCAT PLC you can define via pragmas which parts of the declaration window should be visible resp. not visible in the Library Manager later when the library will be included in a project. The display of the implementation part of the library will not be affected by that. Thus comments or any variables declarations can be concealed from the user. The pragmas {library private} and {library public} each affect the rest of the same line resp. the subsequent lines, as long as they are not overwritten by the each other one. Syntax :
{library public} The subsequent test will be displayed in the Library Manager. {library private} :The subsequent test will be not displayed. Example: See below the declaration part of a library, which is created in TwinCAT PLC. The comment "(* this is for all *)" should be displayed in the Library Manager after having included the library in a project., the comment "(* but this is not for all ")" however should not be displayed. The variables local and in3 also should not be displayed: {library public} (*this is for all*) {library private} (*this is not for all*) {library public} FUNCTION afun : BOOL VAR_INPUT TX1200 124 Version: 1.3