Pragmas for Controlling the \ Display of Library Declaration Parts¶
During creation of a library in CoDeSys 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} : he subsequent test will be not displayed.
Example: See below the declaration part of a library, which is created in CoDeSys. 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 in2 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
in: BOOL;
END_VAR
{library private}
VAR
local: BOOL;
END_VAR
{library public}
VAR_INPUT
in2: BOOL;
{library private}
in3: BOOL;
{library public}
END_VAR