6 - The Ressources
6.6.10 Configuration of DeviceNet Modules...
CoDeSys supports a hardware configuration for a bus system, which is using the internationally
standardized DeviceNet protocol (EN50325). DeviceNet mainly is used to realize Master-Slave
networks having Plug & Play properties, thus having a bus for direct connection to sensors and
actuators (proximity switches, outlets).
The DeviceNet communication protocol bases on CAN (Controller Area Network). A direct connection
between the communing modules is a precondition for the data exchange.
The CoDeSys DeviceNet configuration editor provides for the definition of a DeviceNet-Master which
will control the data exchange within the network. Various communication types are supported for the
exchange of the in- and output data between the slave modules (DeviceNet-Slave) ,. Usually the
DeviceNet-Master takes the "UCMM"-function (Unconnected Message Manager for multiple
connections) and takes care of requests from other masters to its slaves.
A configuration file *.cfg allowing the insertion of DeviceNet-Master and Slave modules is a
precondition for doing a DeviceNet configuration in the CoDeSys PLC Configuration. The
configuration file automatically is searched in the currently set directory for configuration files (see
Chapter 4.2, Project Options: Directories).
According to the definitions in the configuration file *.cfg the EDS files) (Device description files,
Electronic Data Sheet), which are also found in the currently set configuration files directory, can be
used for the configuration. In the EDS file the configuration options of a DeviceNet module are
described. Regard that CAN device description files also have the extension ".EDS", but are not
usable for a DeviceNet configuration!
Generally regard the possibility of adding configuration files during working on the project (see
Chapter 6.6.2., Add configuration file).
If a DeviceNet-Master is selected in the configuration tree, the following dialogs are available on
appropriately named tabs: Base parameters, DeviceNet Parameters, Module parameters.
If a DeviceNet-Slave is selected which is inserted below a DeviceNet-Master, the following dialogs will
be available: Base parameters, DeviceNet parameters, I/O connection configuration, Parameters,
Base parameters of a DeviceNet-Master
The , Base parameters dialog of a DeviceNet-Master referring to the items Module id, Node number,
Input address, Output address and Diagnosis address matches that of the other modules (see
'Chapter 6.6.5, Base parameters of an I/O Module).
DeviceNet Parameters of a DeviceNet-Master
DeviceNet Parameters Dialog for a DeviceNet-Master
In field Address insert the DeviceNet-Master identification number, which is set at the module itself.
The meaning of this ID corresponds to that of the "Node-ID" of a CAN module and must not be mixed
up with the Node number, or the Address defined in the Base parameters dialog!. It must be entered
decimal, possible values: 0-63, default setting:0.
Also the Baudrate [Baud] for the data exchange within the network is defined here. Choose one of
following settings: 125000 (default), 250000, 500000.
Module Parameters of a DeviceNet-Master
The module parameters dialog of a DeviceNet-Master is the same as that for the other modules (see
Chapter 6.6.5, Module parameters of an I/O Module). The parameters which have been additionally
assigned to the master in the configuration file, are displayed here and usually the values can be
Base parameters of a DeviceNet-Slave
The base parameters dialog of a DeviceNet-Slave referring to the items Input address and Output
address matches that of the other modules (see Chapter 6.6.5, Base parameters of an I/O Module).
The direction (input or output) is defined from view of the module.
DeviceNet Parameters of a DeviceNet-Slave
Here the common parameters of the module are configured:
Address: Identification of the DeviceNet-Slave, set at the module itself. The meaning of this ID
corresponds to that of the "Node-ID" of a CAN module and must not be mixed up with the 'Node
number, or the "Address" defined in the Base parameters dialog!). It must be entered decimal,
possible values: 0-63, default setting:0.
Device active in configuration: Activate this option in order to make the device an active participant
concerning the data exchange in the network.
Info...: This button opens a window displaying the content of the EDS file. Please regard, that CAN
device description files also have the extension ".EDS", but are not usable for a DeviceNet
DeviceNet Parameters Dialog for a DeviceNet-Slave
Expert...: This button opens the dialog Extended settings, where the following settings can be
UCMM: (Unconnected Message Manager for multiple connections) If this option is activated
(default), the slave is able to handle UCMM messages. The possible classifications: Group1,
Group2 or Group3 (default)
The following checks will be done per default at the Start of the network and may be
deactivated here, if necessary. During the check always the value given by the EDS file will be
compared to that found at the device: Check vendor id, Check device type, Check product
code, Check product version
6 - The Ressources
Dialog Extended settings
I/O connection configuration of a DeviceNet-Slave
Here you configure the inputs and outputs of the slave, via which the data (parameter values) should
be exchanged. A connection type is to be defined and a selection of inputs and outputs is to be
composed according to the possibilities given by the module (EDS file, Inputs, Outputs).
Dialog for I/O connection configuration of a DeviceNet Slave
Selected I/O connection: Select one of the following connection types, which should be valid for the
I/O connection defined below:
Poll: The data of the slave will be polled cyclically (Master-Slave-process)
Bit Strobe: The DeviceNet-Master sends a broadcast telegram to all slaves requesting them to
send the current data. The slaves will answer one after the other, starting with node 1.
Change of State: The slave will send its data to the master at each change detected at an
input. No explicit request by the master is needed.
Cyclic: The slave will send its data after a defined cycle time without an explicit request by the
master (Heartbeat" function).
Multicast Poll: currently not supported
: Here the sums of Inputbytes and Outputbytes, currently used for all configured inputs
and outputs, will be displayed. The sums are calculated from the lengths defined for the I/Os in the
'Inputs' and 'Output' areas of the dialog.
Extended: This button opens the dialog More settings, which allows to modify the following default
settings for the currently chosen connection type:
Expected Packet Rate: Default: 75, expected rate (in milliseconds) according to which the
slave is expected to send its data over the current connection.
Fragmentation timeout: [ms]: Default 1600 ms; If the data to be sent are exceeding a size of
8 Bytes, they must be fragmented and send in several telegram packages. The fragmentation
timeout defines in milliseconds, how long the master should wait for an answer of the slave on a
fragmented telegram, before triggering the action defined in 'Action on timeout error'.
Dialog 'More settings', Example for connection type 'Cyclic'
Action on timeout error: Define, which of the following actions should be started in case of a
Transition to timed out: (Default) This action is defined slave-specifically.
Auto delete: The I/O connection will be deleted.
Auto reset: The connection persists, the master re-configures the slave, the watchdog is
Further options for connection type 'Change of state':
Lock time for sending: (Default:1) Minimum interval (in milliseconds) between two messages,
even if data have changed before this time span is over. This method helps to avoid
overloading the device with incoming requests. "0" means no lock time, in this case the data will
be exchanged as fast as possible.
Timeout[ms]: (Default: 16) If the heartbeat rate has been exceeded by this time span (in
milliseconds) without data having been sent, a timeout error will be detected.
6 - The Ressources
Heartbeatrate[ms]: (Default: 250) Time span in milliseconds, after which the slave in any case
must send its data, even if they have not changed.
Further options for connection type 'Bit Strobe':
Use output bit: When answering to the master, the slave will use that output bit, which
corresponds to the output bit used by the master in the request telegram.
Further options for connection type Cyclic':
Interval [ms]: Time interval in milliseconds, according to which the slaves automatically has to
send its data (Heartbeat).
Timeout [ms]: If the heartbeat rate has been exceeded by this time span (in milliseconds)
without data having been sent, a timeout error will be detected.
From field Available connections select the desired inputs and transfer them to field Configured
input connections by button >> . By button << you can remove entries from there.
In order to modify the length of a configured input, perform a double-click on this entry. The dialog
Length of connection will open. Enter here the desired Length in Bytes and confirm with OK. The
length thereupon will be displayed in brackets behind the configured input.
Configured inputs will be visible immediately in the configuration tree. Indented below the slave entry
there will be an entry with the name of the connection type. Below that the respective inputs and
outputs will be inserted.
Configure the outputs like described for the inputs.
Parameters of a DeviceNet-Slave
The parameters listed here are given by the EDS file. According to the defined I/O connection
configuration their current values will be exchanged in the network.
Obj.: Identification of the parameter (object), which is used to access the parameter in a parameter list
(object dictionary). This object number is created from the parameter number given by the
corresponding parameter description in the EDS file (section [Params], "Param<number>").
Typ: Data type of the parameter
Acc.: Access rights: rw=read and write, ro=read only
Min., Max.: Value range of the parameter, limited by the minimum and maximum value
Default: Default value of the parameter
Value: As it is defined in the EDS file, the parameter value might be edited here. Either a selection list
of permissible values is available or an edit field can be opened by a mouse-click on the table cell.
Module parameters of a DeviceNet-Slave
The module parameters dialog of a DeviceNet-Slave is the same as that for the other modules (see
Chapter 6.6.5, Module parameters of an I/O Module): The parameters which have been additionally
assigned to the master in the configuration file, are displayed here and as a default the values can be
6.6.11 PLC Configuration in Online Mode
In online mode the PLC configuration displays the states of the inputs and outputs of the PLC. If a
boolean input or output has the value TRUE, the little box at the beginning of the entry line in the
configuration tree will get blue, non-boolean values will be added at the end of the entry line (e.g.
The boolean inputs can be toggled by mouse-clicks. At other inputs a mouse-click on the beginning of
the line opens a dialog, where the value can be modified. The modified value will be set in the PLC as
soon as the dialog is closed with OK.
Also regard the target specific possibilities for online diagnosis.
6.6.12 Hardware scan/State/Diagnosis information from the PLC
If supported by the target system and the actual configuration file (*.cfg), information on the structure,
the status and diagnosis results of the currently connected hardware can be get from the PLC and
displayed in the PLC Configuration in CoDeSys:
Scan module configuration
If supported by the target system and the actual configuration file (*.cfg), the command Scan module
configuration will be available in the context menu for the module which is currently selected in the
PLC Configuration tree.
This command is only available in offline mode. If it is activated, the actual hardware configuration of
the particular module on the PLC will be scanned and automatically be offered for inserting in the
configuration tree of the CoDeSys PLC Configuration. Thus the existing module configuration can
easily be mapped in CoDeSys.
Load module state
If supported by the target system and the actual configuration file (*.cfg), the command Load module
state will be available in the context menu for the module which is currently selected in the PLC
This command is only available in online mode. If it is activated, the actual status of the module will be
read from the PLC and get displayed by a special color in the configuration tree:
Black: Module existing and parameterized correctly.
Blue: Module existing but parameterized incorrectly.
Red: Module not found.
An update of the status display also automatically will be done at each download.
Show diagnosis messages
If supported by the target system and the actual configuration file (*.cfg), the command Show
diagnosis messages will be available in the context menu for the module which is currently selected
in the PLC Configuration tree. This command is only available in online mode. If it is activated, actual
diagnosis messages for the module coming from the PLC will be displayed in a CoDeSys window.
Documents you may be interested
Documents you may be interested