Object ‘Symbol configuration’

You can use the symbol configuration for creating symbol descriptions for project variables. Click Project ‣ Add Object to add a symbol configuration object to the device tree. Then define specific presets. See dialog box below: Add symbol configuration.

Double-click the Symbol Configuration object to open the symbol configuration editor.

Dialog box ‘Add symbol configuration’

Function: This dialog box is used for defining presets for a Symbol configuration object.

Call: Menu bar Project ‣ Add object ‣ Symbol configuration; context menu of the application object.

Include comments in XML CODESYS exports the symbol file with the comments assigned to the variables.
Support OPC UA features

73dec581a9f3c946c0a8640e0013fe0f_9a3f06830c0506c5c0a8640e012f0ace : When downloading the symbol configuration, additional information is also downloaded to the controller. The information below is necessary for operating the OPC UA server.

  • Base types of inherited function blocks
  • Contents of attributes that were assigned via compiler pragmas
  • Variable type (INPUT / OUTPUT / IN_OUT)
Client side data layout
Compatibility layout Calculates the output layout in the usual way (compatible with earlier versions). Generates gaps with filler bytes for unpublished members (example: by deactivation in the configuration, or internal members such as VTable pointers for interfaces). Using the pack_mode or relative_offset attributes could lead to accidental incorrect alignment of the members.
Optimized layout Calculates the output layout in optimized form, detached from the internal compiler layout. Does not generate any gaps for unpublished members and strictly fulfills the requirements for data type alignment. Requires compiler version 3.5.7.0 or later.

Symbol configuration editor

This editor includes a table with the selected variables, a menu bar for editing, a field with supporting information, and buttons for required actions.

Menu bar
View

You can use this button for activating and deactivating the following categories of variables used in the configuration editor:

  • Unconfigured from project: Variables that have not been added to the symbol configuration, but are provided in the project.
  • Unconfigured from libraries: Variables that have not been added to the symbol configuration, but are provided in the project.
  • Symbols exported via attribute: This filter causes CODESYS to also list the variables that have already been marked for export in the symbol file by means of the {attribute 'symbol' := 'read'} pragma. These symbols are marked in gray. The Attribute column shows which access rights are set by the pragma.
Create Project build: Requirement for current preparation of variables in the configuration editor.
Settings
  • <!> Include comments in XML: CODESYS exports the symbol file with the comments assigned to the variables.

  • Support OPC UA features: 73dec581a9f3c946c0a8640e0013fe0f_9a3f06830c0506c5c0a8640e012f0ace : When downloading the symbol configuration, additional information is also downloaded to the controller. The information below is necessary for operating the OPC UA server. This currently includes the following information:

    • Base types of inherited function blocks
    • Contents of attributes that were assigned via compiler pragmas
    • Variable type (VAR_INPUT / VAR_OUTPUT / VAR_IN_OUT)
  • Layout selection:

    • Compatibility layout: Calculates the output layout in the usual way (compatible with earlier versions). Generates gaps with filler bytes for unpublished members (example: by deactivation in the configuration, or internal members such as VTable pointers for interfaces). Using the pack_mode or relative_offset attributes could lead to accidental incorrect alignment of the members.

    • Configure synchronisation with IEC tasks: Opens the dialog box Properties - Device, Tab Options

      This setting allows the symbolic client (for example visualizations or database connections on the basis of the PLCHandler) the consistent reading and writing access, synchronized with the IEC tasks. For detailed description of this setting see below in “Setting: Configure synchronisation with IEC tasks”.

      Notice: The variables access, that is synchronous to the IEC tasks, may increase the jitter for all IEC applications on this device! The synchronous consistent access can disturb the real-time capability.

    • Optimized layout: Calculates the output layout in optimized form, detached from the internal compiler layout. Does not generate any gaps for unpublished members and strictly fulfills the requirements for data type alignment. Requires compiler version 3.5.7.0 or later.

  • Enable direct I/O access: This feature is potentially dangerous and not intended for operation in production. Activate only for error checking and tests, or when commissioning the machinery (for example, for checking cables connections).

    73dec581a9f3c946c0a8640e0013fe0f_9a3f06830c0506c5c0a8640e012f0ace : In the symbol configuration, you can also use access to direct I/O addresses that correspond to IEC syntax (for example, “%IX0.0”). Access to input addresses (I) is read-only*. Access to output addresses (Q) and memory addresses (M) can be read-write.

    *Information: In simulation mode, write access to symbols is also possible for input addresses.

    Because external clients for protocols such as OPC or OPC UA do not always support IEC syntax for direct addresses, access is also provided using an array syntax in the namespace __MIO of the implicit code. For example, you can also access __MIO.MIO_IX[2].x3 instead of %IX2.3.

    However, the symbols for array access are hidden in browsers because some clients cannot handle the large number of nodes (several thousand depending on the size of the I/O ranges).

Download If you use a device that supports its own application file for the symbol configuration, then this button is also available in the toolbar. If you change the symbol configuration in online mode, then you can load the new <application name>._symbols file immediately to the PLC.
Tools Save XML scheme file: This command opens the standard dialog box for saving a file in the file system. With this command, you can prepare the XSD format of the symbol file, for example for use in external programs.
Symbol table
Access rights

You can change the access rights for a symbol by clicking the symbol in the Access Rights column.

Symbols for access rights

  • 73dec581a9f3c946c0a8640e0013fe0f_2d4bfe7c1e8f9404c0a8640e01947982 : read only
  • 73dec581a9f3c946c0a8640e0013fe0f_ff7255fb1e8f9455c0a8640e01947982 : write only
  • 73dec581a9f3c946c0a8640e0013fe0f_b21d37321e8f942dc0a8640e01947982 : read and write
Maximal Maximum access rights
Type Alias data types are also displayed In CODESYS Development System V3.5 SP6 and later. Example: MY_INT : INT for a variable declared with the data type MY_INT (type INT).
Members You can add variables of a structured data type also by selecting a check box for symbol configuration in the Symbols column. This causes CODESYS to export all member variable symbols. However, in the Members column, you can click the ellipsis button ( 73dec581a9f3c946c0a8640e0013fe0f_67885e721e8d7dacc0a8640e01947982 ) to select only specific structural components. Please note: This selection applies to all instances of this data type for which symbols are exported. If a member of a structured type cannot be selected, then an asterisk ( 73dec581a9f3c946c0a8640e0013fe0f_edeecc1258f63b73c0a8640e012674ca ) is displayed in the check boxes of the members to indicate that all exportable members of that type are exported.

Setting: Configure synchronisation with IEC tasks

For synchronous consistent access, the symbolic client waits in the runtime system when processing a read or write request until a time is found when no IEC task is executed. As soon as this gap is found, the restart for the IEC tasks is prevented until all values are copied to the variables list. Then all IEC tasks are scheduled as usual. Thus this synchronized consistent access may lead to the delayed starting of the IEC tasks what is reflected in a higher jitter. As all applications are administrated by a common scheduler in the runtime system, this potential deterioration of the real-time behavior affects all applications on the device. So all applications of the device are affected, independently of whether they contain a symbol configuration or whether they are loaded to the controller from one or from several CODESYS projects . Therefore the runtime system only allows the synchronized consistent access if all applications, that are loaded on the controller at the time of access, allow this access.

Note

You can find this setting in the editor of the symbol configuration as well as in the Properties dialog of the controller (Tab Options) (If the application has no symbol configuration, then the setting is only in the properties dialog.)

Attention

After changing the setting, all applications on the device must be re-loaded by download/online Change and all boot applications must be updated.

In which cases is required a synchronized consistent access?

Generally with visualized values there is no use of consistent values, because for changing values the IEC task cycle they come from is not relevant. If the values change rarely, then it is not relevant anyway. Even when writing there are almost no hard consistency demands because typically the machine must be in a kind of standby mode (for example when writing recipes) in which there is no direct access to the values written as recipes.

However consistent values are needed for database connections for saving production data. For clocked machines, however, these values must be synchronous with the production timing (one value set per produced product) and not consistent with reference to one or more IEC tasks. With reference to the machine clocking, the consistency must be already ensured by the IEC application. The consistence in relation to the machine clock must be already guaranteed by the IEC application. For this, the values during the production timing are collected in a global variables list. At the end of the clock a further variable (BOOL or counter) reports to the symbolic client, that the machine clocking is finished and the values are valid. Now the client has the chance to archive the values of the production timing. Depending on the need the successful reading can be displayed in opposite direction via a released variable, so that the production can, if necessary be stopped, if the production data could not be archived. The synchronized consistent access is not necessary and not useful for this use case, because the synchronizing must be on the application layer.

In contrast, synchronized consistent access by symbolic clients is typically applied in the process industry with continuously running plants without production clocking. For example if process values should be written cyclically in a fixed time grid (for example 60 s). This can be done either by synchronizing on the application layer analogous to clocked machines (see above) or by the synchronized consistent symbolic access. The latter has the advantage, that no logic must be implemented in the IEC program and the access is exclusively controlled by the client.

Caution

On the basis of the increased jitter the synchronized consistent monitoring is unsuitable for motion and real time-critical applications. For these reasons the synchronized consistent access should only by activated and be used, if it is absolutely necessary.

If a client uses the synchronous consistent access, that is released by this setting, there are also effects on the client. Even here, depending on the scheduler of the runtime system, the response time can jitter more for read/write access because the system might still have to wait for an execution gap of the IEC tasks. Furthermore the read/write access might fail, if the IEC tasks run very long (in a range of several 100 ms) or the CPU load is nearly 100% by one ore more IEC tasks over a long period of time (in a range of several 100 ms). The availability of the values thus also depends on the utilization of the controller by the IEC application.

Furthermore the client can minimize the effects on himself and on the runtime system, if he notices the folllowing points when defining the variable lists to be read and to be written:

  • Synchronous and consistent access only to variables, that are absolutely necessary
  • Separated lists for variables, that must be consistent and for variables that may be inconsistent
  • Variable lists containing a lot of consistent variables should be split into smaller lists
  • Reading intervals for cyclically reading of values should be as big as possible

Support for the current configuration and appropriate corrective actions

Entries marked in red in the symbol table show variables that they are configured for export to the symbol file but are currently invalid in the application. The cause for this can be that the declaration has been removed from the block.

In version 3.5.8.0 and later, a warning appears in the editor if variables that have configured symbols are not used in the IEC code or are not mapped in the case of I/O variables. In addition, the compiler indicates variables that are referenced from outdated library versions n the symbol configuration.

Attention

Object variables that are not used in the program code remain uncompiled by default and are therefore not available in the symbol configuration.

However, CODESYS provides variables from uncompiled objects in the symbol configuration when one of the following conditions is met:

  • The Link Always block property is selected.
  • The {attribute 'linkalways'} pragma attribute is used.

See also