Internal PLC (CODESYS) : User Manual
Internal PLC (CODESYS) : User Manual
User Manual
© 2009-2017 Exor International S.p.A.
The information contained in this document is provided for informational purposes only.
While efforts were made to verify the accuracy of the information contained in this
documentation, it is provided 'as is' without warranty of any kind.
Third-party brands and names are the property of their respective owners.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 1
Internal PLC (CODESYS V3)
Note: For detailed information regarding the use of CODESYS V3 communication protocol in Internal PLC
(CODESYS) related to the communication with CODESYS V3 PLC Runtime please refer to the specific
CODESYS V3 communication protocol chapter of Internal PLC (CODESYS) help.
Note: This manual is not intended as CODESYS V3 programming manual, for detailed documentation regarding
CODESYS V3 Development System please refer to the CODESYS web site www.codesys.com and to and to
its on-line help.
HMI products shown in table below have been designed to include the CODESYS V3 PLC Runtime.
Communication Stacks
*1 = 600 MHz CPU HMIs (UN31) support only 1 CAN interface. 1 GHz CPU HMIs (UN30) support up to 2 CAN interfaces.
*2 = Support up to 2 CAN interfaces.
*3 = eX705 and eXware support only 1 CAN interface. All other HMIs support up to 2 CAN interfaces.
CODESYS V3 Runtime is automatically transferred to the HMI by Internal PLC (CODESYS) as part of HMI Runtime and it
is running with the support of the HMI operating system.
CODESYS V3 Development System is required to develop and debug PLC applications and transfer them to Exor HMI.
2 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
CODESYS V3 Runtime requires a license activation to be used. CODESYS V3 license is activated by Internal PLC
(CODESYS), the license code is uniquely matched with the HMI MAC-ID.
System Configuration
HMI and PLC based on Internal PLC (CODESYS) and CODESYS V3 can be applied in different configurations.
Note: Refer to table above to know which optional plugins and fieldbusses are available for your hardware
configuration
Note: Communication capabilities over Serial network are limited by the amount of serial interfaces available,
each serial interface supports a single communication protocol. Specific optional add-on serial interface modules
are available to increment the amount of serial interfaces at disposal.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 3
Internal PLC (CODESYS V3)
Note: The HMI internal PLC is compatible with CODESYS V3.5 Development System only.
CODESYS V2.3 Development System is NOT compatible with CODESYS V3 Runtime.
Note: It is strongly recommended to install CODESYS V3 Development System version 3.5.7 patch 5 for
programming Exor HMIs.
If a newer version of CODESYS V3 Development System is already installed, make sure to use 3.5.7 versions
of libraries and fieldbus to program Exor HMIs.
Timer resolution
The resolution of CODESYS V3 timers is 1 millisecond. When a timer value is defined it is internally translated to the
corresponding number of milliseconds.
The resolution of the internal Real Time Clock is 1 millisecond allowing the maximum resolution of timers. Note that the
execution time of the PLC program may apparently affect the resolution of timers.
Getting Started
This chapter provides the necessary information on how to set-up the HMI + CODESYS PLC system.
The required operations are listed below and explained in the forthcoming chapters.
The software can be downloaded from EXOR websites under Support -> JMobile -> Documents and Download section.
4 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Exor CODESYS Package is included into Internal PLC (CODESYS) since version 1.91 SP1 under “\CODESYS\V3\”
folder.
The package can be also downloaded from EXOR websites under Support -> JMobile -> Documents and Download
section.
To install the package double click on .package file. The installation procedure will start automatically, the system asks if
to perform a Complete or Typical setup, any of these will install all the required files for a complete support of the
CODESYS V3 PLC Runtime features.
The Package Manager dialog is visible in the following figure, showing the installed Package.
Note: CODESYS Development System includes a tool called “Package Manager” for the installation of the
CODESYS Package.
Package Manager tool can be launched from CODESYS Tools menu, selecting the proper menu item. This tool
can be used both for checking the installed Packages and for installing new ones.
To install the Exor CODESYS Package launch Package Manager and click on “Install” button. Browse for the
file with .package extension, confirming with “Open”.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 5
Internal PLC (CODESYS V3)
When a new version of Package is released Exor always tries to guarantee the complete compatibility with the previous
versions.
If the new Package is not fully compatible with the previous version some changes to adapt the PLC application to the new
Package may be required.
The Package update procedure is identical to the first installation of the CODESYS Package, please refer to the proper
chapter for specific information.
Note: CODESYS V3 keeps the older Package versions instead of replacing them in order to have all the
installed Packages at disposal if required.
As the CODESYS PLC Runtime is part of the HMI Runtime it is necessary to install the HMI Runtime on the HMI to have
the PLC Runtime running.
For further information on installing the HMI Runtime, please refer to Internal PLC (CODESYS) User's Manual.
CODESYS V3 PLC Runtime license is activated on the HMI through an Ethernet connection using Internal PLC
(CODESYS), each license code can be used on a single HMI, once activated the license is uniquely matched with the Mac
Address of the HMI.
Note: The CODESYS V3 license activation procedure requires an active internet connection on the PC.
6 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Note: CODESYS V3 licenses, once activated cannot be paired with a different device or de-activated.
In case it is necessary to make sure whether a license has been activated on an HMI it is possible to verify the system log
of the HMI.
From the context menu on the HMI select the option “Log at boot”, and then reboot the HMI. On restart the Log window will
be displayed on screen, if a valid CODESYS V3 license is found from the system the string “CODESYS Module:
CODESYS V3 license found: CODESYS V3 is running” will be present among the HMI boot logging information.
To create a new CODESYS V3 project select File > New Project or click on the icon from the upper tools bar.
Select the “Standard project” template, define then Project Name and Location, then confirm with OK.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 7
Internal PLC (CODESYS V3)
In the next window select the Device and the programming language to use, as shown in picture below.
8 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Download PLC application
The selection of the PLC where to download the project must be done from Device communication settings tab before
proceeding with the download operation.
Double click on “Device (<device_name>)” in the project tree to display the Device properties in the work area.
A green dot over the device graphical representation informs that the device is correctly recognized and available into the
network.
Note: Communication with the available devices is established through a Gateway, a default Gateway is
available, and it is generally not needed to change the standard Gateway settings. For more information about
the Gateway set-up please refer to CODESYS V3 documentation.
If PLC IP Address is unknown, select the “Communication Settings” tab then click on the “Scan Network…” button.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 9
Internal PLC (CODESYS V3)
The Select Device dialog will be displayed. This dialog lists all the compatible devices available in the network. Select from
the list the HMI to be programmed then press on “OK”.
In case more HMIs using CODESYS V3 PLC Runtime are present into the network each HMI is recognized by a different
string between square brackets reported after Device name.
In the next figure the string is “0000.29D8”, the last part of the string “29D8” corresponds to the last 2 bytes of the HMI IP
Address in Hex format so, in this case, the corresponding HMI is the one with IP address xxx.xxx.41.216 as 29Hex
corresponds to 41Dec and D8 Hex corresponds to 216 Dec.
To upload a PLC project from the HMI, select the Source upload command from the File menu, as shown in the following
figure, then select the HMI from Select Device window.
10 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Symbol File configuration with CODESYS V3 Development System
When creating the project using CODESYS V3, properly configure the symbol file to contain the required variables.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 11
Internal PLC (CODESYS V3)
1. To add the Symbol configuration in CODESYS V3 project, right click on the Application item from the project tree,
then into the context menu select Add Object > Symbol configuration. The symbol configuration item will be added
to the project tree.
3. Symbol configuration item contains a list of all the variables available into the CODESYS V3 project, single
variables or groups of variables can be selected by checking the corresponding item in the list.
4. After the symbols have been configured, download the project or use the Generate code function (Build > Generate
code) to create an .xml file containing all the variables read to be imported in the Tag Editor.
12 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Note: GVL global variables are listed in Symbols Configuration only if they are used in PLC program.
To always list global variables right click on GVL and select "Properties". From "Build" tab check "Link Always"
option.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 13
Internal PLC (CODESYS V3)
Additional information regarding CODESYS V3 ETH driver are available in Internal PLC (CODESYS) Help >
Communication Drivers section.
Select the driver in Tag Editor and click on the Import Tags button to start the importer.
14 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
The following dialog shows which importer type can be selected.
Note: Additional information regarding CODESYS V3 ETH Tag import are available inInternal PLC (CODESYS)
Help > Communication Drivers section.
CODESYS V3 Development System generates a new version of the “.xml” file each time the PLC project is built.
CODESYS V3 ETH communication driver supports automatic symbol file (SDB) upload from the PLC; the HMI can upload
the symbol table from the PLC using the communication protocol.
Any change in the tag offset information due to a new compilation of the PLC program does not require importing again the
symbol file.
Memory Layout
The table below shows detailed information about maximum allowed size of CODESYS V3 project.
Retain 16 KB
Persistent 16 KB
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 15
Internal PLC (CODESYS V3)
Communication Diagnostic
HMI Runtime reports communication diagnostic information also for the communication with the internal PLC Runtime. To
display communication diagnostic information use the proper System Variables or the System Logger. For further
information please refer to Internal PLC (CODESYS) Help.
Note: Refer to table in "Control Solution with HMI and CODESYS V3" chapter, under "Optional Plugins" column
to know if your HMI support optional modules.
The steps to follow for the installation of the optional module are shown in the next figure and are the following:
Note: Do not plug or remove optional modules when the HMI device is powered.
16 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Slot Numbers
The following picture shows numbering of Slots in HMIs.
Note: Slot #4 is located on the top of the option module plugged into Slot #3.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 17
Internal PLC (CODESYS V3)
To add an I/O optional module, right click on Device (<device_name>) in Project tree and select “Add Device”.
I/O optional modules are located under the Miscellaneous category.
Choose I/O optional module and click on “Add Device” to add it to the current PLC configuration.
18 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
The parameters of all I/O optional modules are collected in single tab of the PLC Configuration tree.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 19
Internal PLC (CODESYS V3)
Option Description
Enabled 1 I/O variables are always updated by using bus cycle task if not used in any task
Enabled 2 I/O variables are always updated by using bus cycle task
The above option will be inherited by a specific I/O item if "Always update variables" option is set as "Use parent device
setting", from I/O Mapping tab.
20 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
IOBrdCfg Function Block
Integrated I/O boards can be configured at design-time from the I/O specific configuration page.
The I/O board configuration can be modified also in runtime, to do this use the IOBrdCfg function block.
This function block is included in I/O module library and has the following input parameters:
Element Description
diFctCode This parameter is passed to the I/O board; it significance changes from board to board.
diArg This parameter is passed to the I/O board; its significance varies from board to board.
Element Description
IOBrdCfg This is the return value; its significance varies from board to board and from FunctionCode to
FunctionCode.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 21
Internal PLC (CODESYS V3)
Note: The available parameters are described in the specific I/O module chapter.
l When no specific Mapping Variable is specified the system automatically assigns a physical address to each I/O
point.
l A new Variable can be created by double clicking on the icon of the corresponding I/O point and writing the
Variable name in the editing box. Such mapped I/O are marked with symbol.
l An existing variable created in the project can be assigned to the I/O point, by double clicking on the icon of the
corresponding I/O point and selecting then the Variable from the list of available by clicking on the button. Such
mapped I/O are marked with symbol. Using this method the I/O point will not refer anymore to the Physical
address assigned by default from the system.
PLIO03
PLIO03 is a multifunction I/O module.
Thanks to the high level of integration and configurability, PLIO03 offers a “one-board solution” for most typical I/O
configurations in simple applications.
The next figure shows a configuration for HMIs, using a communication module and PLIO03 module.
22 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
After including the PLIO03 module in the PLC configuration, as shown in the following figure, each I/O type of the module
can be configured separately.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 23
Internal PLC (CODESYS V3)
Option Description
Enabled 1 I/O variables are always updated by using bus cycle task if not used in any task
Enabled 2 I/O variables are always updated by using bus cycle task
The above option will be inherited by a specific I/O item if "Always update variables" option is set as "Use parent device
setting", from I/O Mapping tab.
The Mapping configuration of the PLIO03 Digital Inputs is displayed in the Work area by selecting the Digital Inputs I/O
Mapping tab after a double click on PLIO03 > Digital Inputs in the project tree.
Debounce time parameter of the PLIO03 Digital Inputs can be set from Digital Inputs Parameters tab.
24 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Counter/Encoder Inputs
PLIO03 includes 2 programmable Counter/Encoder channels.
Each Counter/Encoder channel is associated to a group of 4 digital inputs. When a channel is enabled, the associated
digital inputs cannot be used as normal inputs. In case all the 2 Counter/Encoder channels are enabled 12 digital inputs are
still available for normal operation. Please refer to PLIO03 hardware manual for detailed specifications and wiring diagrams.
Configuration of Counter/Encoder inputs can be done by selecting the Counter/Encoder I/O Mapping tab after a double
click on PLIO03 > Counter/Encoder in the project tree. The following figure shows the list of PLIO03 Counter/Encoder
parameters as it appears in the CODESYS software.
The input signals associated to each Counter/Encoder channel have the following meaning:
Board parameters have different options that can be selected at runtime using the PLC program.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 25
Internal PLC (CODESYS V3)
Data
Name Value Description
Type
Mode INT 0
2 Normal Counting
3 Gated Counting
4 Frequency Measurement
ZeroSearchEnable BOOL Enable zero search when in encoder mode. When true the counter
resets to zero. ZeroFoundF reports when zero has been reached.
CounterStyle BOOL Valid in counter mode, when true the count value resets when the
counter reaches the target value
MachineZeroEnable BOOL false Corresponding terminal block is used as normal digital input
EncZeroEnable BOOL false Corresponding terminal block is used as normal digital input
When the input is configured for use with an incremental encoder, then the Encoder Zero Search procedure is usually
performed at power-up. PLC program should start this procedure enabling the Zero Search using the
parameterZeroSearchE for the selected channel.
26 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Frequency=
The I/O driver calculates the frequency that is returned in the input signal Value.
One frequency measurement cycle terminates when there is at least one input count and at least 65536 counts in the
internal clock.
As an example, to cover the frequency range 1Hz to 20KHz you have to set:
1Hz to 2Hz 0 1
2Hz to 20KHz 0 0
The Mapping configuration of the PLIO03 Digital Outputs is displayed in the Work area by selecting the Digital Outputs I/O
Mapping tab after a double click on PLIO03 > Digital Outputs in the project tree.
Each channel can be configured as single-ended voltage measurement resulting in having 8 voltage analog inputs.
The Mapping configuration of the PLIO03 Analog Inputs is displayed in the Work area by selecting the Analog Inputs I/O
Mapping tab after a double click on PLIO03 > Analog Inputs in the project tree. Up to 9 analog values can be produced by
the module depending on the configuration.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 27
Internal PLC (CODESYS V3)
The following table shows the values provided by the system depending on the Analog Inputs configuration.
Mode
9 COMP Resistance - - -
Channel 9 is an input channel dedicated to cold junction compensation of thermocouples. Please refer to the hardware
description manual for additional details.
Analog inputs mode can be configured from the apposite table shown in the following figure. This can be reached by
selecting the Analog Inputs Parameters tab.
28 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Configuring Channel Measurement mode
Each channel is independently programmable; six different types of measurements can be executed. The type of measure
is defined by the Channel Mode setting, the next table shows the available modes.
0 Voltage (Differential) µV
2 Current (4-20mA) µA
3 Resistance (2-wire) mΩ
4 Resistance (3-wire) mΩ
5 Resistance (4-wire) mΩ
6 Thermocoupler (Differential) µV
8 Current (0-20mA) µA
9 PT100 (2-wire) mΩ
10 PT100 (3-wire) mΩ
11 PT100 (4-wire) mΩ
Voltage
0 ±100mV
1 ±500mV
2 ±1V
3 ±5V
4 ±10V
5 0 - 1V
6 0 - 10V
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 29
Internal PLC (CODESYS V3)
Current
0 ±2mA
1 ±10mA
2 ±20mA
Resistance
0 0 - 80Ω
1 0 - 400Ω
2 0 - 900Ω
3 0 - 8KΩ
4 0 - 10MΩ
5 0 - 1MΩ
For Channel Mode values from 6 to 8 the Range parameter value is set as default by the system.
8 Current (0-20mA) 0 - 1V
For Channel Mode values from 9 to 11 the Range value is the one reported in the following table.
0 0-157Ω
Frequency parameter
The Frequency parameter may be used to synchronize analog measurement to reduce powerline noise. Value 0 means free
running measurement, value 50 will take measurements synchronized with powerline at 50Hz. This option is useful with
high-gain measurements as in thermocouple channels.
30 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
The Mapping configuration of the PLIO03 Analog Outputs is displayed in the Work area by selecting the Analog Outputs I/O
Mapping tab after a double click on PLIO03 > Analog Outputs in the project tree.
Analog outputs mode can be configured from the apposite table shown in the following figure this can be reached by
selecting the Analog Outputs Parameters tab.
Each of the 4 channels can be independently programmed to be used as voltage or current output. The Channel Value
parameter can be configured with the values reported in the following table.
0 Voltage (+/-10000mV)
1 Current (0..20000µA)
The output range is fixed as specified in the table. The value written by the PLC program to the output channels is an
integer value between 0 and 10.000 in case of voltage and between 0 and 20.000 in case of current.
PLIO04
PLIO04 is a multifunction I/O module.
Thanks to the high level of integration and configurability, PLIO04 offers a “one-board solution” for most typical I/O
configurations in simple applications.
The next figure shows a configuration for HMIs, using a communication module and PLIO04 module.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 31
Internal PLC (CODESYS V3)
After including the PLIO04 module in the PLC configuration, as shown in the following figure, each I/O type of the module
can be configured separately.
32 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Available options are:
Option Description
Enabled 1 I/O variables are always updated by using bus cycle task if not used in any task
Enabled 2 I/O variables are always updated by using bus cycle task
The above option will be inherited by a specific I/O item if "Always update variables" option is set as "Use parent device
setting", from I/O Mapping tab.
The Mapping configuration of the PLIO04 Digital Inputs is displayed in the Work area by selecting the Digital Inputs I/O
Mapping tab after a double click on PLIO04 > Digital Inputs in the project tree.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 33
Internal PLC (CODESYS V3)
Debounce time parameter of the PLIO04 Digital Inputs can be set by selecting the Digital Inputs Parameters tab after a
double click on PLIO04 > Digital Inputs in the project tree.
The Mapping configuration of the PLIO04 Digital Outputs is displayed in the Work area by selecting the Digital Outputs I/O
Mapping tab after a double click on PLIO04 > Digital Outputs in the project tree.
34 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
First four channels can be configured as single-ended voltage measurement resulting in having 8 voltage analog inputs.
The Mapping configuration of the PLIO04 Analog Inputs is displayed in the Work area by selecting the Analog Inputs I/O
Mapping tab after a double click on PLIO04 > Analog Inputs in the project tree. Up to 9 analog values can be produced by
the module depending on the configuration.
Channel 9 is an input channel dedicated to cold junction compensation of thermocouples. Please refer to the hardware
description manual for additional details.
PLIO04 Analog Input channels have specific parameters that must to be properly configured according to the operation
mode requested for each channel: the operating mode and the full-scale range. Configuration of Analog inputs, shown in the
following figure can be reached by selecting the Analog Inputs Configuration tab after a double click on PLIO04 > Analog
Input in the project tree.
Channels 1-4 are independently programmable; four different types of measurements can be executed. The type of
measure is defined by the Channel Mode setting, the next table shows the values that can be configured.
0 Voltage (Differential) µV
1 Resistance (2-wire) mΩ
2 Resistance (3-wire) mΩ
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 35
Internal PLC (CODESYS V3)
3 Resistance (4-wire) mΩ
4 Thermocoupler (Differential) µV
5 PT100 (2-wire) mΩ
6 PT100 (3-wire) mΩ
7 PT100 (4-wire) mΩ
Measurement range parameter value changes depending on the Channel Mode value set for the Channel, for Channel
Mode values from 0 to 3 the Full Scale parameter can be set at programming time. Possible values are reported in the
following tables.
Voltage
0 ±100mV
1 ±500mV
2 ±1V
3 ±5V
4 ±10V
5 0 - 1V
6 0 - 10V
Resistance
0 0 - 80Ω
1 0 - 400Ω
2 0 - 900Ω
3 0 - 8KΩ
4 0 - 10MΩ
5 0 - 1MΩ
For Channel Mode value 4 the Range parameter value is set as default by the system.
36 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Thermocoupler
For Channel Mode values from 5 to 7 the Range value is the one reported in the following table.
PT100
0 0-157Ω
The WRComp parameter is the wire resistance compensation value and it can be set at programming time.
Frequency parameter
The Frequency parameter may be used to synchronize analog measurement to reduce powerline noise. Value 0 means free
running measurement, value 50 will take measurements synchronized with powerline at 50Hz. This option is useful with
high-gain measurements as in thermocouple channels.
PLIO06
PLIO06 is a compact I/O module. It has been designed for creating simple applications with a limited number of digital I/O
signals.
The next figure shows a configuration for HMIs, using PLIO06 module.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 37
Internal PLC (CODESYS V3)
PLIO06 module must be included in the PLC configuration, as shown in the following figure.
The contemporary use of 2 PLIO06 modules on the HMI is possible, in this case it is necessary to configure the Slot
number parameter for each module. Slot number valid values are 1 to 4. The Slot number configuration is available in the
PLIO06 Parameters tab as shown in next figure.
38 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Available options are:
Option Description
Enabled 1 I/O variables are always updated by using bus cycle task if not used in any task
Enabled 2 I/O variables are always updated by using bus cycle task
The above option will be inherited by a specific I/O item if "Always update variables" option is set as "Use parent device
setting", from I/O Mapping tab.
Mapping configuration of the PLIO06 Digital Inputs is displayed in the Work area by selecting the Digital Inputs I/O Mapping
tab after a double click on the PLIO06 > Digital Inputs item in the project tree.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 39
Internal PLC (CODESYS V3)
Debounce time parameter of the PLIO06 Digital Inputs can be set by selecting the Digital Inputs Parameters tab.
The Mapping configuration of the PLIO06 Digital Outputs is displayed in the Work area by selecting the Digital Outputs I/O
Mapping tab after a double click on the PLIO06 > Digital Outputs item in the project tree.
Modbus TCP
CODESYS V3 Runtime can use the built-in Ethernet interface of the operator panels for the distributed Modbus TCP
network. No additional hardware is required.
The system can act as Modbus TCP Master or Slave; both configurations are available at the same time.
Right click on Device (<device_name>) in project tree and select “Add Device”. Ethernet device is located under the
Fieldbusses > Ethernet Adapter category. Choose Ethernet device from list and click on “Add Device” to add it to the
current PLC configuration.
40 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Right click on Ethernet (Ethernet) item in the Project tree and select “Add Device”.
Modbus TCP Master and Slave devices are located under the categories Modbus > Modbus TCP Master/Slave. Select the
required device from the list and click on “Add Device” to add it to the current PLC configuration.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 41
Internal PLC (CODESYS V3)
Element Description
Response Timeout (ms) Timeout for Modbus slaves reply, given in milliseconds.
42 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Once Modbus TCP Slave has been added in project tree double click on Ethernet > Modbus_TCP_Slave (1).
Element Description
Response Timeout (ms) Timeout for Modbus slaves reply, given in milliseconds.
Port TCP port used for the communication with the Modbus TCP Slave Device
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 43
Internal PLC (CODESYS V3)
The configuration is based on Channels. For each channel it can be configured a Modbus command that will be sent to the
Slave.
To add a new Channel click on Add Channel button (2), as shown in the following figure, the ModbusChannel dialog will be
displayed (3).
Element Description
Trigger Determines if the command execution is cyclic, in this case the Cycle Time must be
specified, or Rising Edge, in this case the command is launched on the rising edge event
of a boolean variable defined in the Modbus TCP Slave I/O Mapping
Offset Determines if the command execution is cyclic, in this case the Cycle Time must be
specified, or Rising Edge, in this case the command is launched on the rising edge event
of a boolean variable defined in the Modbus TCP Slave I/O Mapping
Modbus TCP Slave I/O mapping is available by selecting the Modbus TCP Slave I/O Mapping tab (4).
44 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
The Mapping shows a list of all Modbus read/write resources in the configured Channels.
In case the configured Channel uses a Rising Edge triggered command the Trigger bit is listed into the Mapping too.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 45
Internal PLC (CODESYS V3)
Option Description
Enabled 1 I/O variables are always updated by using bus cycle task if not used in any task
Enabled 2 I/O variables are always updated by using bus cycle task
The above option will be inherited by a specific I/O item if "Always update variables" option is set as "Use parent device
setting", from I/O Mapping tab.
Once Modbus TCP Slave has been added in project tree double click on Ethernet > Modbus_TCP_Slave_Device (1).
46 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Available parameters are:
Element Description
Slave port TCP port used for the communication with the Modbus TCP Slave Device
Modbus TCP Slave mapping is available by selecting the Modbus TCP Slave Device I/O Mapping tab (3).
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 47
Internal PLC (CODESYS V3)
Modbus RTU
CODESYS V3 Runtime can use the built-in serial interface of the HMI for the distributed Modbus RTU network. One single
serial interface is available as built-in option for Exor HMIs. With the use of optional plug-in modules it is possible to have
up to 3 serial interfaces on the device.
Note: Availability of optional plug-in modules depends on the HMI model, please check Control Solutions with
HMI and CODESYS V3 chapter to verify availability for your HMI.
Right click on Device (<device_name>) in project tree and select “Add Device”. Modbus COM device is located under
Fieldbusses > Modbus > Modbus Serial port category. Choose Modbus COM device from list and click on “Add Device” to
add it to the current PLC configuration.
48 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Right click on Modbus COM item in project tree and select “Add Device”.
Modbus RTU Master and Slave devices are located under Fieldbusses > Modbus > Modbus Serial Master/Device
categories. Select the required device from the list and click on “Add Device” to add it to the current PLC configuration.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 49
Internal PLC (CODESYS V3)
Element Description
* check Installing Optional Modules > Slot Numbers for Slot# details
Baud Rate
Parity
Serial line parameters
Data Bits
Stop Bits
To set serial COM mode double click on Device (<device_name>) and click on Interface Parameters tab, as shown in
picture below.
For each port modify Value column and choose between RS232, RS485 and RS422.
50 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Configuring PLC as Modbus RTU Master
Once Modbus Master COM Port as been added in project tee double click on Modbus_COM> Modbus_Master_COM_Port
(1).
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 51
Internal PLC (CODESYS V3)
Element Description
Response Timeout (ms) Timeout for Modbus slaves reply, given in milliseconds.
Time between frames (ms) Wait time between Slave reply and next Master query.
Once Modbus TCP Slave as been added in project tee double click on Modbus_COM > Modbus_Master_COM_Port >
Modbus_Slave_COM_Port (1).
52 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Element Description
Slave Address [1..247] Modbus Node ID of the Modbus RTU Slave Device
Response Timeout [ms] Timeout for Modbus slaves reply, given in milliseconds.
The configuration is based on Channels. For each channel it can be configured a Modbus command that will be sent to the
Slave.
To add a new Channel click on Add Channel button (2), as shown in the following figure, the ModbusChannel dialog will be
displayed (3).
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 53
Internal PLC (CODESYS V3)
Element Description
Trigger Determines if the command execution is cyclic, in this case the Cycle Time must be
specified, or Rising Edge, in this case the command is launched on the rising edge event
of a boolean variable defined in the Modbus RTU Slave I/O Mapping
Offset The starting Modbus address given in HEX format. Note: the addressing is zero based,
in case the Slave device has Modbus addressing 1 based the starting address provided
must be calculated with -1 offset
Modbus RTU Slave I/O mapping is available by selecting the ModbusGenericSerialSlave I/O Mapping tab (4).
The Mapping shows a list of all Modbus read/write resources in the configured Channels.
In case the configured Channel uses a Rising Edge triggered command the Trigger bit is listed into the Mapping too.
54 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Available options are:
Option Description
Enabled 1 I/O variables are always updated by using bus cycle task if not used in any task
Enabled 2 I/O variables are always updated by using bus cycle task
The above option will be inherited by a specific I/O item if "Always update variables" option is set as "Use parent device
setting", from I/O Mapping tab.
Once Modbus Serial Device as been added in project tee double click on Modbus_COM > Modbus_Serial_Device (1).
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 55
Internal PLC (CODESYS V3)
Element Description
Modbus RTU Slave Device I/O mapping is available by selecting the Modbus Serial Device I/O Mapping tab (3).
56 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
CAN Master
CODESYS V3 Runtime can act as a CAN Master to allow the use of distributed CANopen I/O points.
To interface the HMI with a CAN network one of the available CAN optional modules must be installed.
Note: Availability of optional plug-in modules depends on the HMI model, please check Control Solutions with
HMI and CODESYS V3 chapter to verify availability for your HMI.
The following figure shows HMIs with CAN optional module mounted.
Right click on Device (<device_name>) in the Project tree and select “Add Device”. CANbus device is located under
Fieldbusses > CANbus category. Choose CANbus device and click on “Add Device” to add it to the current PLC
configuration.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 57
Internal PLC (CODESYS V3)
Right click on CANbus in the project tree and select “Add Device”.
CANopen Manager device is located under Fieldbusses > CiA CANopen > CiA CANopen Manager category. Choose
CANopen Manager device and click on “Add Device” to add it to the current PLC configuration.
Parameters of CAN interface are grouped in three tabs accessible on the right part of PLC Configuration tool when the Can
Master element has been added to the configuration tree.
Note: A complete and detailed description on the configuration of CAN controllers and on the configuration of
CAN slave devices is included in CODESYS Development System User Manual
58 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Available parameters are:
Element Description
Network CAN network number 0 is default, in case of double CAN network configuration Network 1 is
used for the second CAN network.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 59
Internal PLC (CODESYS V3)
Element Description
Autostart If selected, the CANopen Manager starts automatically if all mandatory slaves are ready. If
CANopen not selected, the manager must be started by the application, using the CiA405 NMT function
Manager block for this purpose.
Polling of If an optional slave does not respond during start-up sequence the system polls the slave
optional every second until the slave responds successfully.
slaves
Start Slaves If selected the CAN Master starts the slaves automatically, otherwise the start operation
must be done into the application.
NMT Start If Start Slaves option is selected it is possible to enable NMT Start All function, this function
All will start all the slaves at the same time when all the slaves are ready. If not enabled each
slave is started separately.
NMT Error This option allows to determine the behavior on a guard event, the available options are
Behavior Restart Slave or Stop Slave
Window Length of the time window for synchronous PDOs, given in microseconds
length (µs)
Enable If selected the Sync messages are supposed to be produced by a different device on the
Sync CAN network, the CANopen Manager will receive such messages.
consuming
Enable If selected, the Master sends Heartbeat messages on the CAN network.
Heartbeat
producing
Enable If selected the Master sends TIME messages on the CAN network.
TIME
Producing
COB-ID COB-ID of the TIME messages, default value is 256 (100 Hex)
(Hex)
Producer Time between two TIME messages, given in milliseconds. Must be a multiple of the task
Time (ms) cycle time.
60 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Diagnostic Mapping
When a CAN master device is added to the PLC configuration, the system automatically creates a Variable of type
CANOpenManager into the project. This variable contains the diagnostic information about the CAN Master.
The Variable name is assigned by default but can be changed by changing the I/O module name into the PLC configuration.
The Variable is reported into the CANopen I/O Mapping tab, displayed in the work area by double clicking on the CANbus >
CANopen Manager in the project tree, as shown in the following figure.
To add a CANopen I/O Slave, right click on CANopen Manager in Project tree and select “Add Device”.
The list of available CANopen I/O slaves is located under Fieldbusses > CiA CANopen > CiA Remote Device category.
Choose the device and click on “Add Device” to add it to the current PLC configuration.
Note: Installation of third part CAN Slaves into CODESYS V3 requires a specific EDS descriptor file, provided
by the CAN Slave manufacturer. Refer to the CODESYS Development System User Manual for detailed
information regarding EDS file installation.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 61
Internal PLC (CODESYS V3)
Note: For specific information regarding the set-up of the CAN Slaves please refer to the documentation
provided from the CAN Slave manufacturer.
Element Description
Enable If selected this Device send Sync messages on the CAN network. This option is selectable
Sync only if the Sync messages production at CANopen Master side is disabled.
Producing
62 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Element Description
No If selected the sequence of SDO messages required for the device initialization (PDO
initialization mapping) will not be created.
Optional If selected the current device is considered as optional into the bus.
device
At start-up the CAN controller will check if it is present applying the following rules:
l If the device is present since start-up and correctly replies to the CANopen mandatory
object “Device Type” query (matching the EDS file specification), then it is started.
The master will continue with the next device.
l If the device is present since start-up and it does not reply as expected to the “Device
type” query, it is not started. The master stops then, reporting a mismatching error in
the CAN configuration; if the “Optional device” with not-matching “Device Type” is
inserted in the bus after start-up, the master will skip it and continue to scan the other
devices.
l If the device is not present since start-up, it is simply skipped. The master will
continue with the next device.
CAN Interface
CAN optional module includes a CAN bus interface implemented according to CAN protocol specifications 2.0 A.
This CAN controller supports only Standard frame format (2.0 A) with bit rates up to 1 Mbit/s.
Programming the parameter baudRateKbps at the value 0 enables the use of custom timing.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 63
Internal PLC (CODESYS V3)
Prescaler: 1 to 64
Tsetup: 1 to 8
Thold: 1 to 4
Other two parameters can affect the behavior of the CAN controller:
SyncJumpWidth: defines the number of time quanta (8 MHz / Prescaler) allowed to accept a SYNC pulse. Valid values are
1 to 4.
SampleMode: defines the number of times the bit is sampled before is considered valid. Valid values are 0 (1 sample) and 1
(3 samples).
64 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Internal PLC (CODESYS V2)
This manual describes the Exor control system based on the CODESYS V2 PLC software.
Note: This manual is not intended as CODESYS V2 programming manual, for specific documentation regarding
CODESYS V2 Development System please refer to the CODESYS web site www.codesys.com and to its on-
line help.
Exor eTOP Series 400, 500 and 600 HMI products have been designed to include the CODESYS V2 PLC runtime.
The PLC runtime is automatically transferred to the device by JMobile Studio as part of the JMobile Runtime and it is
running with the support of the operating system of the device.
CODESYS V2 Development System suite is required to develop and debug PLC applications and transfer them to the Exor
HMI device.
The CODESYS V2 runtime requires a license activation to be used. CODESYS V2 license is activated by plugging on the
operator panel one of the optional modules that includes CODESYS V2 license. The modules are plug & play, no further
steps are required to activate the license.
The following table contains a list of optional plug-in modules that include the CODESYS V2 license.
Module Description
TCM-19 Plug-in module CAN with CODESYS V2 license (only for eTOP Series 400)
PLCM01-NEC Plug-in module CAN with CODESYS V2 license without Bus Extension connector
Note: License is required for the operation of CODESYS V2 runtime. CODESYS V2 runtime will communicate
with the Development System only with a module containing a license.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 65
Internal PLC (CODESYS V2)
System Configuration
The HMI and control solution based on JMobile and CODESYS V2 can be applied in different configurations.
Note: The communication capabilities over Serial network are limited by the amount of serial interfaces
available, each serial interface supports a single communication protocol. Specific optional add-on serial
interface modules are available to increment the amount of serial interfaces at disposal.
66 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Element Version
Getting Started
This chapter provides the necessary informations on how to set-up the HMI + CODESYS Plc system. The required
operations are listed below and explained in the forthcoming chapters.
at http://www.codesys.com/download.html.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 67
Internal PLC (CODESYS V2)
Note: The operator panels internal PLC is compatible with CODESYS V2.3 Development System only.
CODESYS V3.5 Development System is NOT compatible with CODESYS V2 Runtime.
The EXOR TSP is included into JMobile Suite since version 1.91 SP1 under “\CODESYS\V2\” folder,
and is also available for download from the web site www.exorint.net.
The TSP is provided as a zip file that must be unzipped to a folder respecting its internal directory structure.
The CODESYS Development System includes a tool called “Install Target” for the installation of the Target Support
Package. The Install Target tool is part of the CODESYS program group that can be found in the Start Menu after the
installation of the software. This tool can be used both for checking the installed TSP and for installing new ones.
68 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
To install the Target Support Package for JMobile click on the “Open” button:
browse for the file with .tnf extension present into the TSP folder extracted from the zip package:
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 69
Internal PLC (CODESYS V2)
Select an item from the “Possible Targets" list and click on “Install” button to install the TSP into the System:
70 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
The result will be as shown in the following figure with an example of TSP data.
The following Targets are included into the EXOR TSP for JMobile:
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 71
Internal PLC (CODESYS V2)
Target Platform
EXOR CODESYS for JMobileWCE (WCE/ARM eTOP Series 500 and Series 600 products with
UN31) 600MHz CPU
EXOR CODESYS for JMobileWCE (WCE/ARM eTOP Series 500 and Series 600 products with 1GHz
UN30) CPU
When a new version of the Target Support Package is available, it can be installed replacing the older one. EXOR always
tries to guarantee the complete compatibility with the previous TSP versions.
If the new TSP is not fully compatible with the previous version some changes to adapt the PLC application to the new TSP
may be required. In these cases, the updates to the Target Support Package, will come with proper instructions for the
conversion of existing projects.
The TSP update procedure is identical to the first installation of the TSP, please refer to the proper chapter for specific
informations.
As the CODESYS PLC runtime is part of the JMobile HMI runtime it is necessary to install the JMobile Runtime on the
operator panel to have the PLC runtime running. For further information on installing the runtime, please refer to JMobile
Studio help.
The steps to follow for the installation of the optional module are shown in the following figure and are the following:
72 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Note: Do not plug or remove optional modules when the HMI device is powered.
The following figure shows eTOP504 and eTOP507 with option modules PLCM01-CDS mounted.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 73
Internal PLC (CODESYS V2)
Slot Numbers
eTOP Series 500 and 600 products have up to 4 slots available for optional modules. Slots are numbered from 1 to 4.
Numbering of the slots is shown in the following figure.
Slot #2 is located on the top of the option module plugged into Slot #1.
Slot #4 is located on the top of the option module plugged into Slot #3.
74 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
If correctly installed on the operator panel and recognized by the system, the optional modules are listed into the Plugin
List.
For Exor HMI Series products you have the following Target choices:
The Target selection depends on the type of processor used in the HMI model. The processor type is shown in the System
Settings page of the HMI, when BSP Settings voice is selected, into the Info section under Name. See an example in the
following figure.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 75
Internal PLC (CODESYS V2)
A list of HMI models with the indication of the Target Settings is given in the following table:
76 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
HMI Model Target Settings Platform
After selecting the Configuration, the Target Settings dialog box will appear as shown in figure.
These settings can also be reached from the “Resources” tab of the CODESYS V2 Development System.
Below you can find basic explanation of the options available in the EXOR International Target Settings. A detailed
explanation of all the options is available in the CODESYS V2 online help.
Note: Some options available into the Target Settings are fixed for the EXOR International Target Support
Package and cannot be changed by the end user.
Some other options described in the online help are not available for use in the EXOR International Target
Support Package.
The Size table contains the memory size available for Code and memory areas, the size are reported in Byte (Hex). For
example the amount of memory for PLC Application code is 1MB. The application files are stored on the Operator panel
internal flash memory.
Maximum number of POUs specifies the max number of POU allowed in a project
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 77
Internal PLC (CODESYS V2)
The next figure shows the General tab. Among the options available the most commonly used options are:
Download symbol file: when set, symbol file is downloaded into PLC. This is required for the automatic symbol file
upload procedure. We suggest to set this option.
Load bootproject automatically: when set, the boot project is automatically created and downloaded into the PLC
together with application.
For all the other options we suggest to refer to the CODESYS manual.
Network functionality tab enable the use of Network variables, the system allows exclusively the use of UDP network
variables.
78 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Note: Visualization is not supported from the Exor CODESYS Runtime version. The corresponding tab in Target
Settings has no use.
The first time this dialog is opened, the user will be requested to specify the channel for the connection to the PLC runtime.
When creating a new Channel, you have to define the type and all the relevant parameters in the dialog box.
Communication is possible by Ethernet using level 2 driver, selecting “Tcp/Ip (Level 2)” from the device list:
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 79
Internal PLC (CODESYS V2)
Once confirmed, the new Channel is added to the Channels list into the Communication Parameters dialog. Selecting the
new Channel it is possible to specify the IP address of the PLC runtime that must be entered in the “Address” parameter;
see the following figure as example.
The other parameters: Port, Blocksize and Motorola byteorder are correct for operation with Exor and do not require to be
modified.
to do this select Online > Login command from CODESYS workbench. The system will verify the presence of an
application into the PLC, asking the confirmation before proceeding with the download.
After the download operation the CODESYS application is stored into a volatile memory, this means that if the operator
panel is restarted, the CODESYS application is lost.
To store the application into the non-volatile flash memory of the panel it is necessary, while Online, to launch the
command “Online > Create Boot Project”.
80 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Note: It is possible to download the Boot Project automatically at project download by selecting the “Load
bootproject automatically” option available among the Target Settings options. For more information please refer
to the Target Settings chapter.
To upload a PLC project from the HMI, select the command Open from the File menu and click on the “PLC” button to
specify the source of the open action.
When opening a program from PLC, CODESYS V2 requires the specification of the Target Settings.
PLC Project upload can be executed only if the project source code has been downloaded to the target device.
The “Source code download” command is available from the “Online” menu of the CODESYS V2 Development System.
To enable the generation of the Symbol file check the option “Dump symbol entries” as shown in the following figure.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 81
Internal PLC (CODESYS V2)
To make sure that Symbols are created for all variables in all POUs, for Global Variables and for variables defined in the
PLC Configuration click on the “Configure symbol file…” button.
Check the option “Export variables of object” in the Set Object Attributes dialog box, as shown in the following figure.
In some cases, duplication of symbols for variables associated to integrated I/O modules in the “.sym” file may be
experienced. To remove the duplication selected the “PLC Configuration” voice from the objects list and uncheck the option
“Export variables of object”.
82 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Please refer to CODESYS V2 documentation for additional information.
The system supports Level 2 and Level 4 protocol types for the communication with the CODESYS runtime.
Additional informations regarding the CODESYS V2 ETH driver are available in JMobile help Communication drivers
section.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 83
Internal PLC (CODESYS V2)
JMobile Tag Editor supports direct import of CODESYS V2 symbol file for an automatic and faster definition of the Tags.
Use the command “Import Tags” in JMobile Tag Editor to import the symbols generated by the Development System.
Select *.sym as Import Type in the JMobile Tag Import dialog, as shown in the following figure.
CODESYS V2 Development System generates a new version of the “.sym” file each time the PLC project is built.
CODESYS V2 Ethernet communication driver supports automatic symbol file (SDB) upload from the PLC; the HMI can
upload the symbol table from the PLC using the communication protocol.
Any change in the tag offset information due to a new compilation of the PLC program does not require importing again the
symbol file.
Tag Addressing
Tag addressing informations are visible in the Tag Address dialog. See an example in the following figure.
l PLC Memory
l PLC Memory Bit
l PLC Input
l PLC Input Bit
l PLC Output
l PLC Output Bit
l Retentive Memory
l Local/Global Var
l Local/Global Var Bit
l Local/Global Var(5)
l IP Override IP
l ProjectId
84 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Retain variables are in segment 3, Global and POU (Program Organization Unit) local variables without direct address are
in the subsequent segments.
The reference to variables in the CODESYS system consists of “POUref” (the segment), Offset and size.
Communication Diagnostic
JMobile reports communication diagnostic information also for the communication with the internal PLC runtime. To display
communication diagnostic information use the proper System Variables or the System Logger. For further information
please refer to JMobile Studio help.
Configuring I/O
CODESYS V2 implementation for eTOP Series 500 and 600 products support configuration of integrated and remote I/O.
Simple configurations using CANOpen bus for remote I/O can be realized adding the CAN optional module PLCM01 to the
HMI.
Modbus Ethernet I/O uses the integrated ethernet port of the HMI as interface to the network. In this case you can use
PLCM05-CDS, a module that enable the CODESYS V2 license but without bus interface.
Integrated I/O systems are based on optional plug-in modules named PLIO.
To configure an I/O optional module, select “Resources” tab into CODESYS V2 Development System then click on “PLC
Configuration”. Use the “Insert Element/Append Subelement” commands from Insert menu or from context menu on right
click on the Root voice of configuration tree. The list of available elements will appear as sub-menu.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 85
Internal PLC (CODESYS V2)
Choose the I/O type from the list to add it to the current PLC configuration.
The parameters of all integrated I/O modules are collected in single tab of the PLC Configuration tree.
PLIO03
PLIO03 is a multifunction I/O module.
Due to the high level of integration and configurability, PLIO03 offers a “one-board solution” for most typical I/O
configurations in simple applications.
The following figure shows a configuration for eTOP504 and eTOP507, using the PLIO03 module.
86 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Note: eTOP504 and eTOP605 panel models require the use of a Bus extender module for the installation of the
PLIO03 I/O module.
After including the PLIO03 module in the PLC configuration, as shown in the following figure, Specific configuration steps
must be performed for different parts of the module.
Base parameters
The following figure shows the Base Parameters tab for integrated I/O modules.
Element Description
Module id CODESYS internal identifier used to recognize the board; it is a read only parameter.
Node id CODESYS internal identifier assigned by the Development System depending on the order of
the board in the PLC Configuration layout; it is a read only parameter.
Diagnostic Memory address for the storage of diagnostic information of the I/O module
address
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 87
Internal PLC (CODESYS V2)
Normal use of digital inputs does not require any additional configuration.
Counter/Encoder Inputs
PLIO03 includes 2 programmable Counter/Encoder channels.
Each Counter/Encoder channel is associated to a group of 4 digital inputs. When a Counter/Encoder channel is enabled,
the associated digital inputs cannot be used as normal inputs. In case all the 2 Counter/Encoder channels are enabled, only
12 digital inputs are still available for normal operation. Please refer to PLIO03 hardware manual for detailed specifications
and wiring diagrams.
Configuration of Counter/Encoder inputs must be done in the PLC program, based on the parameters defined for the
PLIO03 module.
The following figure shows the list of PLIO03 Counter/Encoder #1 parameters as it appears in the PLC Configuration.
The input signals associated to each Counter/Encoder channel have the following meaning:
Board parameters have different options that can be selected at runtime using the PLC program.
88 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Data
Name Value Description
Type
2 Normal Counting
3 Gated Counting
4 Frequency Measurement
ZeroSearchE BOOL Enable zero search when in encoder mode. When true the counter
resets to zero. ZeroFoundF reports when zero has been reached.
CounterStyle BOOL Valid in counter mode, when true the count value resets when the
counter reaches the target value
MachZeroEnabled BOOL false Corresponding terminal block is used as normal digital input
EncZeroEnabled BOOL false Corresponding terminal block is used as normal digital input
When the input is configured for use with an incremental encoder, then the Encoder Zero Search procedure is usually
performed at power-up. The PLC program should start this procedure enabling the Zero Search using the
parameterZeroSearchE for the selected channel.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 89
Internal PLC (CODESYS V2)
Frequency=
The I/O driver calculates the frequency that is returned in the input signal Value.
One frequency measurement cycle terminates when there is at least one input count and at least 65536 counts in the
internal clock.
As an example, to cover the frequency range 1Hz to 20KHz you have to set:
1Hz to 2Hz 0 1
2Hz to 20KHz 0 0
PLIO03 Analog Input channels have specific parameters that must to be properly configured according to the operation
mode requested for each channel: the operating mode and the full-scale range.
Each channel can be configured as single-ended voltage measurement resulting in having 8 voltage analog inputs.
The following figure shows the configuration interface of the Analog Inputs. Note that 9 analog values are produced by the
module.
The following table shows the different meaning assumed by the 9 values produced by the Analog Input module depending
on the measurement mode selected with the configuration parameters.
90 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Mode
2 AI1_CH2 - Value - -
4 AI2_CH2 - Value - -
6 AI3_CH2 - Value - -
8 AI4_CH2 - Value - -
9 COMP Resistance - - -
Channel 9 is an input channel dedicated to cold junction compensation of thermocouples. Please refer to the hardware
description manual for additional details.
0 Voltage Differential µV
2 Current µA
3 Resistance 2 wires mΩ
4 Resistance 3 wires mΩ
5 Resistance 4 wires mΩ
8 Current (0-20) µA
9 PT100 2 wires mΩ
10 PT100 3 wires mΩ
11 PT100 4 wires mΩ
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 91
Internal PLC (CODESYS V2)
5 1V ±20mA 0 - 900Ω
7 PT100
8 Thermocouple
For ChxType values from 6 to 8 the Full Scale parameter value is set as default by the system.
8 Current (0-20) 0 - 1V
For ChxType values from 9 to 11 the Full Scale parameter can be modified during runtime using the EXOR_IO_CTRL
function. The table below reports the Full Scale values available, by default the Full Scale parameter value is 0.
0 0-157Ω
1 0-530Ω
2 0-1020Ω
3 0-8800Ω
4 0-10MΩ
SamplingFreq Parameter
The parameter SamplingFreq available into may be used to synchronize analog measurement to reduce powerline noise.
The value 0 for SamplingFreq means free running measurement. The value 50 will make measurements synchronized with
powerline at 50Hz. This option is useful with high-gain measurements as in thermocouple channels
92 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Runtime Change of Channels Settings Using EXOR_IO_CTRL
Configuration parameters of the Analog Inputs can be changed at runtime using the EXOR_IO_CTRL function with the
following Function Codes:
PLIO03 Analog Outputs have several parameters that must be properly configured according to the operation mode you
need for each channel.
For each of the 4 channels it is required to specify the operating mode and the full-scale range.
The following figure shows the configuration of the 4 Analog Outputs channels.
Each of the 4 channels can be independently programmed to be used as voltage or current output. The parameters
Ch1Type, Ch2Type, Ch3Type and Ch4Type can be configured as shown in the following table.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 93
Internal PLC (CODESYS V2)
The output range is fixed as specified in the table. The value written by the PLC program to the output channels is an
integer value between 0 and 10.000 in case of voltage and between 0 and 20.000 in case of current.
Configuration parameters of the Analog Outputs can be changed at runtime using the EXOR_IO_CTRL function with the
following Function Codes:
Other Function Codes are reserved for different uses and must not be used.
Diagnostic
PLIO03 reports diagnostic information in the Diagnostic section of the configuration.
Parameter Description
PLIO06
PLIO06 is a compact I/O module. It has been designed for creating simple applications with a limited number of digital I/O
signals.
The following figure shows a configuration for eTOP504 and eTOP507 using the PLIO06 module.
94 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
The PLIO06 module must be included in the PLC configuration, as shown in the following figure.
Double PLIO06 configuration is allowed. When used is is necessary to specify the Slot number for each module. The
SlotNumber parameter is available in the tab Module parameters.
PLIO06 must be assigned a SlotNumber from 1 to 4. An error will be reported at run-time if the I/O module has not been
plugged in the slot defined in the PLC configuration.
Base parameters
The following figure shows the Base Parameters tab for integrated I/O modules.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 95
Internal PLC (CODESYS V2)
Element Description
Module id CODESYS internal identifier used to recognize the board; it is a read only parameter.
Node id CODESYS internal identifier assigned by the Development System depending on the order of
the board in the PLC Configuration layout; it is a read only parameter.
Diagnostic Memory address for the storage of diagnostic information of the I/O module
address
Diagnostic
PLIO06 reports diagnostic information in the Diagnostic section of the configuration.
Parameter Description
96 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Ethernet I/O Slave
CODESYS V2 runtime can use the built-in Ethernet interface of the operator panels for the distributed Modbus/TCP I/O
network. No additional hardware is required.
To add an Ethernet I/O module, into the PLC Configuration use the Insert element/Append subelement commands from
Insert menu or from context menu on right click on the Root voice of configuration tree. The list of available elements will
appear as sub-menu.
Choose the Ethernet I/O Slave module from the list to add it to the current PLC configuration.
The parameters of the Ethernet interface are grouped in two tabs accessible on the right part of the PLC Configuration tool
when the Ethernet I/O Slave element has been added to the configuration tree.
Base parameters
The following figure shows the “Base Parameters” tab.
Element Description
Module id CODESYS internal identifier used to recognize the board; it is a read only parameter.
Node id CODESYS internal identifier assigned by the Development System depending on the order of
the board in the PLC Configuration layout; it is a read only parameter.
Diagnostic Memory address for the storage of diagnostic information of the Ethernet network
address
Module Parameters
The following figure shows the “Module Parameters” tab. This tab contains the basic information for setting up Ethernet
slave nodes.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 97
Internal PLC (CODESYS V2)
Element Description
Module Type Type of the slave node. The following types are supported:
WAGO
BECKHOFF
STD_ MODBUS
WEIDMULLER
After the set-up of the Ethernet I/O Slave the structure of available I/O points can be defined.
To add an I/O module, select the Ethernet I/O Slave from the PLC configuration tree then use the Append subelement
command from Insert menu or from context menu on right click on the Ethernet I/O Slave voice of configuration tree. The
list of available I/O points will appear as sub-menu.
Choose the I/O point from the list to add it to the current PLC configuration.
The following figure shows an example configuration including 8 digital inputs and 8 digital outputs.
The below table specifies the correspondence between the I/O type and the specific Modbus resource.
98 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
I/O Modbus memory resource Data type
Below you can find the parameters to be passed to the EXOR_IO_CTRL function to modify the Modbus addressing for the
I/O
Function
Argument Description
Code
1 0=disabled Set access control (for multi master fault tolerant systems)
1=read-only
2=full access
(default)
Can Master
CODESYS V2 runtime can act as a CAN Master to allow the use of distributed CANopen I/O points. To interface the
operator panel with CAN network one of the available CAN optional modules must be installed.
The following figure shows eTOP504 and eTOP507 with option modules PLCM01-CDS mounted.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 99
Internal PLC (CODESYS V2)
To add a CAN Master, into the PLC Configuration use the Insert element/Append subelement commands from Insert menu
or from context menu on right click on the Root voice of configuration tree. The list of available elements will appear as sub-
menu.
Choose the CanMaster module from the list to add it to the current PLC configuration.
The parameters of the CAN interface are grouped in three tabs accessible on the right part of the PLC Configuration tool
when the CanMaster element has been added to the configuration tree.
Note: A complete and detailed description on the configuration of CAN controllers and on the configuration of
CAN slave devices is included in the CODESYS User Manual
Base parameters
The following figure shows the “Base Parameters” tab.
Element Description
Module id CODESYS internal identifier used to recognize the board; it is a read only parameter.
Node CODESYS internal identifier assigned by the Development System depending on the order of
number the board in the PLC Configuration layout; it is a read only parameter.
Diagnostic Memory address for the storage of diagnostic information of the CAN master
address
100 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
CAN parameters
The following figure shows the “CAN Parameters” tab; it contains all the parameters related to the bus configuration.
Element Description
Com. Specifies the communication cycle interval related to the PDO messages exchange; if set to 0,
Cycle the default value for communication cycle is 20ms. Minimum allowed value is 1ms.
Period
Sync. Default value 128 is assigned following the CiA CANopen standard, the COB-ID can be
COB-ID changed depending on installation requirements.
Automatic If set the NMT startup command is sent automatically to all configured slaves at power-up.
Startup
Support Enables the controls for the heartbeat and of the Modular Slaves; Modular Slaves is a concept
DSP301… defined by CiA and refers to the usage of a bus coupler that allows connecting several
combination of modules (please refer to CiA documentation for further details).
Heartbeat Defines the timing, in milliseconds between two heartbeat messages sent by Master on CAN
Master network.
Module parameters
The following figure shows the “Module Parameters” tab. The meaning of the available parameters is the following:
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 101
Internal PLC (CODESYS V2)
Element Description
Value=16#80000000 enables the sync mode of master in which CAN scan cycle is driven
by PLC cycle and starts immediately after the update of Output Process Image
Installation of EDS descriptor files for third part CAN Slave devices
The use of third part CAN Slave devices requires a specific EDS descriptor file provided by the device manufacturer to be
installed into the system. Once installed the file the CAN Slave device will be listed and selectable into the PLC
configuration.
To install an EDS file is enough to copy the file provided by the device manufacturer into the Target specific folder.
For example to install an EDS file to be used into an application made for UN31 Target the file must be copied into the
C:\Program Files\3S Software\CoDeSys V2.3\targets\EXOR\JMobileWCE_ARM31 folder.
To add a CAN Slave module, select the CanMaster from the PLC configuration tree then use the Append subelement
command from Insert menu or from context menu on right click on the CanMaster voice of configuration tree. The list of
available I/O Slaves will appear as sub-menu.
Choose the I/O point from the list to add it to the current PLC configuration.
Note: For specific information regarding the set-up of the CAN Slaves please refer to the documentation
provided from the CAN Slave manufacturer.
102 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Element Description
Create all When selected the SDO messages for the slave configuration, depending on the PDO
SDO’s mapping are created for all objects.
When not selected the SDO messages for the slave configuration are created only for the
modified objects. In this latter case, please make sure the EDS file loaded in CODESYS V2
is matching the hardware device features, otherwise some required SDO messages will be
erroneously skipped.
No If selected the sequence of SDO messages required for the device initialization (PDO
initialization mapping) will not be created.
Optional If selected the current device is considered as optional into the bus.
device
At start-up the CAN controller will check if it is present applying the following rules:
l If the device is present since start-up and correctly replies to the CANopen mandatory
object “Device Type” query (matching the EDS file specification), then it is started.
The master will continue with the next device.
l If the device is present since start-up and it does not reply as expected to the “Device
type” query, it is not started. The master stops then, reporting a mismatching error in
the CAN configuration; if the “Optional device” with not-matching “Device Type” is
inserted in the bus after start-up, the master will skip it and continue to scan the other
devices.
l If the device is not present since start-up, it is simply skipped. The master will
continue with the next device.
This CAN controller supports only Standard frame format (2.0 A) with bit rates up to 1 Mbit/s.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 103
Internal PLC (CODESYS V2)
Programming the parameter baudRateKbps at the value 0 enables the use of custom timing
Prescaler: 1 to 64
Tsetup: 1 to 8
Thold: 1 to 4
Other two parameters can affect the behavior of the CAN controller:
SyncJumpWidth: defines the number of time quanta (8 MHz / Prescaler) allowed to accept a SYNC pulse. Valid values are
1 to 4.
SampleMode: defines the number of times the bit is sampled before is considered valid. Valid values are 0 (1 sample) and 1
(3 samples).
The following tables show the various Functions Codes for EXOR_IO_CTRL; depending if the IO_CTRL is directed to
CanMaster, CAN Slave Node, Rx PDO or Tx PDO, a different set of Functions is available.
104 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Function
Argument Description
Code
1 Any Return the QuickStatus, i.e. the global status: 0 means all ok, otherwise the error
code (for a list of error codes please see below).
2 Any This function fetches one error from the Error FIFO.
All the errors are collected in an Error FIFO, so that no error event is lost.
The 32 bits integer returned contains the error code (see the list below) in the lower
16 bits and the Node Id in the higher 16 bits.
For those functions directed to the CAN Slaves the SubNode value is used to calculate the Argument parameter.
Each Sub Node in the CODESYS V2 PLC Configuration editor has a progressive Node Number starting from zero; this is
assigned by CODESYS and can be seen in the board “Base Parameters”.
0+10000* Any Returns the current status of the device to which the specified I/O
(SubNode+1) variable is connected.
0 means no errors, otherwise the error code is reported (see error codes
list below).
Function
Argument diloCtrlResult Description
Code
7+10000* PDO Length * Set new COB-ID (11 bits) and LENGHT of PDO.
(SubNode+1) Number 65535+COB
The passed Value must contain in lower 16 bits the new
ID
COB-ID,
The PDO Number is CAN Slave node depending, the numbering is calculated from the PDO Mapping that can be found into
the CAN Slave properties in CODESYS.
The numbering starts from 0 which corresponds to the first Send PDO increasing by 1 for each PDO, the numbering
continues with the Receive PDOs. Please refer to the image below as example for the calculation of PDO numbering.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 105
Internal PLC (CODESYS V2)
8+10000* PDO Any Forces to send the selected PDO; PDO selection depends
(SubNode+1) Number form the ucPDOnr parameter.
Error Codes
The CODESYS Development System allows showing in its status bar some diagnostic message related to the PLC
operation. The following table contains a list of all the possible error codes. Errors marked as “Fatal” are those preventing
the operation of the CANopen I/O driver.
Element Description
0 OK, no errors
4 EXOR.CANopen: (Fatal) [SlotNr] Missing Configuration board (it should be before any CANopen
board)
7 EXOR.CANopen: Node [NodeId] has Guarding Error (toggling bit or status incorrect)
106 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Element Description
Error code 25
In the case the value of Com.CyclePeriod is too low and not all of the PDOs of the previous scan have been transmitted
when a new scan is started, the new scan will only send the SYNC message, while new PDOs and NodeGuarding
messages will not be transmitted. This is to ensure that all previous PDOs can be transmitted. New scans will only
transmit SYNC message until all of the PDOs have been transmitted.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 107
Internal PLC (CODESYS V2)
When the “CAN Master” board is added to project, after first compilation, the library “EXOR_CANopen.lib” is automatically
included, as shown in the following figure.
TYPE GETBUSSTATE :
STRUCT
BOLDENABLE: BOOL;
ENABLE: BOOL;
DRIVERNAME:POINTER TO STRING;
DEVICENUMBER:INT;1\
READY:BYTE;
STATE:INT;
EXTENDEDINFO:ARRAY[0..129] OF BYTE;
END_STRUCT
END_TYPE
where:
Element Description
108 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Element Description
STATE Quick Status: 0 (zero) means OK, other values are error codes, see “ERROR CODES”
table
Bit 3: Node is initialized and without errors (i.e. it's OFF during initialization and
configuration).
To read the CAN Diagnostic informations in the PLC program define a variable of type GETBUSSTATE pointing to the
Diagnostic Address of the CAN Master element, as shown in the following figure.
This GETBUSSTATE user data type complies with the CODESYS V2 standard method of obtaining diagnostic information
from bus I/O, as explained in the CODESYS V2 help.
While in PDO mode the transmission is normally cyclic and automatic, in SDO mode the data exchange is normally done
on purpose. Each session can normally transfer only one data item. This means that the SDO protocol is much slower than
the PDO protocol.
Two Function Blocks are available to configure communication via the SDO protocol.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 109
Internal PLC (CODESYS V2)
EXOR_CAN_SDO_RD
Element Description
wIndex Address of CAN object inside the remote node, as defined by the manufacturer.
Element Description
diErrCod Error code of the operation. It is generated by the client and it is valid only after operation
has been completed. Value 0 means a successful operation.
dwAbortCode Code sent by the server in case the operation is aborted. It is returned by the function
block as received from the remote device, so refer to CAN standard definition or to specific
technical description of the server (remote device).
110 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
EXOR_CAN_SDO_WR
Element Description
wIndex Address of the CAN object inside the remote node, as defined by the manufacturer.
Element Description
diErrCod Error code of the operation. It is generated by the client and it is valid only after operation is
completed. Value 0 means a successful operation.
dwAbortCode Is the code sent by the server in case the operation is aborted. It is reported as received, so
refer to CAN standard definition or to specific technical description of the server.
The possible values for the abort code (see return value dwAbortCod) are shown in the table below.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 111
Internal PLC (CODESYS V2)
Element Description
0604 The number and length of the objects to be mapped would exceed PDO length.
0042h
0607 Data type does not match, length of service parameter does not match
0010h
0607 Data type does not match, length of service parameter too high
0012h
112 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Element Description
0607 Data type does not match, length of service parameter too low
0013h
0800 Data cannot be transferred or stored to the application because of local control.
0021h
0800 Data cannot be transferred or stored to the application because of the present device state.
0022h
0800 Object dictionary dynamic generation fails or no object dictionary is present (e.g. object dictionary
0023h is generated from file and generation fails
Allowed values for data type (refer to input parameter wDataType ) are listed below.
Element Description
0001 BOOLEAN
0002 INTEGER8
0003 INTEGER16
0004 INTEGER32
0005 UNSIGNED8
0006 UNSIGNED16
0007 UNSIGNED32
0008 REAL32
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 113
Internal PLC (CODESYS V2)
The control of the serial ports is done trough some specific Function blocks included into the EXOR_serial library, the
library is installed as part of the Exor Target Support Package.
The CODESYS library manager includes a short help for each Function block included into the library. This chapter
explains EXOR_ser_init Function block, this allows to initialize the serial port for the use trough the internal CODESYS
Plc.
Element Description
eTOP400 serie
1 = PLC port
2 = PC/Printer port
Allowed values are: 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400
0 = None
114 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Element Description
1 = Even
2 = Odd
0 = RS232
1 = RS485/422
Halfduplex Defines use of RTS signal, default value is false, determines the use of RS485 or RS422
This function is included in the library “EXOR.lib” and has the following input parameters:
Element Description
wNodeNumber Each board in the CODESYS V2 PLC Configuration editor has a progressive Node
Number starting from zero; this is assigned by CODESYS and can be seen in the board
“Base Parameters”. This parameter identifies the board to which the “diFunctionCode”
and “diArgument” parameters will be passed.
diFunctionCode This parameter is passed to the specified board; it significance changes from board to
board.
diArgument This parameter is passed to the specified board; its significance varies from board to
board.
Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A. 115
Internal PLC (CODESYS V2)
Element Description
diIoCtrlResult This is the return value; its significance varies from board to board and from FunctionCode
to FunctionCode.
Timer Resolution
The resolution of CODESYS V2 timers is 1 millisecond. When a timer value is defined it is internally translated to the
corresponding number of milliseconds.
The resolution of the internal Real Time Clock is 1 millisecond allowing the maximum resolution of timers. Note that the
execution time of the PLC program may apparently affect the resolution of timers.
116 Internal PLC (CODESYS) | User Manual | v207 (2017-10-13) | EN | © 2009-2017 Exor International S.p.A.
Exor International S.p.A.
Via Monte Fiorino, 9
Internal PLC (CODESYS) 37057 San Giovanni Lupatoto (Verona)
User Manual Italy
[email protected]
2017-10-13 phone: +39 045 8750404
fax: +39 045 8779023
Copyright © 2009-2017