1.7.2.7. Extended settings¶
In the section <ExtendedSettings> you can specify you PLC in detail. All supported features, the memory-layout, the list of implemented external libraries, etc. are specified in this section!
<ExtendedSettings>
<ts:TargetSettings>
<ts:section name="runtime_identification">
<ts:section name="onlinemanager">
<ts:section name="runtime_features">
<ts:section name="deviceconfiguration">
<ts:section name="taskconfiguration">
<ts:section name="library-management">
<ts:section name="recipemanagement"/>
<ts:section name="symbolconfiguration">
<ts:section name="memory-layout">
<ts:section name="codegenerator">
<ts:section name="visualization">
<ts:section name="alarmmanager">
<ts:section name="trace">
<ts:section name="trendrecording">
<ts:section name="networkvariables">
<ts:section name="dataserver">
</ts:TargetSettings>
</ExtendedSettings>
In the following chapters we describe only the most important device description settings.
Note
For more information look into target-settings reference guide (see target_settings_doc)
Here is the reference to all sections:
Target settings¶
These entries are specified in the <ts:TargetSettings> section. This is a sub-section of <ExtendedSettings>.
Runtime identification¶
The runtime identification version contains the vendor independet official version of the CODESYS runtime system.
<ts:section name="runtime_identification">
XML Tag |
Description |
|---|---|
Runtime identification version |
Official CODESYS runtime identification version |
Online Manager¶
Example:
<ts:section name="onlinemanager">
<ts:setting name="communication-buffer-size" type="integer"access="edit">
XML Tag |
Description |
|---|---|
onlinemanager_communication-buffer-size |
The setting defines the size for the layer 7 communication buffer. This is important for the handling of boot projects on small devices. For device description versions < V3.5.0.0: If the setting is not available, CODESYS will create only one layer 7 service in the offline bootproject. So large boot projects possibly cannot be loaded to the target. For device description versions >= V3.5.0.0: Default is 65536 (0x10000) which should work for most runtimes. If the setting is missing, an error will be reported when trying to create an offline boot application. |
Runtime features¶
Sub-section of <ts:TargetSettings…> describes specific properties of the runtime system.
<ts:section name="runtime_features">
XML Tag |
Description |
|---|---|
runtime_features_cycle_control_in_iec |
1=Task FB is always called, irrespective of the application status. The task FB uses this switch to check the status of the task and no longer calls the task POUs in stop state, for example 0=CmpApp in the runtime system must evaluate the status of an application and call the task FB accordingly |
runtime_features_cycle_control_version_2 |
1= 1, __sys__rts__cycle__2() is called in the runtime instead of __sys__rts__cycle(). The runtime calls the taskcycle code independently of whether the task is stopped or not and the generated code controls which parts have to be executed (eg. Update I/O’s but don’t execute the Task POU’s) This increases performance, because no strings but only a handle to the corresponding task is transmitted to this function. |
runtime_features_dynamic_memory_supported |
1=The “Dynamic memory settings” tab in the Application properties is available 0=The “Dynamic memory settings” tab is hidden |
runtime_features_support_user_check_functions |
1=The menu command for adding “POUs for implicit checks” to an application is available in the programming system 0=The user cannot add own check functions, because these are provided by a hidden library |
runtime_features_optimized_online_change |
1=online change (o.c.) with limited jitter by an optimized o.c. procedure in the runtime system (as from V3.4.3.0); o.c. code is divided to three POUs containing the following: | - initialization code without any side effects on the iec task (can be done in communication task) | - copy code for already initialized data (can be repeated) | - online change code for the rest (must run without interrupt) | Some examples for online change events, which will now produce no jitter: | - change of an existing array size (even really big ones) | - add new data of any size | - call new functions (a complete new call tree will have no effect on the running iec-tasks) | Note however: If a function block interface is changed, the jitter will depend on the initialization code of this function block, and of its derived function blocks. 0=online change with jitter as done up to V3.4.3.0; this setting might be used, if jitter does not matter and you prefer to use the established “old” online change procedure, e.g. in order to avoid problems due to required function block initializations |
runtime_features_operational_mode_supported |
0= not supported. 1= operational mode supported. In operational mode, interaction with the device is limited to writing values. To put a device in this mode, there must not be breakpoints and no forced values. In addition, the application must be in RUN and a matching boot project needs to be on the device. |
runtime_features_locked_mode_supported |
0 = not supported. 1 = locked mode supported. In locked mode, interaction with the device is limited to writing values. No forcing, no breakpoints, no code changes etc is allowed. |
runtime_features_interactive_login_mode |
This determines the default setting for the interactive login mode. 0 = not activated 1 = Enter ID string 2 = Press key 4 = Blink LED Please note that for activating the various interactive login modes, the device description also needs to contain a related string for each mode like this: <Strings namespace="security">
<Language lang="en">
<String identifier="interactivelogin_id_string">Please enter the serial number of the device in the text field below.</String>
<String identifier="interactivelogin_key_press">Please go to the device and press the confirmation button there.</String>
<String identifier="interactivelogin_blink"> Please identify the correct device by checking that its LED is blinking. Then press 'OK' to continue or "Cancel" to abort the login. </String>
</Language>
</Strings>
|
runtime_features_interactive_login_timeout_seconds |
If the mode “Press key” is used, this setting determines the timeout for the user to physically press a key on the device. Set this to a reasonable value (e.g. 300 seconds) as the user might have to go to a different room and locate the device there. |
runtime_features_interactive_login_wink |
Determines if a device supports blinking an LED to identify it visually. 0 = not supported by device. 1 = supported by device. |
runtime_features_encrypted_download_supported |
0 = Encrypted download not supported 1 = Encrypted download supported |
runtime_features_boot_project |
subsection of section “runtime_features” for boot application settings; defines whether the “Properties/Boot applications settings” for an application object are available at all in the programming system and which are the default settings |
runtime_features_boot_project_boot_project_on_download_tag |
1=The “Boot application settings” are available in the application properties dialog 0=The settings are switched off and not available in the dialog |
runtime_features_boot_project_support_boot_project_on_online_change |
0= setting “Implicit boot application on online change” is switched off and not available in the dialog (1=available is default) |
runtime_features_boot_project_boot_project_on_download_default |
1=setting “Implicit boot application on download” is activated per default; i.e. at each download automatically a boot application is created on the target 0=setting is deactivated |
runtime_features_boot_project_boot_project_on_online_change_default |
1= setting “Implicit boot application on online change” is activated per default; i.e. at each online change automatically a boot application is created on the target 0=setting is deactivated |
runtime_features_boot_project_remind_boot_project_default |
1= setting “Remind boot application on project close” is activated per default 0=setting is deactivated |
The following settings (type=”boolean”) serve to control the visibility of commands of the categories “OnlineCommands” and “Breakpoints”. TRUE -> command is available
XML Tag |
Description |
|---|---|
runtime_features_only_explicit_features_supported |
This setting acts as an overall switch. If “TRUE”, only the commands explicitly enabled by the following settings will be available. If “FALSE”, all features will be supported by default and only the explicitly disabled ones will not be available. and only the explicitly disabled ones will not be available. |
runtime_features_source_download_allowed |
Source download Source download to connected device |
runtime_features_online_change_supported |
Online Change for active application |
runtime_features_boot_application_supported |
Create boot application |
runtime_features_force_variables_supported |
Force values Unforce values Release ForceList Add All Forces to WatchList |
runtime_features_write_variables_supported |
Write values |
runtime_features_connect_device_supported |
Connect to Disconnect from Reset origin device |
runtime_features_file_transfer_supported |
File download File upload |
runtime_features_core_application_handling_supported |
This setting will be needed for “tiny” devices that do not have a runtime system: Download active application Login active application Logout active application Reset active application Reset warm active application Reset cold active application Reset origin active application Start active application Stop active application Simulation active application Single Cycle active application |
runtime_features_breakpoints_supported |
New Breakpoint Run to Cursor Set next statement Show current statement Step Into Step Out Step Over Toggle Breakpoint Flow Control (Note that this feature can be disabled by the following C compiler switch in the runtime in the CmpAppBP component: “APPBP_DISABLE_FLOWCONTROL”) |
runtime_features_conditional_breakpoints_supported |
Used in the Breakpoints.BreakpointDialog to hide/show the tab “Condition”. (Type: bool) |
runtime_features_enable_breakpoint_logging |
Allows to output messages in the devicelog from inside an Executionpoint. Is only possible if breakpoins are supported. The size of the application will increase if this is activated. As an example the size increases by approx. 10 kB on x86. (Type: bool) |
runtime_features_max_number_of_apps |
Used in the ApplicationObject-Plugin to check the maximum numbers of allowed applications. If the number of applications reached the specified limit, the command to add another application will be invisible. A setting of “-1” indicates, that there is no upper limit for the number of applications. |
runtime_features_support-multicore |
You can specify here, if your target is a multicore CPU device or not. |
Device configuration¶
In sub-section “deviceconfiguration” of <ts:TargetSettings…> settings for the device configuration via the CODESYS device editor can be defined.
Example:
<ts:section name="deviceconfiguration">
<ts:setting name="mapping-changeable" type="boolean" access="visible">
<ts:value>false</ts:value>
</ts:setting>
<ts:setting name="simulation-disabled" type="boolean" access="visible">
<ts:value>true</ts:value>
</ts:setting>
XML Tag |
Description |
|---|---|
deviceconfiguration_mapping-changeable |
True or 1: if mapping could be changed between creating new variable and map to existing variable is possible. (Default, if section “target settings” is not available in the device description) False: Only creating new variable is possible (behavior like CODESYS V2.x) |
deviceconfiguration_simulation-disabled |
True or 1: Entry “Simulation <device>, which usually is available in the Online menu, if the currently connected device is a PLC, will be not available False: The menu entry is visible (Default, if section “target settings” is not available in the device description) |
deviceconfiguration_update-only-device-version |
type: boolean; True or 1: Update of the device update is only possible with different versions of exactly this device. False: Also updating to a different device is possible (e.g. changing from EtherCAT to CAN) |
deviceconfiguration_updatealltoequalversion |
type: boolean; True or 1: The device gets updated recursively. All devices below the plc get updated to the same version as the plc. For each device a message gets added, whether the update was successful or not. |
deviceconfiguration_motorola-bitfields |
Type: boolean; TRUE or 1: Bytes in all bitfields of this device are organized according Motorola byte order |
deviceconfiguration_union-root-editable |
Type: boolean; TRUE or 1: Also the root element of union elements, which are defined as IO channels in the IO mapping dialog of the device editor, can be mapped (default); if FALSE, only the subelements are mappable |
deviceconfiguration_enableadditionalparameters |
Type: boolean; TRUE or 1: extended online config mode: If already an application is on the PLC, the user gets a dialog, where he can choose between connecting to the PLC via “Parameter mode” and via “Application mode”. Parameter mode: The project structure on the PLC will be compared with that in the project, and if there is no mismatch, a connection to the PLC will be established. In the generic parameter editor dialog the parameters can be read and written. Applications keep untouched. Application mode: The “online configuration mode” will be established, i.e. an implicit application will be generated on the device for test purposes. No real application program must be downloaded. FALSE or 0: No “Parameter mode” available (like if you choose “online config mode” when there is no application on the PLC) |
deviceconfiguration_skipadditionalparametersforemptyconnectors |
Type: Boolean; True or 1: for connectors with no parameters there will be no additional parameters if setting “enableAdditionalParameters” is set. This will reduce the amount of download parameters and therefore the size of the plc boot project. False or 0: Behavior as with old versions. For all connectors the additional parameters are created. |
deviceconfiguration_multiple-mappable-allowed |
TRUE or 1: It is allowed to map a subelements of a bitfields type even when the basic element is mapped (multiple mapping). However a warning will appear while compiling. |
deviceconfiguration_createbitchannels |
type: boolean; TRUE or 1: All integer datatypes in the device configuration description (example “std:DINT”) will be created with bit channels below the standard data type. Can be used in device descriptions of bus systems which are not supporting bit channels. Note: If used in the device configuration description of the PLC, all devices below will be affected. Note: The setting works only if bit channels are also supported by the IO driver, in IoDrvReadInputs resp. IoDrvWriteOutputs. Otherwise wrong channels or none might be updated ! |
deviceconfiguration_showmultipletaskmappingsaserror |
Type: Boolean; True The compiler will show an error if same inputs or outputs are used in more than one task. Example if %QB0 is used in task 1 and 2 then the error message is shown when generating code. False: No error is show as with older versions. Default: false |
deviceconfiguration_basetype-mappable |
Type: Boolean, true or 1 (default) In the io mapping all types (unions, structs) are mappable. False or 0: The io variables without an iec base type (for example root of structs) are not mappable in the io mapping editor. A message is shown if the user tries to set the io mapping. |
deviceconfiguration_bitfield-mappable |
Type: Boolean, true or 1 (default) In the io mapping the base and all bits of a bit field type could be mapped. False or 0: The base element of a bit field is not mappable. Only the underlying bits could be mapped. A message is shown if the user tries to set the io mapping. |
deviceconfiguration_mapalwaysiecaddress |
Type: Boolean, true or 1: IoDrvReadInputs and IoDrvWriteOutputs are always copying to input %I or output %Q space. The mapping to the existing variables is done in functions afterreadinputs or beforewriteoutputs. SysMem library must be included in the library manager because if a structured parameter is mapped SysMemCpy is used to transfer the data from % to the existing variable. It the setting is enabled IO drives could optimize the coping of data in IoDrvReadInputs and IoDrvWriteOutputs by copying the complete data with one SysMemCpy because the IO-driver must not handle each mapping entry separately. False or 0 (default): Standard behavior as in old versions. |
deviceconfiguration_hideIoFbInstances |
Type: Boolean, true or 1. Function block instances are hidden for the input assistant (attribute hide) is set to all instances for devices. False or 0 (default): Function block instances are shown for input assistant. |
logical-devices_disableChildApp |
For Safety child mapping application Type: Boolean, true or 1: No child mapping application is created False or 0 (default): Child mapping application is created for safety plc device to copy all data from physical devices to logical devices. |
Task configuration¶
This sub-section of <ts:TargetSettings…> describes the task configuration options for the <device>.
Example:
<ts:section name="taskconfiguration">
<ts:setting name="supportmicroseconds" type="boolean" access="readonly">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="supportfreewheeling" type="boolean" access="readonly">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="supportinterval" type="boolean" access="readonly">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="supportevent" type="boolean" access="readonly">
<ts:value>0</ts:value>
</ts:setting>
<ts:setting name="supportexternal" type="boolean" access="readonly">
<ts:value>0</ts:value>
</ts:setting>
<ts:setting name="supportextendedwatchdog" type="boolean" access="readonly">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="defaulttaskpriority" type="integer" access="readonly">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="mintaskpriority" type="integer" access="readonly">
<ts:value>0</ts:value>
</ts:setting>
<ts:setting name="maxtaskpriority" type="integer" access="readonly">
<ts:value>31</ts:value>
</ts:setting>
<ts:setting name="maxnumoftasks" type="integer" access="readonly">
<ts:value>100</ts:value>
</ts:setting>
<ts:setting name="maxeventtasks" type="integer" access="readonly">
<ts:value>3</ts:value>
</ts:setting>
<ts:setting name="maxintervaltasks" type="integer" access="readonly">
<ts:value>3</ts:value>
</ts:setting>
<ts:setting name="maxexternalevents" type="integer" access="readonly">
<ts:value>3</ts:value>
</ts:setting>
<ts:setting name="maxfreetasks" type="integer" access="readonly">
<ts:value>3</ts:value>
</ts:setting>
<ts:setting name="cycletimedefault" type="string" access="readonly">
<ts:value>t#20ms</ts:value>
</ts:setting>
<ts:setting name="cycletimemin_us" type=" integer " access="readonly">
<ts:value>0</ts:value>
</ts:setting>
<ts:setting name="cycletimemax_us" type=" integer " access="readonly">
<ts:value>0x7FFFFFFF</ts:value>
</ts:setting>
<ts:setting name="watchdogtimemax_us" type=" integer "access="readonly">
<ts:value>400</ts:value>
</ts:setting>
<ts:setting name="maxwatchdogsensitivity" type=" integer "access="readonly">
<ts:value>10</ts:value>
</ts:setting>
<ts:setting name="systemtick" type="string" access="visible">
<ts:value>LTIME#250us</ts:value>
</ts:setting>
<ts:setting name="externalevents" type="cdata" access="hide">
</ts:setting>
<ts:setting name="systemevents" type="cdata" access="readonly">
<![CDATA[]]>
</ts:setting>
<ts:section name="priorityinfo">
<ts:setting name="priority-1" type="string" access="visible">
<ts:value>realtime priority</ts:value>
</ts:setting>
<ts:setting name="priority-2" type="string" access="visible">
<ts:value>medium priority</ts:value>
</ts:setting>
</ts:section>
<ts:section name="applicationtasks">
<ts:section name="dataserver">
… see below for detailed example and description
</ts:section>
</ts:section>
</ts:section>
Application tasks
For Visualization and DataServer the programming system automatically creates tasks, per default with the lowest possible priorities. To overwrite the defaults of priority and cycle time for these tasks, the following entries in sections “dataserver” res. “visualization” might be used, which must be positioned within a section “applicationtasks” and this again within section “taskconfiguration”:
Example:
<ts:section name="applicationtasks">
<ts:section name="dataserver">
<ts:setting name="defaulttaskpriority" type="integer" access="visible">
<ts:value>25</ts:value>
</ts:setting>
<ts:setting name="cycletimedefault" type="string" access="visible">
<ts:value>t#200ms</ts:value>
</ts:setting>
</ts:section>
<ts:section name="visualization">
<ts:setting name="defaulttaskpriority" type="integer" access="visible">
<ts:value>24</ts:value>
</ts:setting>
<ts:setting name="cycletimedefault" type="string" access="visible">
<ts:value>t#150ms</ts:value>
</ts:setting>
</ts:section>
</ts:section>
XML Tag |
Description |
|---|---|
taskconfiguration |
Task configuration section |
taskconfiguration_supportmicroseconds |
1= IEC task cycles in the microsecond range are supported. 0= IEC task cycles in the microsecond range are NOT supported. Only tasks in the millisecond range can be projected. |
taskconfiguration_supportfreewheeling |
1= free-running IEC tasks are supported 0= free-running IEC tasks are NOT supported |
taskconfiguration_supportinterval |
1= cyclical IEC tasks are supported 0= cyclical IEC tasks are NOT supported |
taskconfiguration_supportevent |
1= event-driven IEC tasks are supported 0= event-driven IEC tasks are NOT supported |
taskconfiguration_supportexternal |
1= external event-driven IEC tasks are supported 0= external event-driven IEC tasks are NOT supported |
taskconfiguration_supportextendedwatchdog |
1= watchdog monitoring of IEC tasks is supported 0= watchdog monitoring of IEC tasks is NOT supported |
taskconfiguration_defaulttaskpriority |
Standard priority of an IEC task |
taskconfiguration_mintaskpriority |
Minimum priority for an IEC task (maximum task priority) |
taskconfiguration_maxtaskpriority |
Maximum priority for an IEC task (minimum task priority) |
taskconfiguration_maxnumoftasks |
Maximum number of IEC tasks |
taskconfiguration_maxeventtasks |
Maximum number of event-driven IEC tasks |
taskconfiguration_maxintervaltasks |
Maximum number of cyclical IEC tasks |
taskconfiguration_maxexternalevents |
Maximum number of external event-driven IEC tasks |
taskconfiguration_maxfreetasks |
Maximum number of free-running IEC tasks |
taskconfiguration_cycletimedefault |
Default values for the cycle time |
taskconfiguration_cycletimemin_us |
Minimum length of time interval; a value underrunning the minimum length within the task configuration will lead to compile errors |
taskconfiguration_cycletimemax_us |
Maximum length of time interval; a value exceeding the maximum length within the task configuration will lead to compile errors |
taskconfiguration_watchdogtimemax_us |
Maximum watchdog time; a value exceeding the maximum length within the task configuration will lead to compile errors |
taskconfiguration_maxwatchdogsensitivity |
Maximum watchdog sensitivity; a value exceeding the maximum will lead to compile errors |
taskconfiguration_systemtick |
String value; The cycle time must be an integral multiple of the systemtick; |
taskconfiguration_externalevents |
List of names of supported external events; example: |
taskconfiguration_supportprofiling |
1=The Profiling functionality is supported, the resp. dialogs are available in the Task-Editor |
taskconfiguration_watchdog-enabled |
1= IEC Task Watchdog is enabled |
taskconfiguration_default-watchdog-time |
String, defining the default watchdog time |
taskconfiguration_default-watchdog-sensitivity |
String, defining the default watchdog sensitivity |
taskconfiguration_priorityinfo |
In this section the meaning of the task priorities can be described. An information icon shows the priority information in the tooltip of the configuration window |
taskconfiguration_multicore-cores |
Number of cores used for IEC-Tasks. Also the core numbers are defined Examples for allowed values: -1: The task can run on every core 0: Only core number 0 can be configured. 2: Only core number 2 can be configured. 0-3: QuadCore target. Core 0,1,2 or 3 can be configured. 0,2,6-8: 8 Core target, but not all cored are configurable -1,0,3 : Every core (-1) or core 0 or core 3 can be configured. The first core in the list is the default used for a new task |
XML Tag |
Description |
|---|---|
taskconfiguration_systemevents |
subsection within section “taskconfiguration” here the particular events must be specified which should be available in the Event Configuration of the programming system (Task Configuration dialog); an event is uniquely specified by component-id, event-id, parameter-id and parameter-version |
taskconfiguration_library |
String: name of a library containing general functions needed for event handling; the library will be included automatically in the project when using the event function; example: |
XML Tag |
Description |
|---|---|
taskconfiguration_systemevent |
subsection within section “systemevents” for the settings concerning system events; an event is uniquely specified by component-id, event-id, parameter-id and parameter-version; |
taskconfiguration_systemevents_systemevent_eventname |
String, name for event (can be defined here as desired) |
taskconfiguration_systemevents_systemevent_description |
String, short description for event (can be defined here as desired) |
taskconfiguration_systemevents_systemevent_component-id |
Integer, ID of the event as defined in the library specified below by setting “library; example: |
taskconfiguration_systemevents_systemevent_event-id |
Integer, ID of the event as defined in the library specified below by setting “library; example: |
taskconfiguration_systemevents_systemevent_parameter-id |
Integer, ID of the event parameter, as defined in the library specified by setting “library” (see below) |
taskconfiguration_systemevents_systemevent_parameter-version |
Integer, version of the event parameter, as defined in the library specified below by setting “library” |
taskconfiguration_systemevents_systemevent_parameter-struct |
String: name of the parameter structure as defined in the library specified below by setting “library”; example: |
taskconfiguration_systemevents_systemevent_library |
String: name of a library containing the event function; this library will be included automatically in the project when using the event function; example: |
XML Tag |
Description |
|---|---|
taskconfiguration_applicationtasks |
subsection with section “taskconfiguration” for setting the priority and cycletime of Visualizaton resp. DataServer tasks |
taskconfiguration_applicationtasks_cycletimedefault |
Default cycle time |
taskconfiguration_applicationtasks_defaulteventname |
Default event name |
taskconfiguration_applicationtasks_defaultkindoftask |
Default kind of task |
taskconfiguration_applicationtasks_defaulttaskpriority |
Default task priority |
XML Tag |
Description |
|---|---|
taskconfiguration_priorityinfo |
subsection within section “applicationtasks” for the dataserver task settings |
Library management¶
In sub-section “library-management” of <ts:TargetSettings…> the settings for the handling of libraries are defined.
Example:
<ts:section name="library-management">
<ts:section name="placeholder-libraries">
<ts:setting name="IoStandard" type="string" access="visible">
<ts:value>IoStandard, 3.1.1.0 (System)</ts:value>
</ts:setting>
</ts:section>
</ts:section>
Placeholder Libraries
In this sub-section of “library-management” the replacement of libraries is set. The name sets the library name to replace and the value defines the replacement name.
Example: in a library a placeholder library is used. The name in the library is IoStandard. In the target settings the IoStandard is replaces by IoStandard, 3.1.10 (System). In the library manager this replaced library is automatically included.
Example:
<ts:section name="placeholder-libraries">
<ts:setting name="IoStandard" type="string" access="visible">
<ts:value>IoStandard, 3.1.1.0 (System)</ts:value>
</ts:setting>
</ts:section>
Placeholderlib
For replacing 3S-libraries by customer-specific libraries.
Instead of the name of a default 3S-library to be automatically included with the device, a library placeholder can be specified in the Driver Info section (see chap. 7.4.4.4). When the device is added to the project, the currently corresponding customer specific library will be included.
Recipe management¶
In sub-section “RecipeManager” of <ts:TargetSettings…> device-specific settings as well as the default values for the Recipe Manager dialog can be defined.
Example:
<ts:section name="RecipeManager">
<ts:setting name="StorageType" type="integer" access="visible">
<!-- This value sets the default storage type -->
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="FileExtension" type="string" access="visible">
<!-- This value sets the default file extension -->
<ts:value>.txtrecipe</ts:value>
</ts:setting>
<ts:setting name="FilePath" type="string" access="visible">
<!-- This value sets the default file path -->
<ts:value></ts:value>
</ts:setting>
<ts:setting name="TokenSeparator" type="string" access="visible">
<!-- This value sets the default token separator -->
<ts:value>:=</ts:value>
</ts:setting>
<ts:setting name="SelectedColumns" type="string" access="visible">
<!-- This value sets the default selected columns -->
<ts:value>0\|1\|2\|3</ts:value>
</ts:setting>
<ts:setting name="SaveAsDefault" type="boolean" access="visible">
<!-- This value can be used to disable the save as default button -->
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="AutoSaveRecipes" type="boolean" access="visible">
<!-- This value sets the default for the auto save recipes mode -->
<ts:value>1</ts:value>
</ts:setting>
</ts:section>
XML Tag |
Description |
|---|---|
RecipeManager_StorageType |
Integer defining the type of storage; possible values: 0=Binary, 1=Textual |
RecipeManager_FileExtension |
String defining the default extension of the storage file; e.g. “.txtrecipe” |
RecipeManager_FilePath |
String defining the default storage location; e.g. “D:\rec_stor” |
RecipeManager_TokenSeparator |
String defining the default separator in case of storing to a textual file; possible values: Tab, Semicolon, Comma, Space, :=, | |
RecipeManager_SelectedColumns |
String defining the default list of “selected columns”; possible values: “|”-separated list of the column numbers 0,1,2,3; e.g. if the available columns are Type, Name, Minimal Value, Maximal Value, then value “0|1|2|3” will effect that these four columns per default get entered as “selected columns” |
RecipeManager_AutoSaveRecipes |
Boolean; defines whether option “Save changes to recipes automatically” per default is activated (1) or deactivated (0) |
Symbolconfiguration¶
In sub-section “SymbolConfiguration” of <ts:TargetSettings…> device-specific settings concerning the memory for the Symbolconfiguration, which is handled as a “sub-application” can be defined.
Example:
<ts:section name="symbolconfiguration">
<ts:setting name="max-area-size" type="integer" access="visible">
<ts:value>10000</ts:value>
</ts:setting>
<ts:setting name="generate_as_separate_application" type="boolean" access="exit">
<ts:value>0</ts:value>
</ts:setting>
</ts:section>
XML Tag |
Description |
|---|---|
symbolconfiguration_max-area-size |
Integer defining the maximum size [bytes] of the memory area for the symbolconfiguration |
symbolconfiguration_generate_as_separate_application |
Boolean: 0 = Symbolconfiguration is generated in father application 1 = :Symbolconfiguratuion is generated as a separate child application [Default] |
Memory layout¶
This sub-section of <ts:TargetSettings…> describes the memory layout of the controller. It contains all information necessary for generating code for the compiler.
It is qute complex to describe all necessary memory areas for different use cases. For this we plan a tutorial, which give you all information on this (see CODESYSControlV3_IEC-MemoryManagement_Tutorial).
Note
With compiler version >= 3.4.2.0 all memory settings of a parent application are also set on the child application!
Example:
<ts:section name="memory-layout">
<ts:setting name="memory-size" type="integer" access="visible">
<ts:value>1280</ts:value>
</ts:setting>
<ts:setting name="input-size" type="integer" access="visible">
<ts:value>1280</ts:value>
</ts:setting>
<ts:setting name="output-size" type="integer" access="visible">
<ts:value>1280</ts:value>
</ts:setting>
<ts:setting name="retain-size" type="integer" access="visible">
<ts:value>1280</ts:value>
</ts:setting>
<ts:setting name="retain-in-own-segment" type="boolean" access="visible">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="pack-mode" type="integer" access="visible">
<ts:value>8</ts:value>
</ts:setting>
<ts:setting name="stack-alignment" type="integer" access="visible">
<ts:value>4</ts:value>
</ts:setting>
<ts:setting name="code-segment-size" type="integer" access="visible">
<ts:value>65536</ts:value>
</ts:setting>
<ts:setting name="data-segment-size" type="integer" access="visible">
<ts:value>65536</ts:value>
</ts:setting>
<ts:setting name="code-segment-prolog-size" type="integer" access="visible">
<ts:value>16</ts:value>
</ts:setting>
<ts:setting name="additional-areas" type="boolean" access="visible">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="max-stack-size" type=" integer" access="visible">
<ts:value>40000</ts:value>
</ts:setting>
<ts:setting name="max-stack-size-external-call" type=" integer" access="visible">
<ts:value>3000</ts:value>
</ts:setting>
<ts:section name="areas">
<ts:setting name="number" type="integer" access="visible">
<ts:value>1</ts:value>
</ts:setting>
<ts:section name="area_0">
<ts:setting name="area_flags" type="integer" access="visible">
<ts:value>0x10</ts:value>
</ts:setting>
<ts:setting name="flags" type="integer" access="visible">
<ts:value>0xffBf</ts:value>
</ts:setting>
<ts:setting name="minimal-area-size" type="integer" access="visible">
<ts:value>262144</ts:value>
</ts:setting>
<ts:setting name="maximal-area-size" type="integer" access="visible">
<ts:value>262144</ts:value>
</ts:setting>
<ts:setting name="allocation-plus-in-percent" type="integer" access="visible">
<ts:value>0</ts:value>
</ts:setting>
<ts:setting name="start-address" type="integer" access="visible">
<ts:value>0x34020218</ts:value>
</ts:setting>
</ts:section>
</ts:section>
</ts:section>
XML Tag |
Description |
|---|---|
memory-layout |
Contains information about the runtime system memory layout |
memory-layout_memory-size |
Size of the memory segment in bytes (%M.-Addresses) |
memory-layout_input-size |
Size of the input segment of the process map (inputs, %I-Addresses) |
memory-layout_output-size |
Size of the output segment of the process map (outputs, %Q-Addresses) |
memory-layout_retain-size |
Size of the retain segment IMPORTANT: If the retains are stored in an SRAM or NVRAM in the controller, a value that is 24 bytes less than the value actually available in the controller must be specified here! This is used for saving an ID in the retain memory through which consistency of the retain data with respect to the IEC application can be ensured. |
memory-layout_retain-in-own-segment |
1= retain data are stored in their own segment in the controller
0= retain data are stored in the same segment as all volatile data of an IEC application (Default is 1)
|
as from V3.3!: memory-layout_dynamic-retain memory-layout_dynamic-persistent |
1= If you define a retain area with dynamic size (area-flag 4), the size of the retain (persistent) area will be calculated dynamically and allocated according to the actual need. If no retain (persistent) data is needed, no area will be allocated during download. Note: “retain-in-own-segment” must be 1. “retain-size” must be 0. If retain (persistent) data is newly needed for download or online change, the size of the area will be calculated once according to the settings in device description (min. area size, allocation plus in percent). For subsequent online changes no additional areas will be allocated, so the memory might be not sufficient even if a full new download would work. |
memory-layout_constants-in-own-segment |
1= constants of type userdef, array or string will be located in a defined code area. Notes:
Example:
With the following memory-layout in the target settings, all constant arrays will be located to area 1 (same as code), all non-constant variables will be located to area 0:
<ts:section name="memory-layout">
[...]
<ts:setting name="constants-in-own-segment" type="boolean" access="visible">
<ts:value>true</ts:value>
</ts:setting>
<ts:section name="areas">
<ts:setting name="number" type="integer" access="visible">
<ts:value>4</ts:value>
</ts:setting>
<ts:section name="area_0">
<!–Global data memory
<ts:setting name="flags" type="integer" access="visible">
<ts:value>0xfe9d</ts:value>
</ts:setting>
<ts:setting name="minimal-area-size" type="integer" access="visible">
<ts:value>0x100000</ts:value>
</ts:setting>
<ts:setting name="allocation-plus-in-percent" type="integer" access="visible">
<ts:value>30</ts:value>
</ts:setting>
</ts:section>
<ts:section name="area_1">
<!–Global code and constant memory
<ts:setting name="flags" type="integer" access="visible">
<ts:value>0x0042</ts:value>
</ts:setting>
<ts:setting name="minimal-area-size" type="integer" access="visible">
<ts:value>0x100000</ts:value>
</ts:setting>
<ts:setting name="allocation-plus-in-percent" type="integer" access="visible">
<ts:value>30</ts:value>
</ts:setting>
</ts:section>
<ts:section name="area_2">
<!–RETAIN memory
<ts:setting name="flags" type="integer" access="visible">
<ts:value>0x0020</ts:value>
</ts:setting>
<ts:setting name="minimal-area-size" type="integer" access="visible">
<ts:value>0x1000</ts:value>
</ts:setting>
<ts:setting name="allocation-plus-in-percent" type="integer" access="visible">
<ts:value>20</ts:value>
</ts:setting>
</ts:section>
<ts:section name="area_3">
<!–PERSISTENT RETAIN memory
<ts:setting name="flags" type="integer" access="visible">
<ts:value>0x0120</ts:value>
</ts:setting>
<ts:setting name="minimal-area-size" type="integer" access="visible">
<ts:value>0x1000</ts:value>
</ts:setting>
<ts:setting name="allocation-plus-in-percent" type="integer" access="visible">
<ts:value>20</ts:value>
</ts:setting>
</ts:section>
</ts:section>
</ts:section>
|
memory-layout_online-change-in-own-segment |
|
memory-layout_pack-mode |
4= structures are created 4-byte-aligned, i.e.: | BYTE on BYTE limits | WORD on WORD limits | DWORD on DWORD limits | LINT on DWORD limits 8= structures are created 8-byte-aligned, i.e.: BYTE on BYTE limits
WORD on WORD limits
DWORD on DWORD limits
LINT on LINT limits
[Default=8] Within a structure, bytes are aligned to byte limits, words to word limits etc. On the other hand a variable of type of a structure will be aligned to the limit of the biggest non-structured data type which is contained. |
memory-layout_stack-alignment |
Alignment of the stack during function calls
|
memory-layout_code-segment-size |
Use this setting if your controller has segmented code. A POU may not grow larger than one code segment, and is never placed over segment borders. No entry or value 0xffffffff is interpreted as « no segmentation ». |
memory-layout_data-segment-size |
Use this setting if your controller has segmented data. One variable may not grow larger than one data segment, and one variable is never placed over segment borders. No entry or value 0xffffffff is interpreted as « no segmentation ». |
memory-layout_byte-addressing |
TRUE: The compiler and the devices will use byte addressing mode (ADR(%IW1)=ADR(%IB1) FALSE (default): Word addressing mode is used: (ADR(%IW1)=ADR(%IB2) |
memory-layout_bit-word-addressing |
TRUE: Word oriented addressing mode is used on first address element of direct bit addresses. Range of second address element (bit) is 0..15: ADR(%IW1)=ADR(%IX1.0); FALSE (default): Byte addressing mode is used. Range of second address element (bit) is 0..7: ADR(%IW1)=ADR(%IX2.0) Note: Setting “bit-byte-addressing” is obsolete. |
memory-layout_additional-areas |
TRUE: additional areas will be used for online change, if code or data exceeds the memory in the specified areas. |
memory-layout_code-segment-prolog-size |
If this value is != 0, the specified size at the beginning of each code area is not used for allocation of IEC-Code. Thus the runtime system is free to add specific code in this place. At the moment this setting is only used for ARM-Targets, in this case the prolog contains a jump to the breakpoint handling routine in the runtime system. The code patched for Breakpoints is a jump to offset 0 in the area. Therefore we can avoid Exception handling for handling breakpoints. |
memory-layout_address-assignment-guid |
Specifies the GUID which determines the address assignment strategy. The GUID is defined in the plug-in. |
XML Tag |
Description |
|---|---|
memory-layout_areas |
Contains information about what areas to allocate on the runtime system. |
memory-layout_areas_area_{0} |
Contains information about the area with index <num>. |
memory-layout_areas_area_{0}_area_flags |
This setting defines what kind of data is located in this area. The following values are possible: Data = 0x1, // “normal” data Constant = 0x2, // constant data (not // used at the moment Input = 0x4, // input segment (%I) Output = 0x8, // output segment (%Q) Memory = 0x10, // memory segment (%M) Retain = 0x20, // retain segment Code = 0x40, // code
Persistent = 0x100, // persistent data
|
memory-layout_areas_area_{0}_minimal-area-size |
The minimal size of the area, despite of the needed memory. (additional size will be used for online changes). IMPORTANT: If this area has the Retain flag and if retains are stored in an SRAM or NVRAM in the controller, a value that is 24 bytes less than the value actually available in the controller must be specified here! This is used for saving an ID in the retain memory through which consistency of the retain data with respect to the IEC application can be ensured. For persistent variables, the actual available size for the program is 44 Bytes less than the specified size, these bytes are used for identification information! |
memory-layout_areas_area_{0}_maximal-area-size |
The maximal size of the area. If more space is required and no other area can be used, an error will be displayed |
memory-layout_areas_area_{0}_allocation-plus-in-percent |
The size allocated for the area will be this percentage larger than required for the data. | Thus, the calculation of the area size is this: | TestSize := neededsize + neededsize * allocation-plus/100; | Size := MIN(MAX(minimalsize, TestSize), maximalsize) Any additional size in the area will be used for online changes, as long as possible. |
memory-layout_areas_area_{0}_start-address |
Only used for Areas with Flag “FixedSize”! The start address for the area as used on the runtime system. If the area contains data (variables), any reference in code to this will not be relocated on the runtime system, but will contain the correct address. |
memory-layout_minimal-structure-granularity |
Special setting for Tricore | Tricore EABI documentation: | Padding must be applied to the end of a union or structure to make its size a multiple of the alignment. | … To facilitate copy operations, any structure larger than 1 Byte must have a minimum 2 Byte alignment, even if its only members are byte elements i.e: set minimal-structure-granularity to 2 in this case Default: -1 (value to ignore) |
memory-layout_max-stack-size |
Enables the check of the used stack at compile time. The maximum number of bytes available on the runtime system. An error message ist generated at compile time if not enough stack is available. If a recursion is detected the warning “C0298: Calculation of stack usage incomplete” is generated. Note: There are no warnings for recursions detected in libraries. |
memory-layout_max-stack-size-external-call |
Maximum number of bytes of stack required by external function calls. This value is considered for calculating the used stack for every IEC-POU that calls an external function. |
Possibility to define an area for both retain and persistent data. If the memory-management contains a static-area, this area will replace any area containing Retain or Persistent data. The only settings that are possible for this area is size and address. The area will then allocate memory for persistent variables and retain variables. Persistent Variables are allocated with rising addresses and start at 0. Retain variables are allocated with falling addresses starting at the end of the area.
Since this setting is evaluated from codesys-versions >= 3.5.2.0, you should keep the old area definitions in the areas section for compatibility with previous codesys versions. In the order of areas, the static area will be inserted last! You should use this possibility, if the device is not suitable for handling several applications with retain variables. Then you can set the size of the maximum possible amount of retain data (minus 24 bytes -> see note for static-area\size).
XML Tag |
Description |
|---|---|
memory-layout_static-area_size |
This is the size of the static area, this size will be allocated on the controller for each application, despite the actual need of the application. If the application defines more retain and persistent data than available, the compiler will generate an error. IMPORTANT: If retains are stored in an SRAM or NVRAM in the controller, a value that is 24 bytes less than the value actually available in the controller must be specified here! This is used for saving an ID in the retain memory through which consistency of the retain data with respect to the IEC application can be ensured. |
memory-layout_static-area_start-address |
The start-address of the static memory, if applicable. Do not define this setting, if the address is not the same on each device at any time. Without a start-address, relocation information will be generated along with the code, to relocate address accesses on the controller after download. |
memory-layout_static-area_allow-user-defined-size |
Indicates whether the user can modify the static area size in the application memory settings. |
Some Use cases of memory layout settings
In the following we have listed a number of problems the average editor of a device description will face. Of course there might as many memory layouts as there are target devices, but some settings are very common for classes of devices. See CODESYSControlV3_IEC-MemoryManagement_Tutorial for more information.
Example:
<ts:section name="memory-layout">
<ts:setting name="memory-size" type="integer" access="visible">
<ts:value>1280</ts:value>
</ts:setting>
<ts:setting name="input-size" type="integer" access="visible">
<ts:value>1280</ts:value>
</ts:setting>
<ts:setting name="output-size" type="integer" access="visible">
<ts:value>1280</ts:value>
</ts:setting>
<ts:setting name="retain-size" type="integer" access="visible">
<ts:value>1280</ts:value>
</ts:setting>
<ts:setting name="retain-in-own-segment" type="boolean" access="visible">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="pack-mode" type="integer" access="visible">
<ts:value>8</ts:value>
</ts:setting>
<ts:setting name="stack-alignment" type="integer" access="visible">
<ts:value>4</ts:value>
</ts:setting>
<ts:setting name="minimal-area-size" type="integer" access="visible">
<ts:value>1048576</ts:value>
</ts:setting>
<ts:setting name="allocation-plus-in-percent" type="integer" access="visible">
<ts:value>30</ts:value>
</ts:setting>
<ts:section name="areas">
<ts:setting name="number" type="integer" access="visible">
<ts:value>4</ts:value>
</ts:setting>
<ts:section name="area_0">
<!–DATA memory-->
<ts:setting name="flags" type="integer" access="visible">
<ts:value>0xfe9f</ts:value>
</ts:setting>
</ts:section>
<ts:section name="area_1">
<!–RETAIN memory-->
<ts:setting name="flags" type="integer" access="visible">
<ts:value>0x0020</ts:value>
</ts:setting>
<ts:setting name="minimal-area-size" type="integer" access="visible">
<ts:value>0x1000</ts:value>
</ts:setting>
<ts:setting name="allocation-plus-in-percent" type="integer" access="visible">
<ts:value>20</ts:value>
</ts:setting>
</ts:section>
<ts:section name="area_2">
<!–RETAIN PERSISTENT memory-->
<ts:setting name="flags" type="integer" access="visible">
<ts:value>0x0120</ts:value>
</ts:setting>
<ts:setting name="minimal-area-size" type="integer" access="visible">
<ts:value>0x1000</ts:value>
</ts:setting>
<ts:setting name="allocation-plus-in-percent" type="integer" access="visible">
<ts:value>20</ts:value>
</ts:setting>
</ts:section>
<ts:section name="area_3">
<!–RETAIN PERSISTENT memory-->
<ts:setting name="flags" type="integer" access="visible">
<ts:value>0x0040</ts:value>
</ts:setting>
</ts:section>
</ts:section>
</ts:section>
Small system with a limited RAM, Code in Flash:
Define two areas (plus retain or persistent): One area containing all normal data with a fixed size at a fixed address, to avoid relocation in the runtime system:
area_0.flags := 0xffbf; // all except 0x40
area_0.area_flags := 0x10; // fixed size
area_0.minimal-area-size := <size>;
area_0.maximal-area-size := <size>;
area_0.allocation-plus-in-percent := 0;
area_0.start-address := <address of area pointer in runtime system>;
One area containing only code.
area_1.flags := 0x40; // only 0x40
area_1.minimal-area-size := <size>;
area_1.maximal-area-size := <size>;
area_1.allocation-plus-in-percent := 0;
The number of applications must be limited to 1 for this runtime system, otherwise two applications would share the same memory. Additional areas should also be set false.
Usage of RETAIN:
Retain is handled like input or output. The retain data is allocated as one segment in an appropriate area. If you want to define one area containing only retain data, you should choose the following settings:
retain-size : <size>
retain-in-own-segment : 1 // this is also the default
area_x.flags : 0x20
area_x.minimal-area-size : <size_x>
area_x.maximal-area-size : <size_x>
area_x.allocation-plus-in-percent : 0
Then area_x will contain exactly one segment for the retain data of the required size. In case of the settings of the CODESYS Control device description example shown above only one segment of retain data will be mapped in the normal data area.
Example of SysMemAllocArea in SysMem<OS>.c:
This is a very simple example of the function SysMemAllocArea. It assumes that 2 areas are defined in the devdesc file: One for retain data (flags: 0x20), and one for all the rest (code, data, inputs, outputs) (flags: 0xFFDF). It returns pointers to these 2 areas. The retain area is located in some SRAM, the other area is static memory.
Please note that this example only covers the memory of one application. If a second application would be downloaded to this controller, the same addresses would be assigned, and this would lead to some memory mismatch between the applications.
#define RETAIN_SIZE 0x1000 /* Size of retain data */
#define MEMORY_SIZE 0x100000 /* Static memory for code and data */
char pMem[MEMORY_SIZE];
void* CDECL SysMemAllocArea(char *pszComponentName, unsigned short usType, unsigned long ulSize, RTS_RESULT *pResult)
{
if ((usType & DA_RETAIN) != 0) /* Retain */
{
/* Check size */
if (ulSize > RETAIN_SIZE)
{
RTS_SETRESULT(pResult, ERR_NOMEMORY);
return NULL;
}
/* Return pointer to SRAM or NVRAM */
RTS_SETRESULT(pResult, ERR_OK);
return (void *)0x12345678; /* Pointer to SRAM or NVRAM */
}
else /* all other data */
{
/* Check size */
if (ulSize > MEMORY_SIZE)
{
RTS_SETRESULT(pResult, ERR_NOMEMORY);
return NULL;
}
/* Return pointer to data or code area */
RTS_SETRESULT(pResult, ERR_OK);
return (void *)pMem; /* Pointer to static buffer */
}
}
Usage of PERSISTENT:
At the moment, each application can only contain one list of persistent data. This list can be either PERSISTENT or RETAIN PERSISTENT. The persistent area can’t contain anything else than persistent data!
The persistent area contains a header with a checksum for the current list, and the length of the current list. We upload this information at login and if both values did not change we estimate the list to be the same. All other persistent variables are located one after the other – according to the pack mode – in the persistent area. An example for a persistent area shows the CODESYS Control example above. Note that the RETAIN PERSISTENT area will not contain any retain data.
Child applications
Child applications have access to any data and code of their parent applications. A child application cannot handle own input, output, memory, retain or persistent data, so the area for any child application is created implicitly and not due to target settings.
- With compiler version < 3.4.2.0 child applications have one area with the following settings:
Child_area.flags := 0x43; // code and all data Child_area.minimal-area-size := 0x100000; Child_area.allocation-plus-in-percent := 100;
Additional areas needed for online change will have the same settings.
- With compiler version >= 3.4.2.0 all memory settings of the parent application automatically will also be set on the child application. | Additional areas needed for online change will have the same settings.
Online¶
With these settings you can customize the online manager in CODESYS.
Example:
<ts:section name="online">
<ts:setting name="customizedonlinemgr" type="boolean" access="edit">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="customized-fileupload" type="string" access="edit">
<ts:value>4B84C13B-D82E-461c-9A3E-47E2AFAD3A2D</ts:value>
</ts:setting>
<ts:setting name="customized-filedownload" type="string" access="edit">
<ts:value>46F722D1-A347-44ca-B1D6-55A3CE398497</ts:value>
</ts:setting>
<ts:setting name="customized-etcservices" type="string" access="edit">
<ts:value>54CCD7B5-AC14-4204-B554-54F36529FCF1</ts:value>
</ts:setting>
</ts:section>
XML Tag |
Description |
|---|---|
online |
Online section |
online_customizedonlinemgrcustomizedonlinemgr |
type=”boolean”
If TRUE, a customer specific OnlineMgr will be used for diagnosis.
|
online_customizedonlinemgrcustomized-fileupload |
type=”string”
This entry serves to implement an „own” file upload. The value is the typeguid of the implemented interface
( IfileUpload ).
|
online_customizedonlinemgrcustomized-filedownload |
type=”string”
This entry serves to implement an „own” file download. The value is the typeguid of the implemented interface
( IfileDownload ).
|
online_customizedonlinemgrcustomized-etcservices |
type=”string”
This entry serves to implement an „own” service handler for EtherCAT services (at the moment only used by “Safety Parameter Page” of EL69xx device). The value is the typeguid of the implemented interface
( IETCServices ).
|
Code generator¶
In sub-section “codegenerator” of <ts:TargetSettings…> all code generator options for the target processor are set.
Example:
<ts:section name="codegenerator">
<ts:setting name="CPU" type="codegenerators" access="edit">
<ts:value>Intel X86</ts:value>
</ts:setting>
<ts:setting name="Floating Point Unit" type="boolean" access="visible">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="Breakpoint Size" type="integer" access="visible">
<ts:value>5</ts:value>
</ts:setting>
<ts:setting name="external-linkage" type="string" access="visible">
<ts:value>MUL,DIV</ts:value>
</ts:setting>
<ts:setting name="codegenerator-guid" type="string" access="visible">
<ts:value>{C746DD9C-011F-4ab9-A555-EB14C69F50CF}</ts:value>
</ts:setting>
<ts:setting name="codegenerator-version-constraint" type="string" access="visible">
<ts:value>newest</ts:value>
</ts:setting>
<ts:setting name="compiler-defines" type="string" access="visible">
<ts:value>IEC_COMPILER_DEFINE1,IEC_COMPILER_DEFINE2</ts:value>
</ts:setting>
</ts:section>
XML Tag |
Description |
|---|---|
codegenerator |
Codegenerator section |
codegenerator_CPU |
Processor type |
codegenerator_Floating Point Unit |
1=Floating point unit present 0=FPU missing |
codegenerator_Breakpoint Size |
Size of the breakpoint OpCode in bytes: Intel X86= 5 |
codegenerator_external-linkage |
The functions listed will be implemented by external code (actually valid for MUL, DIV for NIOS only) |
codegenerator_codegenerator-guid |
CODESYS codegenerator GUID |
codegenerator_maximum_num_applications |
Maximum number of applications, which can be used in the project without getting a warning at compile time. Also implicitly generated applications will be regarded, like e.g. symbol application. You might use this setting to control the number of applications for download to the target system. Note however that the applications for a certain target may be distributed over several projects, so that a download might fail even if there has been no warning at compilation of a particular project. |
codegenerator_retain-in-cycle |
Default: 0, type=”boolean”
If the value for this setting is “1” and compiler version is >=3.2.2.20, then all retain parameters will be handled in the following way:
- All retain variables (not only that for function blocks) are located in the standard data memory
- Additional code is generated for all retain variable (especially for all retains in FB-instances) to copy all retains at the end of a cycle to the retain area.
- After booting with a project the retain variables are initialized with the data in retain memory.
As a consequence, it is now also possible to declare variables on direct output addresses as RETAIN variables.
Note: This behavior may have effects on code size and performance. |
codegenerator_check-multiple-task-output-write |
Default: 0, type=”boolean” If the value for this setting is “1” and compiler version is >=3.2.2.40 then it will be checked, whether two tasks are accessing the same output. An error message will be generated in the following cases: - a POU called in multiple tasks writes to an output - two POUs write to the same output and are called in multiple tasks - two POUs write to different bits of the same byte and are called in multiple tasks This is valid for variables mapped in the device configuration („new variable”) or via an AT-declaration, and for direct access on Ios in the implementation code (%QX := …). |
codegenerator_reserved-registers |
type=”string” The specified register will be reserved. Value e.g. “14” in order to reserve register R14. |
codegenerator_Motorola Byte Order |
type= “boolean” If TRUE, Motorola Byte Order will be used (Default for PowerPC code generators!), otherwise Intel byte order is used (default for the other code generators and when used in other scopes, e.g. for network variables) |
codegenerator_hexfile |
type=”boolean” If TRUE, the command “Generate hex file for active application” will be available in the Build menu of the programming system. For this At least 8 byte of code segment prolog size is required: |
codegenerator_lreal-data-type codegenerator_lint-data-types |
type=”boolean” If FALSE, the resp. 64bit datatypes are not valid |
codegenerator_do-persistent-code |
Type=”boolean” (default: 1) In CODESYS V3 persistent variables are handled differently to V2.3. If there are persistent variables defined in a function block, but their instance paths are not mapped in the list of persistent variables, then warnings resp. error messages will be created. If do-persistent-code is set to “1”, then these messages will be suppressed. This enables customers to implement an own persistent handling. |
codegenerator_link-all-globalvariables |
Type=”boolean” (default: 1) If 1 (default): All global variables of a project get downloaded, even if no one is used. This e.g. is needed for variables that are only used by the HMI but not by the PLC. If 0: A list of global variables only get downloaded, if at least one is used |
codegenerator_multithreading |
Type=”boolean” (default: 1) If 1 (default): The CODESYS compiler uses multiple threads to increase the compile speed. If 0: The CODESYS compiler uses just one single thread to build. Note: Because of timing effects, the result of a multithreading build might be different across single compiles. |
codegenerator_generate_direct_calls |
Type=”boolean” (default: 0) Compilerversion >= 3.5.1.0 Programm and function calls are done direct and not via a function pointer. Online change must be switched off in the target settings. Implemented for C166, ARM, MIPS and CortexM3 |
codegenerator_c-calling-convention |
Type:”boolean” (default: 0) Compilerversion >= 3.5.1.0 External function calls are performed according the C calling conventions. Implemented for ARM (intel byte order) without FPU under CE and for x86 under Windows |
codegenerator_ltick |
Enables the “__GetLTick” operator. May be not implemented or supported by all operating systems. |
codegenerator_compiler-defines |
Compiler defines which can be used for conditional compiles in the IEC-application. The predefined definitions are described in the chapter Compiler defines. |
Additional settings for PowerPC Codegenerator:
XML Tag |
Description |
|---|---|
codegenerator_single-precision-floating-point-apu codegenerator_double-precision-floating-point-apu codegenerator_Vector Unit |
Type=”boolean” (default: 0) Settings to support special floating point units |
codegenerator_misaligned-access |
Type=”Boolean” (default: 1) Memcopy is performed 4Byte-wise. On some platform, this misalignment may lead to alignment exceptions |
codegenerator_generate-real-to-integer-native |
Compilerversion >= 3.5.9.0 Type=”Boolean” (default: false) Inline code is generated for conversions from LREAL/REAL to integer. Else an external function is called. Attention: Inline code uses the rounding mode of the processor (The rounding mode set in the RN filed of the FPSCR register). The external function always rounds to nearest integer according to IEC61131-3. |
Backend GUID for the PowerPC VLE instruction set: {EC55BA00-43D6-40B9-86D8-5BF72BE2DB16}
Additional settings for 386 Codegenerator:
XML Tag |
Description |
|---|---|
codegenerator_sse2-unit |
Compilerversion >= 3.5.2.0 Type=”Boolean” (default: true) SSE-2 unit is used for REAL/LREAL operations |
codegenerator_ltick |
Compilerversion >= 3.6.2.0 Type=”Boolean” (default: false) Generate code for the __GetLTICK operator. Call LTIME if false |
Additional settings for x86-64 Codegenerator:
XML Tag |
Description |
|---|---|
codegenerator_operating-system |
Type=”string” (default: Empty string for Windows OS) “Linux”: To consider special rules for the Linux operating system (e.g.: calling conventions) |
codegenerator_ltick |
Compilerversion >= 3.6.2.0 Type=”Boolean” (default: false) Generate code for the __GetLTICK operator. Call LTIME if false |
codegenerator_sse2-unit |
Compilerversion >= 3.5.2.0 Type=”Boolean” (default: true) SSE-2 unit is used for REAL/LREAL operations |
Additional settings for the ARM and x86 Codegenerator:
XML Tag |
Description |
|---|---|
codegenerator_c-calling-convention |
Type=”string” (default: use 3S calling convention) “CDECL”: To generate a C-compatible call interface for external calls. Implemented for ARM with intel byte order without FPU running with Windows CE and for x86 with Windows |
Additional settings for the ARM Codegenerator:
XML Tag |
Description |
|---|---|
codegenerator_atomic-read-write-64-bit |
Type=”bool” (default: FALSE) The LDRD and STRD instructions are available to perform an atomic read/write access to 64-bit integer data types. Global 64-bit integer variables with the attribute “atomic-read-write” are accessed with these instructions. Compilerversion >= 3.5.7.0 |
Additional settings for the ARM-CortexM3 Codegenerator:
XML Tag |
Description |
|---|---|
codegenerator_generate-div |
Type=”bool” (default: FALSE) The code generator uses SDIV/UDIV instructions for the DIV operator. Otherwise an external function call is generated. |
Additional settings for SH Codegenerator:
XML Tag |
Description |
|---|---|
codegenerator_CPU |
Type=”string” (default: “SH-3”) Possible values: “SH-2”, “SH-2A”, “SH-3”, “SH-4” |
codegenerator_rts-globaldatapointer-area |
Type=”integer” (default: -1 = do not use) Global data in the specified area is accessed via register 10 holding the base address initialized by the runtime system. |
codegenerator_single-precision-mode |
1 (TRUE): All REAL operations are done with native FPU instructions in single precision mode. All LREAL operations are done via external function call. 0 (FALSE = Default): All FPU operations (REAL and LREAL) are done with native FPU instructions in double precision mode. REAL values are implicit converted to double precision after load and converted back to single precision before store. |
codegenerator_set-precision-mode |
1 (TRUE = Default): The precision mode bit in the Floating-Point Status/Control Register (FPSCR) is set appropriate before the FPU is used. 0 (FALSE): It is assumed to be set appropriate. |
codegenerator_gbr-always-zero |
1 (TRUE): The GBR register has always the value zero. The GBR register is used for bit access and must not be set to zero before. 0 (FALSE = Default) The value of the GBR register is preserved and restored. |
Additional setting for TIC28x Codegenerator:
XML Tag |
Description |
|---|---|
codegenerator_dp-register-addressing |
Type=”boolean” (default: 0) For compiler versions >=3.5.1.0 If 0 (default): 32 bit addressing (standard) If 1: DP registers is used for global data access. This reduces the code size for global data access. 22 bit addressing. Preconditions:
<ts:setting name=”area_flags” type=”integer” access=”visible”>
<ts:value>0x10</ts:value>
</ts:setting>
<ts:setting name=”start-address” type=”integer” access=”visible”>
<ts:value>0xA0000</ts:value>
</ts:setting>
|
Compiler defines¶
For details see the corresponding target setting codegenerator_compiler-defines.
Here you can specify compiler defines which can be used for conditional compiles in the IEC-application:
Compiler defines for IO-configuration
Compiler define |
Description |
|---|---|
CANBUS_NO_LOGMESSAGES |
Disables log messages for CANbus node. This define can be set for reducing code and memory size on embedded targets. |
CANOPEN_NO_LOGMESSAGES |
Disables log messages for CANopen Stack. This define can be set for reducing code and memory size on embedded targets. |
Compiler defines for IEC libraries
Compiler define |
Description |
|---|---|
Visualization¶
Subsection “visualization” of <ts:TargetSettings…> is available for device-specific visualization settings.
Example:
<ts:section name="visualization">
<ts:section name="targetsupport">
<ts:setting name="webvisualization" type="boolean" access="visible">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="webvisualization_client" type="boolean"
access="visible">
<ts:value>0</ts:value>
</ts:setting>
<ts:setting name="integratedwebserver" type="boolean" access="visible">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="webvisualization_insertbydefault" type="boolean"
access="visible">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="targetvisualization_insertbydefault" type="boolean"
access="visible">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="transferfilestoplc" type="boolean" access="visible">
<!–If this value is set to true, then the visualization files get
re-process to the plc !>
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="targetvisualization_supportskeyboard" type="boolean"
access="visible">
<!–if this value is set to true, the target has a keyboard, else not
<ts:value>1</ts:value>
</ts:setting>
</ts:section>
<ts:section name="keyboardusage">
<ts:setting name="availablemodifiers" type="string" access="visible">
<ts:value>SHIFT,CTRL,ALT</ts:value>
</ts:setting>
<ts:setting name="basekeys" type="string" access="visible">
<ts:value>default</ts:value>
</ts:setting>
<ts:section name="additionalkeys">
<ts:setting name="EMERGENCY_STOP" type="integer" access="visible">
<ts:value>300</ts:value>
</ts:setting>
<ts:setting name="MACHINE_SHUTDOWN" type="integer" access="visible">
<ts:value>301</ts:value>
</ts:setting>
</ts:section>
<ts:section name="notavailablekeys">
<ts:setting name="BACKSPACE" type="string" access="visible">
<ts:value/>
</ts:setting>
</ts:section>
</ts:section>
<ts:section name="TargetConstraints">
<ts:section name="TargetFonts">
<ts:section name="Arial CE">
<ts:setting name="WindowsMatchingFont" type="string" access="visible">
<ts:value>Arial</ts:value>
</ts:setting>
<ts:setting name="Sizes" type="string" access="visible">
<ts:value>10,12,14</ts:value>
</ts:setting>
<ts:setting name="Styles" type="string" access="visible">
<ts:value>default,bold</ts:value>
</ts:setting>
</ts:section>
</ts:section>
<ts:section name="TargetColors">
<ts:setting name="Black" type="uint" access="visible">
<ts:value>0xff000000</ts:value>
</ts:setting>
<ts:setting name="White" type="uint" access="visible">
<ts:value>0xffffffff</ts:value>
</ts:setting>
<ts:setting name="Green" type="uint" access="visible">
<ts:value>0xff00ff00</ts:value>
</ts:setting>
<ts:setting name="Red" type="uint" access="visible">
<ts:value>0xffff0000</ts:value>
</ts:setting>
<ts:setting name="Blue" type="uint" access="visible">
<ts:value>0xff0000ff</ts:value>
</ts:setting>
</ts:section>
<ts:section name="TargetVisualElements">
<ts:setting name="NotAvailableElements" type="string" access="visible">
<ts:value>Trace\|Table</ts:value>
</ts:setting>
<ts:setting name="AvailableElemets" type="string" access="visible">
<ts:value>Rectangle\|Button\|Frame\|Polygon</ts:value>
</ts:setting>
</ts:section>
<ts:setting name="TargetImageFormats" type="string" access="visible">
<ts:value>\*.bmp\|\*.jpg</ts:value>
</ts:setting>
<ts:setting name="SupportGradientFill" access="visible" type="boolean">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="SupportSemiTransparentDrawing" access="visible"
type="boolean">
<ts:value>1</ts:value>
</ts:setting>
<ts:setting name="SupportButtonImagePosition" access="visible"
type="boolean">
<ts:value>1</ts:value></ts:setting>
<ts:setting name="MaxNumOfVisualizations" type="integer"
access="visible">
<ts:value>500</ts:value>
</ts:setting>
<ts:setting name="MaxNumOfElementsPerVisualization" type="integer"
access="visible">
<ts:value>200</ts:value>
</ts:setting>
</ts:section>
</ts:section>
Section “targetsupport”, subsection of “visualization”:
The following settings define the file transfer mode:
XML Tag |
Description |
|---|---|
visualization_targetsupport_webvisualization |
1=Web-Visualization is supported |
visualization_targetsupport_integratedwebserver |
1=Web Server integrated in runtime system is available |
visualization_targetsupport_webvisualization_insertbydefault |
1=A “WebVisualization” object is automatically inserted in the project tree below the Visualization Manager object |
visualization_targetsupport_targetvisualization_insertbydefault |
1=A “TargetVisualization” object is automatically inserted in the project tree below the Visualization Manager object |
visualization_targetsupport_transferfilestoplc |
1=The visualization files get transferred to the PLC |
visualization_targetsupport_webvisualization_client |
1=The runtime requires the Web-Visualization (client), that doesn’t need a visualization in the PLC (the Web-Visualization is completely calculated in the Web-Visualization applet). If this value is set to false, then the Web-Visualization is only interpreting paint command from the visualization running on the PLC. |
visualization_targetsupport_supportslocalvisualizationfiles |
1=File Transfer settings can be made in the Visualization Manager dialog in the programming system; Note: activated for CODESYS Control Win V3 and CODESYS Control RTE V3 ! 0=No File Transfer, settings available; default |
visualization_targetsupport_webvisualization_defaultupdaterate |
Update rate for newly inserted Webvisualization objects. Value is interpreted in milliseconds. Default is 200 |
visualization_targetsupport_targetvisualization_defaultupdaterate |
Update rate for newly inserted Targetvisualization objects. Value is interpreted in milliseconds. Default is 200 |
visualization_targetsupport_targetvisualization_supportskeyboard |
Information, if target has a keyboard, or if it is touch only. 1=target has keyboard, 0=target uses touch |
visualization_targetsupport_ActivatedVisualizationExtensions |
Possibility to activate a visualization extension by default. |
visualization_defaultstyle |
With this setting the default style can be set. |
Section “keyboardusage”, subsection of “visualization”:
Defines which keys and key modifiers are supported for the hotkey configuration in visualizations in CODESYS (if not available, see below “Standard Keys”).
XML Tag |
Description |
|---|---|
visualization_keyboardusage_availablemodifiers |
Defines exactly those key modifiers that are available on the device. The value must be a comma separated list of the generally available modifiers; possible values: “SHIFT”, “CTRL” and “ALT”. If this restricting setting is not available, all modifiers will be treated as if they were available. |
visualization_keyboardusage_basekeys |
Allows the usage of a predefined set of keys. If no basekeys setting is given, all available keys must be defined in the section “additionalkeys”. Possible values: “default”: the keys defined in table “Standard Keys” (see below) are available |
Section “additionalkeys”, sub-section of “keyboardusage”
Contains definitions of keys that are available for the keyboard usage in addition to the optional set of “basekeys”
XML Tag |
Description |
|---|---|
visualization_keyboardusage_additionalkeys |
Defines a newly available key; the name must be a valid canonical desired key name. Value = key code;
Example: ts:setting “EMERGENCY_STOP”; value: “300”
|
Section „notavailablekeys”, subsection of “keyboardusage”
Allows to remove some of the keys that are previously defined (probably using the “basekeys”) because they are not available on the current platform.
XML Tag |
Description |
|---|---|
visualization_keyboardusage_notavailablekeys |
Removes a key that was previously defined. The value of such a key is the canonical name of a previously defined key. Example: ts:setting <BACKSPACE> Removing keys, that are not defined, results in a “no-operation”. In fact, it does nothing at all. The value of this setting is ignored at the moment. |
If the device description contains no setting concerning key codes, this means that the following keys are supported by default:
Standard Keys:
Canonical Name |
Key Code |
Description |
|---|---|---|
‘A’ b’s ‘Z’ |
0x41-0x5A |
letter keys |
0 to 9 |
0x30-0x39 |
number keys |
NUM0 to NUM9 |
0x60-0x69 |
number keys in number pad |
F1 to F1 |
0x70-0x7B |
function keys |
BACKSPACE |
0x08 |
|
TAB |
0x09 |
|
RETURN |
0x0D |
|
PAUSE |
0x13 |
|
SPACE |
0x20 |
|
END |
0x23 |
|
HOME |
0x24 |
|
LEFT |
0x25 |
|
UP |
0x26 |
|
RIGHT |
0x27 |
|
DOWN |
0x28 |
|
0x2A |
||
INSERT |
0x2D |
|
DELETE |
0x2E |
|
MULTIPLY |
0x6A |
* |
ADDITION |
0x6B |
+ |
SUBTRACT |
0x6D |
- |
COMMA |
0x6E |
, |
DIVIDE |
0x6F |
/ |
An optional localization of the key names can be defined in a string table for namespace „keyboardusage”. See chap. 7.4.2 on localization strings.
See in the following a localization example for the keys EMERGENCY_STOP and MACHINE_STOPDOWN, which are assumed to be defined in the „additionalkeys” section (see above):
<Strings namespace="keyboardusage">
<Language lang="de">"
<String identifier="EMERGENCY_STOP">
NOT AUS
</String>
<String identifier="MACHINE_SHUTDOWN">
Maschine ausschalten
</String>
</Language>
<Language lang="fr">"
<String identifier="EMERGENCY_STOP">
Arrêt d'urgence
</String>
<String identifier="MACHINE_SHUTDOWN">
Eteindre la machine
</String>
</Language>
<Language lang="en">"
<String identifier="EMERGENCY_STOP">
Emergency Stop)
</String>
<String identifier="MACHINE_SHUTDOWN">
Shut down machine
</String>
</Language>
</Strings>
Section “TargetConstraints”, subsection of “visualization”:
The settings within this section define restrictions valid for all visualizations inserted in the device tree below the device. There are no restrictions for any visualizations in the POUs tree! If visualizations from the POUs tree, which are not matching the restrictions given by the device, are used, compile errors will be issued.
XML Tag |
Description |
|---|---|
visualization_TargetConstraints_TargetImageFormats |
“|”-separated list of supported image formats; Example: <ts:value>*.bmp|*.jpg</ts:value>
The image format “*.svg” is treated somehow specially. This image format must be specified here only when it is supported natively by the runtime system. Nevertheless, the programming system will allow the usage of SVG-Images always. If this format is not supported by the PLC, then these images will be converted automatically during download (normally such images will then be loaded as PNG). |
visualization_TargetConstraints_MaxNumOfVisualizations |
maximum number of visualizations which can be inserted below the device (type: int) |
visualization_TargetConstraints_MaxNumOfElementsPerVisualization |
maximum number of visualization elements within a visualization |
visualization_TargetConstraints_SupportGradientFill |
If this setting is available,”gradient fill” for colors will be supported by the device (note: currently available for Windows, Linux, not however WinCE). If the setting is missing, compile error messages will appear with visualization projects containing gradient fill definitions. |
visualization_TargetConstraints_TargetDisplaySize_height |
The height of the display size of the target, which is used in the offline visualization editor. |
visualization_TargetConstraints_TargetDisplaySize_width |
The width of the display size of the target, which is used in the offline visualization editor. |
visualization_TargetConstraints_TargetVisuLight |
If this setting is set the target visu light is generated for that device. The target visu light has not the full feature set but generates less code and less data for small visualizations. |
visualization_TargetConstraints_MaxNumOfPolygonPoints |
This setting limits the number of points which a polygon can have. |
visualization_TargetConstraints_MaxNumOfPolylinePoints |
This setting limits the number of points which a polyline can have. |
visualization_TargetConstraints_TargetVisualElementProperties |
If the target setting TargetVisuLight is set the properties for the TargetVisuLight elements can be restricted. Possible properties which can be restricted: "center-x"
"center-y"
"colors_normal_state_fill_color"
"colors_normal_state_frame_color"
"colors_alarm_state_fill_color"
"colors_alarm_state_frame_color"
"colors_color"
"colors_alarm_color"
"element-look-line-width"
"element-look-fill-attributes"
"element-look-line-style"
"text-properties-horizontal-alignment"
"text-properties-vertical-alignment"
"text-properties-font"
"texts-text"
"absolute-movement-x"
"absolute-movement-y"
"absolute-movement-rotation"
"absolute-movement-scaling"
"relative-movement-top-left-x"
"relative-movement-top-left-y"
"relative-movement-bottom-right-x"
"relative-movement-bottom-right-y"
"text-variables-text-variable"
"font_variables_flags"
"font_variables_color"
"color_variables_toggle_color"
"color_variables_normal_state_frame_color"
"color_variables_normal_state_fill_color"
"color_variables_alarm_state_frame_color"
"color_variables_alarm_state_fill_color"
"state_variables_invisible"
"absolute-movement-interior-rotation"
"dynamic-points-array-of-points"
"dynamic-points-number-of-points"
"show-frame"
"static-id"
"bitmap-id-variable"
"switch-frame-variable"
|
visualization_TargetConstraints_SupportedSVGProfile |
This setting allows to specify whether the device supports only the limited SVG-Profile “SVG-Tiny”. In this situation CODESYS will evaluate SVG images and convert them if necessary. At the moment only the values “Tiny” or “Full” are supported. Default value is “Full”. |
visualization_TargetConstraints_InteriorRotationElements |
This setting allows specifying for which elements the interior rotation of visualization elements is supported. The value is a string containing the canonical names of visualization elements separated by the pipe character ‘|’. The default for this setting is an empty string meaning no element supports this feature. Since runtime version 3.5.4, the interior rotation is supported for the following elements (already in the appropriate syntax) when the targetvisualization is based on GDIPlus (Windows, not CE) or Qt: Rectangle|Rounded Rectangle|Ellipse|Image |
visualization_TargetConstraints_SupportedBMPBitCounts |
All bmp images are converted to 24 bit bmp images if the image format color bit count is not in the list |
visualization_TargetConstraints_ImageFormatsToConvert |
All image formats in the list are converted to the bmp format 24 bit before they are downloaded to the device |
visualization_TargetConstraints_SupportButtonImagePosition |
If this setting is active, the image position in the button-element can be adjusted more detailed, also with style values. |
visualization_TargetConstraints_SupportSemiTransparentDrawing |
This setting is needed, if the device supports semi-transparent drawing. At moment, it is not supported on WinCE. With using this setting, it is possible to set a opacity value for the different colors in the visualization editor. |
Section “TargetFonts”, subsection of section “TargetConstraints”
Section “<fontname>”, subsection of section ” TargetFonts “
fontname: e.g. „Arial_CE” ;
Only the fonts defined here will be available in the configuration dialogs of a visualization element. This restriction might be reasonable if projects are created for usage in a Target-Visualization.
If this section is not available, the default font selection will be available.
If no font styles are specified, the style options in the font dialog will be disabled.
Section “TargetColors”, subsection of section “TargetConstraints”
These settings restrict the color selection within the configuration dialogs of a visualization element. This might be reasonable if projects are created for usage in a Target-Visualization. For each color an own setting must be entered. If no color restrictions are defined, the default color selection dialog will be provided.
XML Tag |
Description |
|---|---|
ts:setting “<color>” |
color=”Black”, “Green” etc.;
the value must specify the color id (type: uint);
Example:
<ts:setting name=”Black” example: type=”uint” access=”visible”>
<ts:value>0xff000000</ts:value>
</ts:setting>
|
Section “TargetVisualElements”, subsection of section “TargetConstraints”
These settings define which visualization elements are available in the visualization editor toolbox. Either you specify a “|”-separated list of „AvailableElements” or a list of „NotAvailableElements”.
If no list is specified, all elements will be supported.
XML Tag |
Description |
|---|---|
visualization_TargetConstraints_TargetVisualElements_AvailableElements resp. visualization_TargetConstraints_TargetVisualElements_NotAvailableElements |
“|”-separated list of elements which should be available resp. not available; possible values: element names as used in the visualization editor element toolbox; Example: <ts:value>Rectangle|Circle</ts:value> (type: string) |
Alarm manager¶
There are several settings to configure the alarm manager.
XML Tag |
Description |
|---|---|
alarmmanager_alarms |
Setting to enable / disable alarm manager |
alarmmanager_pagesize |
The page size in bytes of the sqlite alarm storage database |
alarmmanager_storage |
Enable / disable persistent storage of the alarms |
Trace¶
IEC-Trace:
In sub-section “Trace” of <ts:TargetSettings…> device-specific settings concerning the memory for the Trace Configuration, which is handled as a “sub-application” can be defined.
Note: This setting affect only the internal IEC-Trace!
XML Tag |
Description |
|---|---|
trace_max-area-size |
Integer defining the maximum size [bytes] of the memory area for the trace configuration |
Example:
<ts:section name="trace">
<ts:setting name="max-area-size" type="integer" access="visible">
<ts:value>10000</ts:value>
</ts:setting>
</ts:section>
TraceManager:
With V3.4.2.0 the new TraceManager is available. For this new feature, the new CmpTraceMgr component in the runtime system is necessary. To enable this TraceManager in CODESYS, the following setting is necessary:
XML Tag |
Description |
|---|---|
trace_tracemanager |
Bool value to enable (=true/1) the trace manager |
Example:
<ts:section name="trace">
<ts:setting name="tracemanager" type="boolean" access="visible">
<!–- With this option, the new tracemanager is activated in CODESYS. With this option, the CmpTraceMgr component is needed in the runtime system! -->
<ts:value>1</ts:value>
</ts:setting>
</ts:section>
Trend recording¶
There are several settings to configure the trend recording.
XML Tag |
Description |
|---|---|
trendrecording_disabled |
Setting to enable / disable trend recording |
trendrecording_limit |
Defines the default storage limit type |
trendrecording_limitvalue |
Default value for the limit to use according to the currently selected limit type |
trendrecording_maxnumofrecords |
Default value for the trend configuration ‘Max. number of records’ |
trendrecording_pagesize |
The page size in bytes of the sqlite trend storage database |
trendrecording_storeeverynmillis |
Default value for the trend configuration ‘Store every N milliseconds’ |
Network variables¶
Network variables can be used for data exchange between two or several PLCs, currently possible for UDP networks. The values of the variables are exchanged automatically via broadcast telegrams. These services are not confirmed by the protocol, which means that it is not checked, whether a message is received by the addressee. The exchange of network variables is a 1 (sender) to n (recipients) – connection. Network Variables must be defined in fix variables lists as well in the sender as in the receiver devices and their values will be transmitted via broadcasting.
In sub-section “networkvariables” of <ts:TargetSettings…> the following settings concerning the support of this functionality can be defined:
Example:
<ts:section name="networkvariables">
<ts:section name="protocols">
<ts:setting name="numofprotocols" type="integer" access="visible">
<ts:value>1</ts:value>
</ts:setting>
<ts:section name="protocol1">
<ts:setting name="protocolname" type="string" access="visible">
<ts:value>UDP</ts:value>
</ts:setting>
<ts:setting name="library" type="string" access="visible">
<ts:value>NetVarUdp</ts:value>
</ts:setting>
<ts:setting name="libraryversion" type="string" access="visible">
<ts:value>\*</ts:value>
</ts:setting>
<ts:setting name="packetsize" type="integer" access="visible">
<ts:value>256</ts:value>
</ts:setting>
<ts:setting name="max-num-sender" type="integer" access="visible">
<ts:value>2</ts:value>
</ts:setting>
<ts:setting name="max-num-receiver" type="integer" access="visible">
<ts:value>2</ts:value>
</ts:setting>
<ts:setting name="max-gvl-size" type="integer" access="visible">
<ts:value>5</ts:value>
</ts:setting>
<ts:setting name="min-interval" type="string" access="visible">
<ts:value>T#50ms</ts:value>
</ts:setting>
<ts:setting name="max-interval" type="string" access="visible">
<ts:value>T#100ms</ts:value>
</ts:setting>
</ts:section>
</ts:section>
</ts:section>
XML Tag |
Description |
|---|---|
networkvariables |
Network Variables section |
networkvariables_protocols |
Network Protocols section |
networkvariables_numofprotocols |
Number of supported protocols (currently 1, because only UDP is supported) |
networkvariables_protocol |
Protocol section |
networkvariables_protocolname |
Name of the protocol |
networkvariables_library |
Name of needed library (must be installed) |
networkvariables_libraryversion |
Version of above specified library Note: This must not be set to a fix version, but for the newest (-> it must be set to “*”). All other settings may lead to problems with the current project. |
networkvariables_packetsize |
Size of packets of the resp. protocol (UDP: 256) |
networkvariables_max-num-sender |
Maximal number of GVLs of an application that can be send |
networkvariables_max-num-receiver |
Maximal number of GVLs of an application that can be received |
networkvariables_max-gvl-size |
Maximal number of bytes that can be send with one network variable list (limits the number of variables) |
networkvariables_min-interval |
The minimum transmission time that can be configured |
networkvariables_max-interval |
The maximum transmission time that ca be configured |
Dataserver¶
In sub-section “dataserver” of <ts:TargetSettings…> device specific settings affecting the behavior of the dataserver can be defined.
XML Tag |
Description |
|---|---|
dataserver_supportedbydevice |
Boolean 0 = Dataserver is not supported as subobject of applications on this device. 1 = Dataserver is supported as subobject of applications on this device [Default] |
dataserver_protocolsupport |
String This value specifies the communications protocols that a dataserver plc can use to communication with a plc of the current type. The value is a comma separated list of protocol identifiers (currently 3S_Symbolic and 3S_Addresses are supported). If no dataserver connection is supported at all, specify “none”. If this setting is not available or yields an empty value, then all protocols are supported. |
dataserver_defaultstdplccommunicationtype |
Integer This value specifies the default communication type used by newly inserted data sources. At the moment the following values are supported: 0 -> explicitly assigned CODESYS device address 1 -> explicitly configured network scan 2 -> automatic configuration of the device address 3 -> automatic configuration of the network scan [Default] |

