Tab ‘PLC settings’

On this tab of the generic device editor you make the basic settings for the configuration of the PLC, for example the handling of inputs and outputs and the bus cycle task.

Application for I/O handling Application that is responsible for the I/O handling.
PLC settings
Refresh I/Os in stop

: CODESYS refreshes the values of the input and output channels even if the PLC is in the stop state. If the watchdog detects a malfunction, the outputs are set to the predefined default values.

: CODESYS does not refresh the values of the input and output channels when the PLC is in the stop state.

Behavior of the outputs at stop

Handling of the output channels when the controller enters the stop state:

  • Retain values: The current values are retained.
  • All outputs to default value: The default values resulting from the I/O mapping are assigned.
  • Execute program: You can control the handling of the output values via a program contained in the project, which CODESYS executes at “STOP”. Enter the name of the program in the field on the right.
Always update variables

Global setting that defines whether or not CODESYS updates the I/O variables in the bus cycle task. This setting is effective for I/O variables of the slaves and modules only if ‘deactivated’ is defined in their update settings.

  • Deactivated (update only if used in a task): CODESYS updates the I/O variables only if they are used in a task.
  • Activates 1 (use bus cycle task if not used in another task): CODESYS updates the I/O variables in the bus cycle task if they are not used in any other task.
  • Activate 2 (always in bus cycle task): CODESYS updates all variables in each cycle of the bus cycle task, regardless of whether they are used and whether they are mapped to an input or output channel.
Bus cycle options
Bus cycle task

Task that controls the bus cycle. By default the task defined by the device description is entered.

By default the bus cycle setting of the superordinate bus device (use cycle settings of the superordinate bus) applies, i.e. the device tree is scanned upwards for the next valid bus cycle task definition.

Pay strict attention to the following notes!

Hint

Before you select the <unspecified> setting for the bus cycle task, you should be aware that “<unspecified>” means that the default setting given in the device description goes into effects. You should therefore check this description. Use of the task with the shortest cycle time may be defined as the default there, but use of the task with the longest cycle time could equally well be defined!

Hint

For fieldbuses, a fixed cycle matrix is necessary to assure a determined behavior. Therefore, do not use the type ‘free-running’ for a bus cycle task.

Additional settings
Force variables for the I/O mapping

This setting is available only if it is supported by the device.

: When compiling the application CODESYS creates two global variables for each I/O channel that is mapped to a variable in the dialog I/O mapping. You can use these variables for the forcing of the input or output value on this channel, for example via an HMI visualization.

Activate diagnostics for devices

: CODESYS automatically integrates the library CAA Device Diagnosis in the project and creates an implicit function block for each device. If there is already a function block for the device, then either an extended FB is used (for example with EtherCAT) or a further FB instance is added. This then contains a general implementation of the device diagnostics.

By means of the FB instances you can determine the status of all devices in the application and evaluate errors. In addition, the library contains functions for the programmatic editing of the device tree. Example: Scanning of all children of a bus system, jumping to the parent element.

Display I/O warnings as errors Warnings concerning the I/O configuration are displayed as errors.

See also