Skip to main content

Attribute: conditionalshow

The pragma has the effect that the identifiers of an integrated compiled library <library name>.compiled-library, which are decorated with the pragma, are hidden before programming an application. The POUs can be called but the variables are invisible in the CODESYS user interface.

. Affected features
  • Library management

  • Debugging

  • Input Assistant

  • "List components" Feature

  • Monitoring

  • Symbol Configuration

This is useful when you develop libraries. As the library developer, you decorate function blocks or variables with the pragma. As a result, you determine which identifiers are hidden in an application after integration. If you want to show the hidden identifiers later, for example for debugging or further development of the library, you can reactivate its visibility.

Syntax

{attribute 'conditionalshow' := ' <some text> '}

Insert location: Top line in the declaration part of a function block, above a variable

Insert location

First line above the declaration part of functions and programs

<some text>

Optional

String literal to control the visibility of the identifiers decorated with this kind of pragma by means of a command-line command and this literal

When the pragma is specified without a literal, the variables in the CODESYS development environment are always hidden, regardless of how CODESYS was started.

Tip

For more help about this, see the "Library Development Summary" document.

Example 259. Example

For examples, see the "Library Development Summary" document.

Hiding a variable

FUNCTION_BLOCK FB_DataManager
VAR
    {attribute 'conditionalshow' := 'Library_Developer'}
    iLocal : INT;
    iCounter : INT;
END_VAR

The variable iLocal is invisible.

Hiding a function block

{attribute 'conditionalshow' := 'Library_Developer'}
FUNCTION_BLOCK FB_DataManager
VAR
    iLocal : INT;
    iCounter : INT;
END_VAR

The identifiers FB_DataManager, iLocal, and iCounter are invisible.



Visibility in case of existing source code file

When the source code file <library name>.library from an integrated library also exists at the same memory location (repository), the identifiers are visible despite the pragmas. That is regardless of whether or not an attribute value has been specified in the declaration.

Command-line call to activate visibility

You can also enable the visibility of the hidden variable without a source code file by starting CODESYS with the command-line option conditionalshowsymbols. To enable the visibility, specify the attribute values of the pragma which are separated by commas.

Syntax

codesys.exe --conditionalshowsymbols=" <some text> ( ,<next text> )* "

For more information, see: Using the Command-Line Interface

codesys.exe --conditionalshowsymbols="Library_Developer"
codesys.exe --conditionalshowsymbols="Group_A,Group_B"

Impact of the attribute on monitoring and SmartCoding

Table 23. Source library:

Action

Attribute Set

Attribute Not Set

SmartCoding / Input Assistant

Method

Visible

Visible

Input

Visible

Not visible

Output

Visible

Not visible

Monitoring

Input

Visible

Visible

Output

Visible

Visible

Local

Visible

Visible



Table 24. Compiled library

Action

Attribute Set

Attribute Not Set

SmartCoding / Input Assistant

Method

Visible

Visible

Input

Visible

Not visible

Output

Visible

Not visible

Monitoring

Input

Visible

Not visible

Output

Visible

Not visible

Local

Visible

Not visible