Device Tree and Device Editor

Device tree

In the Devices view (also called the device tree), you organize applications according to target device. In this view, you can see the PLC hardware and fieldbus systems, configure the hardware communication, and assign applications.

The root node of the device tree is a symbolic node entry: <project name>.

You insert device objects below this node for one or more PLCs, also referred to as target systems. Each device object represents a specific hardware component, for example a PLC, fieldbus node, bus coupler, drive, I/O module, or monitor.

When you add objects, an add assistant helps you by offering all possible devices from your local device repository.

If you are already connected to a controller network, then you can scan the hardware for available devices and save them to the device tree in the current configuration.

For creating device objects in the device tree (mapping to the controlling hardware environment), specific rules apply (see below). The hierarchical layout of application objects and device objects defined the scope of other objects, such as libraries and GVLs.

There are programmable devices and parameterizable devices. The device type defines the possible insertion point in the device tree and the selection of objects that you can insert below the device. Programmable devices automatically get an additional node PLC logic node below the device object, which is merely for organizational purposes. Below this node, you insert the objects that are required for programming the device (this means the application(s) and GVLs or text lists, for example). An alternative to this concept is the use of a device application if the device supports this functionality. A device application combines the global data for all applications of a controller so that the applications can focus exclusively on control tasks.

Each device is defined by a device description and must be installed on the local system in order to be inserted into the device tree. The device description file defines the device properties for configurability, programmability, and possible connections to other devices.

Note

The POUs view includes objects that can be used throughout the project. Programming objects that are intended for a specific application must be inserted below the application object in the Devices view (device tree).

Please note the option of letting the active application run on a simulated device, which is provided by default within the development system. Currently, this simulation option is available for the CODESYS Control Win V3 target system. In simulation mode, you can also test the online functionality of the application without hardware. Activate the simulation mode by clicking Online ‣ Simulation .

Please note the option of establishing a connection to the device by means of the Online configuration mode command for an application, without having to load the application beforehand. This is useful for the initial commissioning of an I/O system because you can reference and test the I/Os with it in the PLC configuration, before you have programmed and downloaded the actual application.

Example of a device tree:

A device entry in the device tree consists of a symbol, the symbolic device name that can be edited in the tree, and the device type (device name as defined in the device description).

You configure device communication, parameters, and IO mappings in the device editor dialogs. Open this editor by double-clicking the device object.

See also

Rules and Procedures for Arranging and Configuring Objects in the Device Tree

  • Insert objects: To insert a device object, click Add device or Insert device by right-clicking in the device tree. For other objects, click Add object. CODESYS always offers the appropriate objects at the currently selected position in the tree. Example: Modules for a PROFIBUS DP slave can be inserted only below a respective slave object, and applications inserted only below programmable devices. The selection of device objects also depends on which devices are installed in the device repository.

  • On the level directly below the root node <project name>: You can insert device objects only. If you select another object type, such as a text list, then CODESYS inserts this into the POUs view (project-global pool) automatically.

  • Insert applications: A distinction is made here between the usual device tree structure with a PLC logic node and the use of a Device application. The following applies for the usual structure (for the device application, refer to the that section of the help):

    You can insert an Application object only below a PLC logic node (a programmable device). All applications must be named uniquely for each device. Below each application, you can insert more objects that are required for programming, such as POUs, DUTs, GVLs, and visualizations.

    Below each application, you must insert a task configuration and configure the respective program calls (application-specific POUs, or POU instances from the POU view).

    If multiple applications are located directly below a device, then you must define settings for the I/O handling of the device. This includes the variables the application that CODESYS should use for communication with the target system. The settings are made in the PLC settings tab of the device editor.

    Hierarchical arrangement of applications, scopes: You can also insert an application below another application – a construct we refer to as “Parent application” - “Child application”. In this case, the following applies: The child application can access objects in the parent application, but not the other direction. The reason for this is that a child application should always be removable or exchangeable without affecting the parent application.

    NOTICE: After the parent application has been changed, the PLC removes a child application when an online change is performed.

  • Insert devices: CODESYS inserts a device object in the tree as a node. If nodes are defined in the device description, then they are inserted automatically. A subnode can also represent a programmable device. Order of device objects in the tree (from top to bottom): For each level, the programmable devices (PLC Logic) are listed first and then the other types in alphabetical order.

  • Update devices: A device that has been inserted into the device tree can be replaced by another version of the same device or by a device of another type (Update devices). A configuration tree below the device is available when possible.

  • Moving and deleting objects: You can use the standard commands Cut, Copy, Paste, and Delete on objects, or drag an object to another position. When you copy objects, the new object gets the same name with an incremented number.

  • Network scan of the current hardware: By default, creating the PLC configuration in the device tree is supported by the device editors with scan functionality. The current hardware environment is scanned and the detected modules are displayed in a dialog. From there, you can save the required device directly to the device tree. Refer to the Scan Devices command.

See also

Device Tree in Online Mode

In online mode, a symbol before a device entry indicates the device status:

: The PLC is connected, the application is running, the device is in operation, and data is being exchanged. The Refresh I/Os in stop check box in the PLC settings tab can be selected or cleared.

: The PLC is connected and in STOP; and the Refresh I/Os in stop check box in the PLC settings tab is cleared.

: The PLC is connected and the application is running. Diagnostic information is available.

: The device is in preoperative mode and is not running yet. Diagnostic information is available.

: The device is not exchanging data; bus error, no configuration, or simulation mode.

: The device is running in demo mode for 30 minutes. When this time has elapsed, demo mode will expire and the fieldbus will end the data exchange.

: The device is configured, but not fully operational. No data is exchanged. Example case: CANopen devices when booting and in preoperative mode.

: Redundancy mode is active. The fieldbus master is not sending any data because another master is active.

: The device description could not be found in the device repository.

The names of all connected devices and applications are highlighted in green

The names of devices that are running in simulation mode are displayed in italics:

Additional diagnostic information is found in the Status tab of the respective device editor.

Note

If you login while the device description on the target device is more recent than in the project, then a warning prompt opens with the possibility to cancel the process.

See also

Device editor

You can configure the settings for communication between CODESYS and the target device in the tabs of the device editor. Double-click the device object in the device tree to open the editor. The editor includes generic as well as specific tabs. Its title contains the device name.

See also