User Manual Xp3xx (Compact PLC With Embedded Io)
User Manual Xp3xx (Compact PLC With Embedded Io)
User Manual Xp3xx (Compact PLC With Embedded Io)
Nexto Xpress
MU216600 Rev. Q
No part of this document may be copied or reproduced in any form without the prior written consent of Altus Sistemas de
Automação S.A. who reserves the right to carry out alterations without prior advice.
According to current legislation in Brazil, the Consumer Defense Code, we are giving the following information to clients
who use our products, regarding personal safety and premises.
The industrial automation equipment, manufactured by Altus, is strong and reliable due to the stringent quality control
it is subjected to. However, any electronic industrial control equipment (programmable controllers, numerical commands,
etc.) can damage machines or processes controlled by them when there are defective components and/or when a programming
or installation error occurs. This can even put human lives at risk. The user should consider the possible consequences of
the defects and should provide additional external installations for safety reasons. This concern is higher when in initial
commissioning and testing.
The equipment manufactured by Altus does not directly expose the environment to hazards, since they do not issue any kind
of pollutant during their use. However, concerning the disposal of equipment, it is important to point out that built-in electronics
may contain materials which are harmful to nature when improperly discarded. Therefore, it is recommended that whenever
discarding this type of product, it should be forwarded to recycling plants, which guarantee proper waste management.
It is essential to read and understand the product documentation, such as manuals and technical characteristics before its
installation or use. The examples and figures presented in this document are solely for illustrative purposes. Due to possible
upgrades and improvements that the products may present, Altus assumes no responsibility for the use of these examples and
figures in real applications. They should only be used to assist user trainings and improve experience with the products and
their features.
Altus warrants its equipment as described in General Conditions of Supply, attached to the commercial proposals.
Altus guarantees that their equipment works in accordance with the clear instructions contained in their manuals and/or
technical characteristics, not guaranteeing the success of any particular type of application of the equipment.
Altus does not acknowledge any other guarantee, directly or implied, mainly when end customers are dealing with third-
party suppliers. The requests for additional information about the supply, equipment features and/or any other Altus services
must be made in writing form. Altus is not responsible for supplying information about its equipment without formal request.
These products can use EtherCAT® technology (www.ethercat.org).
COPYRIGHTS
Nexto, MasterTool, Grano and WebPLC are the registered trademarks of Altus Sistemas de Automação S.A.
Windows, Windows NT and Windows Vista are registered trademarks of Microsoft Corporation.
OPEN SOURCE SOFTWARE NOTICE
To obtain the source code under GPL, LGPL, MPL and other open source licenses, that is contained in this product, please
contact [email protected]. In addition to the source code, all referred license terms, warranty disclaimers and copyright
notices may be disclosed under request.
I
CONTENTS
Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1. Documents Related to this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2. Visual Inspection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3. Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4. Warning Messages Used in this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Technical Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1. Panels and Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2. Product Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.1. General Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3. Standards and Certifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3.1. Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.2. Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3.3. RS-485 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3.4. CAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3.5. USB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3.6. Ethernet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3.7. Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3.8. Digital Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3.9. Fast Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3.10. Digital Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3.11. Fast Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.3.12. Analog Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.3.13. Analog Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4. Compatibility with Other Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5. Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5.1. Interval Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5.2. Application Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.5.3. Time for Instructions Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.5.4. Initialization Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.6. Physical Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.7. Purchase Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.7.1. Integrant Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.7.2. Product Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.8. Related Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3. Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.1. Mechanical Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.1.1. Installing the controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.1.2. Removing the controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
II
CONTENTS
III
CONTENTS
IV
CONTENTS
V
CONTENTS
VI
CONTENTS
VII
CONTENTS
VIII
1. INTRODUCTION
1. Introduction
Nexto Xpress is a powerful compact Programmable Logic Controller (PLC) part of Nexto Series family of controllers and
I/O modules. Nexto Xpress delivers high-speed processing power in a compact design with embedded I/O. There are several
options to choose from, allowing the best solution for entry-level applications.
This product portfolio targets small control systems, offering models containing from a few digital inputs and outputs up
to options with 43 I/O points concentrated in a single controller, including analog inputs and outputs with temperature support
(RTD sensors). In case of additional I/O needs, the system can be easily expanded using expansion modules (see section
Related Products). Additionally, the number of I/O points can be further expanded through remote (distributed) I/O devices
communicating via protocols such as CANopen, EtherNet/IP, PROFINET and MODBUS.
Nexto Xpress is suitable for small applications and remote distributed I/O. It may be applied in verticals such as infrastruc-
ture, building automation, water, wastewater, food, textiles, factory automation, machines and several other OEM solutions,
including motion control applications. The inclusion of an integrated firewall provides enhanced protection and security for
the systems, safeguarding data integrity and mitigating potential cyber threats. Additionally, the controller is an ideal solution
for complementing big applications along with Nexto Series portfolio, extending the range of applications using the same
technology and engineering environment. This is a great advantage for OEMs and systems integrators with needs of small to
large applications.
1
1. INTRODUCTION
2
1. INTRODUCTION
It’s important to register each received equipment serial number, as well as software revisions, in case they exist. This
information is necessary, in case the Altus Technical Support is contacted.
CAUTION
Reports configuration, application or installation details that must be taken into consideration
to avoid any instance that may cause system failure and consequent impact.
ATTENTION
Identifies configuration, application and installation details aimed at achieving maximum
operational performance of the system.
3
2. TECHNICAL DESCRIPTION
2. Technical Description
This chapter presents all technical features of Nexto Xpress controllers.
The front panel contains the identification of the I/O and communication interfaces available on Nexto Xpress controllers.
The digital I/O interfaces have one LED for each point to indicate the logic state, while the communication interfaces have one
LED each to indicate activity. The availability of these interfaces on each model is described on next section.
Additionally, on the right side of front panel there are 2 LEDs used to indicate power and diagnostics. The following table
shows the LEDs description. For further information regarding the LEDs status and meaning, see Maintenance chapter.
LED Description
PWR Status of internal power supply
DG Diagnostic indication
Ixx.x Status of digital inputs
Qxx.x Status of digital outputs
D+/- Status of RS-485 interface (blinks on activity)
H/L Status of CAN interface (blinks on activity)
USB Status of USB port (turns on when device is mounted)
ETH Status of Ethernet interface (turns on when connected, blinks on activity)
4
2. TECHNICAL DESCRIPTION
5
2. TECHNICAL DESCRIPTION
Notes:
V/I analog inputs (AI): By default, each analog input is composed by 2 terminals (AIx.V and AIx.I), and when selecting
one mode (V, for example), the other pin (I, for example) becomes unused. With the function AnalogInputProbe, provided by
the LibIntegratedIoExt library, it is possible to use these free inputs, allowing to have up to 10 analog inputs (5 on terminals
AIx.V and other 5 on terminals AIx.I), with the same technical characteristics informed on this document. For additional
information, please consult the Technical Support.
Motion control: PLCopen Motion Control Part 1 function block support for single-axis control, multi-axis synchroniza-
tion, electronic gearing (CAME), special editor for motion planning (CAM), and others.
Maximum number of tasks: This value represents the maximum total of user and system tasks. The detailed description
of possible user tasks can be found on Project Profiles section of User Manual. Before MasterTool IEC XE v3.30, this value
was defined as “5”.
Isolation: The Logic term refers to the internal interfaces such as processors, memories and USB, serial and CAN com-
munication interfaces.
Conformal coating: Conformal coating protects the electronic components inside the product from moisture, dust and
other harsh elements to electronic circuits.
Operating temperature: The minimum operating temperature is 0°C for units with product revision inferior to AS/AS/AW/AE
for XP300/XP315/XP325/XP340 respectively.
6
2. TECHNICAL DESCRIPTION
2014/30/EU (EMC)
2014/35/EU (LVD)
2011/65/EU and 2015/863/EU (ROHS)
TR 004/2011 (LVD)
CU TR 020/2011 (EMC)
7
2. TECHNICAL DESCRIPTION
2.3.1. Memory
Table 5: Memory
Note:
Program memory: From version 3.40 of MasterTool IEC XE, the memory has been increased from 2MB to 3MB in the
XP300, XP315, and XP325 models, and from 6MB to 8MB in the XP340 model.
Persistent and Retain symbolic variables memory: Area where the retentive/persistent symbolic variables are allocated.
The controller performs retentive/persistent cyclic saves every 5 seconds.
ATTENTION
The declaration and use of symbolic persistent variables should be performed exclusively
through the Persistent Vars object, which may be included in the project through the tree
view in Application -> Add Object -> Persistent Variables. It should not be used the VAR
PERSISTENT expression in the declaration of field variables of POUs.
Retentive/persistent symbolic memory variables full behaviour can be found in the following table where "X" means that
memory data is safe under the presented scenario while "-" means data loss.
8
2. TECHNICAL DESCRIPTION
2.3.2. Protocols
Interface
Open Protocol COM 1 / USB
MODBUS RTU Master COM 1
MODBUS RTU Slave COM 1
MODBUS TCP Client NET 1
MODBUS TCP Server NET 1
MODBUS RTU over TCP Client NET 1
MODBUS RTU over TCP Server NET 1
CANopen Master CAN
CANopen Slave CAN
(except XP350)
CAN low level CAN
SAE J-1939 CAN
OPC DA Server NET 1 / USB
OPC UA Server NET 1 / USB
EtherCAT Master NET 1
SNMP Agent NET 1 / USB
IEC 60870-5-104 Server NET 1
(only XP340)
EtherNet/IP Scanner NET 1
EtherNet/IP Adapter NET 1
MQTT Client NET 1 / USB
SNTP Client (for clock synchronism) NET 1 / USB
PROFINET Controller NET 1
PROFINET Device -
OpenVPN Client NET 1 / USB
OpenVPN Server NET 1 / USB
FTP Server NET 1 / USB
Table 7: Protocols
Notes:
USB: Need to use Serial Converter, WiFi, Modem or Ethernet Adapter.
PROFINET Controller: Enabled for use on a simple (not ring) network with up to 8 devices. For larger applications,
consult technical support.
9
2. TECHNICAL DESCRIPTION
2.3.3. RS-485
RS-485
Connector 3-pin terminal block
Physical interface RS-485
Communication direction RS-485: half duplex
RS-485 max. transceivers 32
Termination Yes (Configurable)
Baud rate 2400, 4800, 9600, 19200, 38400, 57600, 115200 bps
2.3.4. CAN
CAN
Connector 3-pin terminal block
Physical interface CAN bus
Supported standards CAN 2.0A 2.0B (11-bit and 29-bit identifiers)
Max. number of nodes 64
Termination Yes (Configurable)
Baud rate 10, 20, 50, 100, 125, 250, 500, 800, 1000 kbit/s
2.3.5. USB
USB
Connector USB A Female
Physical interface USB V2.0
1.5 Mbps (Low Speed), 12 Mbps (Full Speed) and 480 Mbps
Baud rate
(High Speed)
Maximum current 500 mA
Supported devices Mass storage
USB RS-232 Serial Converter
USB 3G/4G Modem
USB WiFi Adapter
USB Ethernet Adapter
Notes:
USB RS-232 Serial Converter: See the list of supported devices on respective section USB to RS-232 Converters.
USB 3G/4G Modem: See the list of supported devices on respective section Modem Devices.
USB WiFi Adapter: See the list of supported devices on respective section WiFi Adapters.
USB Ethernet Adapter: See the list of supported devices on respective section Ethernet Adapters.
10
2. TECHNICAL DESCRIPTION
2.3.6. Ethernet
Ethernet
Connector Shielded female RJ45
Auto crossover Yes
Maximum cable length 100 m
Cable type UTP or ScTP, category 5
Baud rate 10/100 Mbps
Physical layer 10/100 BASE-TX
Data link layer LLC
Network layer IP
Transport layer TCP (Transmission Control Protocol)
UDP (User Datagram Protocol)
Diagnostics LED (Link/Activity)
Power Supply
Nominal input voltage 24 Vdc
Input voltage 19.2 to 30 Vdc
Maximum input current (in-rush) 50 A / 300 us
Maximum input current 300 mA
Digital Inputs
Input type Optoisolated sink type 1
Two isolated groups of 8 inputs each
24 Vdc
Input voltage 15 to 30 Vdc for logic level 1
0 to 5 Vdc for logic level 0
Input impedance 4.95 kΩ
Maximum input current 6.2 mA @ 30 Vdc
Input state indication Yes
Response time 0.1 ms
Input filter Disabled or 2 ms to 255 ms – by software
Note:
Input filter: The filter sampling is performed on MainTask (or Refresh function), then it’s recommended to use multiple
values of the task interval.
11
2. TECHNICAL DESCRIPTION
Fast Inputs
4 (can be used as high-speed counter, External interrupt
Number of fast inputs
or normal input)
Max. number of high-speed
1
counters
Max. number of external inter-
2
rupts
Connector configuration I00, I01, I02 and I03
24 Vdc
Input voltage 15 to 30 Vdc for logic level 1
0 to 5 Vdc for logic level 0
Input impedance 1.85 kΩ
Input maximum current 16.2 mA @ 30 Vdc
1-input modes
Normal digital input
External interrupt
Configuration mode 2-input modes
Up/Down (A count, B direction) with zero (uses I00,
I01, I02)
Quadrature 2x (uses I00, I01)
Quadrature 2x with zero (uses I00, I01, I02)
Quadrature 4x (uses I00, I01)
Quadrature 4x with zero (uses I00, I01, I02)
Counting direction control Hardware only
Rising edge, active at logic level 1 (except for quadrature
Counting input detection edge
4x, where it counts on both edges)
Data format Signed 32-bit integer
Operation limit From - 2,147,483,648 to 2,147,483,647
Maximum input frequency 100 kHz
Minimum pulse width
@ 24 Vdc 2 µs
Digital Outputs
Output type Optoisolated transistor source type
Maximum output current 1.5 A per output
12 A total
Leakage current 35 µA
On state resistance 105 mΩ
External power supply 19.2 to 30 Vdc
Switching time 20 µs - off-to-on transition @ 24 Vdc
500 µs - on-to-off transition @ 24 Vdc
Maximum switching frequency 250 Hz
12
2. TECHNICAL DESCRIPTION
Digital Outputs
Configurable parameters Yes
Output state indication Yes
Output protections Yes, protection against surge voltages
Note:
Switching time: The required time to turn off one specific output depends on the load.
Fast Outputs
Number of outputs 4 (can be used as VFO/PWM, PTO or normal output)
Max. number of PTO outputs 2
4 when using no PTO
Max number of VFO/PWM out-
2 when using 1 PTO
puts
0 when using 2 PTO
Connector configuration Q14, Q15, Q16 and Q17
0 to 500 Hz: 1.5A per output / 6.0A total
Maximum current
500 to 200 KHz: 0.5A per output / 2.0A total
Output type Transistor source
Pulse generation maximum fre-
200 kHz @ 60 mA
quency
Minimum pulse width MINIMUM LOAD MINIMUM PULSE TIME
@ 24 Vdc 400 Ω 320 ns
State indication Through static reserved operands
Protections TVS diode at all transistor outputs
Operation voltage 19.2 to 30 Vdc
Output impedance 700 mΩ
Normal digital output
VFO/PWM
Output modes
PTO (Q14 and Q16 only. Adjacent output is forced to normal
digital output)
PTO VFO/PWM
Writing of the frequency
Writing of number of pulses
Functions executed by software value to be generated (1 Hz
to be generated
to 200 kHz).
Writing of acceleration
Writing of outputs duty cy-
and deceleration number of
cle (1% to 100%)
pulses
Start/end of outputs opera-
Start/end outputs operation
tions
Fast outputs diagnostics Fast outputs diagnostics.
Fast outputs current state
monitoring
13
2. TECHNICAL DESCRIPTION
Analog Inputs
Voltage or current input, single ended, individually config-
Input type
ured
Data format 16 bits in two’s complement, justified to the left
Converter resolution 12 bits monotonicity guaranteed, no missing codes
Conversion time 400 µs (all V/I and RTD channels enabled)
Input state indication Yes
Module protections Yes, protection against surge voltages and polarity inversion
Note:
Input ranges: When configured as 4 to 20 mA, input signals lower than 4 mA will result in negative values (-7,500 for
0 mA). Starting from MasterTool IEC XE version 3.16, a new parameter called Open Loop Value was included to select the
behavior in this situation. The default value is Disabled (which provides a linear reading as described above), having also the
option to provide a fixed reading equal to lower and upper limits ("0" or "30000").
14
2. TECHNICAL DESCRIPTION
RTD Input
Precision ±0.5 % of full scale @ 25 ◦ C
Supported scales Pt100, Pt1000, 0 to 400 Ω, 0 to 4000 Ω
Excitation current 1 mA
Resistance range (scale) 0 to 400 Ω (used for PT100)
0 to 4000 Ω (used for PT1000)
Over Scale 5 % of full scale
Configurable parameters Signal type per input
Filters
Low pass filter time constant 100 ms, 1 s, 10 s or disabled
Maximum sensor cable impedance (per
5Ω
wire)
Analog Outputs
Output type Voltage or current output, individually configured
Data format 16 bits in two’s complement, justified to the left
Converter resolution 12 bits monotonicity guaranteed, no missing codes
Update time 450 µs (all outputs enabled)
Output state indication Yes
Module protections Yes, protection against surge voltages and polarity inversion
15
2. TECHNICAL DESCRIPTION
Note:
Output ranges: When configured as 4 to 20 mA, the output can be set to values lower than 4 mA by assigning negative
values to the output variable (-7,500 for 0 mA).
Additionally, along the development roadmap of MasterTool IEC XE some features may be included (like special Func-
tionBlocks, etc...), which can introduce a requirement of minimum firmware version. During the download of the application,
MasterTool IEC XE checks the firmware version installed on the controller and, if it does not meets the minimum requirement,
will show a message requesting to update. The latest firmware version can be downloaded from Altus website, and it is fully
compatible with previous applications.
2.5. Performance
The performance of Nexto Xpress controller relies on:
Application Interval Time
User Application Time
Operational System Time
Number of integrated I/O channels enabled
16
2. TECHNICAL DESCRIPTION
The below table presents the necessary execution time for different instructions in Nexto Xpress CPUs.
17
2. TECHNICAL DESCRIPTION
18
2. TECHNICAL DESCRIPTION
Code Description
High-Speed Compact PLC with 16 DI, 16 DO Transistor, 1 Ethernet, 1
XP300
RS-485 Serial and CANopen Master
High-Speed Compact PLC with 16 DI, 16 DO Transistor, 5 V/I AI, 2
XP315
RTD AI (3 wire), 1 Ethernet, 1 RS-485 Serial and CANopen Master
High-Speed Compact PLC with 16 DI, 16 DO Transistor, 5 V/I AI, 2
XP325 RTD AI (3 wire), 4 AO, 1 Ethernet, 1 RS-485 Serial and CANopen
Master
High-Speed Compact PLC with 16 DI, 16 DO Transistor, 5 V/I AI, 2
XP340 RTD AI (3 wire), 4 AO, 1 Ethernet, 1 RS-485 Serial, CANopen Master
and user web pages support
High-Speed Compact PLC with motion control support, 16 DI, 16 DO
XP350 Transistor, 5 V/I AI, 2 RTD AI (3 wire), 1 Ethernet, 1 RS-485 Serial
and CANopen Master
Code Description
MT8500 MasterTool IEC XE
NX9202 RJ45-RJ45 2 m Cable
NX9205 RJ45-RJ45 5 m Cable
NX9210 RJ45-RJ45 10 m Cable
AL-2600 RS-485 network branch and terminator
AL-2306 RS-485 cable for MODBUS or CAN network
AL-1766 CFDB9-Terminal Block Cable
FBS-USB-232M9 Universal USB-Serial converter cable / 2m
TP-Link nano Wireless 150 Mbps USB Adapter TL-
XP900
WN725N (only available in Brazil)
AMJG0808 Simple cable RJ45-RJ45 2 m
XP101 Nexto Xpress Expansion, 16 DI 24 Vdc
XP106 Nexto Xpress Expansion, 8 DI 24 Vdc and 6 DO Relay
19
2. TECHNICAL DESCRIPTION
Code Description
XP201 Nexto Xpress Expansion, 16 DO Transistor
TLE3-21100 Gateway IoT Industrial
Notes:
MT8500: MasterTool IEC XE is available in four different versions: LITE, BASIC, PROFESSIONAL and ADVANCED.
For more details, please check MasterTool IEC XE User Manual - MU299609.
NX92xx: Cable for programming the CPUs of the Nexto Series and Ethernet point-to-point with another device with
Ethernet interface communication.
AL-2600: This module is used for branch and termination of RS-485 networks. For each network node, an AL-2600 is
required. The AL-2600 that are at the ends of network must be configured with termination, except when there is a device with
active internal termination, the rest must be configured without termination.
AL-2306: Two shielded twisted pairs cable without connectors, used for networks based on RS-485 or CAN.
AL-1766: Cable with a female DB9 connector and terminals for communication between HMI P2 and Nexto Xpress/NX3003
controllers.
FBS-USB-232M9: Cable for use as a USB-Serial converter on the USB interface of Xpress controllers.
AMJG0808: Cable for programming the CPUs.
XP101 / XP106 / XP201: CANopen expansion modules.
20
3. INSTALLATION
3. Installation
This chapter presents the necessary proceedings for the physical installation of Nexto Xpress controllers, as well as the
care that should be taken with other installation within the panel where the controller is been installed.
CAUTION
If the equipment is used in a manner not specified by in this manual, the protection provided
by the equipment may be impaired.
ATTENTION
For marine applications, additionally to the standard instructions described on this chapter,
the following installation requirements shall be met:
The product shall be installed in a metallic cabinet.
The 24 Vdc power supply port shall be equipped with a filter TDK-Lambda model
RSMN-2003 or equivalent.
The cables of all ports (power, I/O and communication) shall be equipped with a pair
of low/high frequency ferrites Wurth Electronics 74272221/74271221 or equivalent.
21
3. INSTALLATION
Next, place the controller on the DIN rail fitting the top side first and then the bottom side, as indicated on steps 1 and 2 of
the figure below:
22
3. INSTALLATION
Finally, move the two locks to closed position to lock the controller on the DIN rail, as shown on the figure below:
23
3. INSTALLATION
24
3. INSTALLATION
Diagram Notes:
External power supply to supply outputs Q00 to Q17, terminals Q + must be connected to +24 Vdc, and terminal
Q- must be connected to 0 Vdc.
Protective Earth terminals for power supply and communication ports. Both shall be externally connected to
ground.
Please check the technical characteristics table of USB port for the list of supported devices.
Typical connection of digital input (sink type). C0 and C1 are the common points for the isolated groups I0x and
I1x respectively.
Typical connection of current analog input (field device with power supplied separately from analog signal).
Typical connection of current analog input (field device with power supplied with the analog signal, 2-wire).
25
3. INSTALLATION
3.3.1. IP Address
The Ethernet interface comes with the following default parameters configuration:
NET 1
IP Address 192.168.15.1
Subnet Mask 255.255.255.0
Gateway Address 192.168.15.253
First, the NET 1 interface must be connected to a PC network with the same subnet mask to communicate with MasterTool
IEC XE, where the network parameters can be modified. For further information regarding configuration and parameters
modifications, see Ethernet Interface chapter.
26
3. INSTALLATION
The interface can be connected in a communication network through a hub or switch, or straight from the communication
equipment. In this last case, due to Auto Crossover feature, there is no need for a cross-over network cable, the one used to
connect two PCs point to point via Ethernet port.
It is important to stress that it is understood by network cable a pair of RJ45 male connectors connected by a UTP or ScTP
cable, category 5 whether straight connecting or cross-over. It is used to communicate two devices through the Ethernet port.
These cables normally have a connection lock which guarantees a perfect connection between the interface female con-
nector and the cable male connector. At the installation moment, the male connector must be inserted in the module female
connector until a click is heard, assuring the lock action. To disconnect the cable from the module, the lock lever must be used
to unlock one from the other.
27
4. INITIAL PROGRAMMING
4. Initial Programming
The main goal of this chapter is to help the programming and configuration of Nexto Xpress controllers, allowing the user
to take the first steps before starting to program the device.
Just like for the other devices of Nexto Series, the programming of Nexto Xpress controllers is made through the MasterTool
IEC XE (IDE) development interface, which offers a full IEC 61131-3 programming system with all languages defined by this
standard (ST, LD, SFC, FBD, etc...) plus an additional one, the CFC. These languages can be used simultaneously on the same
project, allowing the user to use the best features of each language, resulting in more efficient applications development, for
easy documentation and future maintenance.
For further information regarding programming, see User Manual MasterTool IEC XE - MU299609, Programming Manual
MasterTool IEC XE - MU399609 or IEC 61131-3 standard.
28
4. INITIAL PROGRAMMING
SIGNIFICANCE OVERLAPPING
%QX0.7
%QX0.6
%QX0.5
%QX0.4 %QB %QB00
%QX0.3 00
%QX0.2
%QX0.1
%QX0.0 %QW %QW
%QX1.7 00 00
%QX1.6
%QX1.5
%QX1.4 %QB %QB01
%QX1.3 01
MSB %QX1.2
%QX1.1
⇑ %QX1.0 %QD %QW %QD
%QX2.7 00 01 00
LSB %QX2.6
%QX2.5
%QX2.4 %QB %QB02
%QX2.3 02
%QX2.2
%QX2.1
%QX2.0 %QW %QW %QD
%QX3.7 02 02 01
%QX3.6
%QX3.5
%QX3.4 %QB %QB03
%QX3.3 03
%QX3.2
%QX3.1
%QX3.0 %QL %QW %QD
%QX4.7 00 03 02
%QX4.6
%QX4.5
%QX4.4 %QB %QB04
%QX4.3 04
%QX4.2
%QX4.1
%QX4.0 %QW %QW %QD
%QX5.7 04 04 03
%QX5.6
%QX5.5
%QX5.4 %QB %QB05
%QX5.3 05
MSB %QX5.2
%QX5.1
⇑ %QX5.0 %QD %QW %QD
%QX6.7 04 05 04
LSB %QX6.6
%QX6.5
%QX6.4 %QB %QB06
%QX6.3 06
%QX6.2
%QX6.1
%QX6.0 %QW %QW
%QX7.7 06 06
%QX7.6
%QX7.5
%QX7.4 %QB %QB07
%QX7.3 07
%QX7.2
%QX7.1
%QX7.0
29
4. INITIAL PROGRAMMING
Also, this profile supports the inclusion of additional tasks associated to counter and external interruptions, resulting in a
maximum of 5 tasks for user application.
ATTENTION
The suggested POU names associated with the tasks are not consisted. They can be changed,
as long as they are also changed in the tasks configurations.
30
4. INITIAL PROGRAMMING
Besides that, by double-clicking on controller’s NET 1 icon, it’s possible to configure the Ethernet interface that will be
used for communication between the controller and the software MasterTool IEC XE.
31
4. INITIAL PROGRAMMING
The configuration defined on this tab will be applied to the device only when sending the application to the device (down-
load), which is described further on sections Finding the Device and Login.
Additionally, the device tree also offers the configuration of the integrated I/O available on Nexto Xpress controllers, as
shown on the figure below. In this tab it is possible to configure digital inputs filters, the mode of each analog input, among
other parameters.
32
4. INITIAL PROGRAMMING
4.4. Libraries
There are several programming tool resources which are available through libraries. Therefore, these libraries must be
inserted in the project so its utilization becomes possible. The insertion procedure and more information about available
libraries may be found in the MasterTool Programming Manual – MP399609.
33
4. INITIAL PROGRAMMING
After that, the list of protocols will appear on the screen. Simply select MODBUS Symbol Server as described on the
figure below:
34
4. INITIAL PROGRAMMING
If there is no gateway previously configured, it can be included by the button Add gateway, using the default IP address
localhost to use the gateway resident on the station or changing the IP address to use the device internal gateway.
Next, the desired controller must be selected by clocking on Set active path clicked. This action selects the controller and
informs the configuration software which controller shall be used to communicate and send the project.
35
4. INITIAL PROGRAMMING
Additionally, the user can change the default name of the device that is displayed. For that, you must click the right mouse
button on the desired device and select Change Node Name. After a name change, the device will not return to the default
name under any circunstances.
In case the Ethernet configuration of the controller to be connected is in a different network from the Ethernet interface
of the station, the software MasterTool IEC XE will not be able to find the device. In this case, it’s recommended to use the
command Easy Connection located on Online menu.
36
4. INITIAL PROGRAMMING
This command performs a MAC level communication with the device, allowing to permanently change the configuration of
the controller’s Ethernet interface, independently of the IP configuration of the station and from the one previously configured
on the device. So, with this command, it’s possible to change the device configuration to put it on the same network of
the Ethernet interface of the station where MasterTool IEC XE is running, allowing to find and select the device for the
communication. The complete description of Easy Connection command can be found on User Manual of MasterTool IEC
XE code MU299609.
4.7. Login
After compiling the application and fixing errors that might be found, it’s time to send the project to the controller. To do
this, simply click on Login command located on Online menu of MasterTool IEC XE as shown on the following figure. This
operation may take a few seconds, depending on the size of the generated file.
After the command execution, some user interface messages may appear, which are presented due to differences between
an old project and the new project been sent, or simply because there was a variation in some variable.
If the Ethernet configuration of the project is different from the device, the communication may be interrupted at the end of
download process when the new configuration is applied on the device. So, the following warning message will be presented,
asking the user to proceed or not with this operation:
37
4. INITIAL PROGRAMMING
If there is already an application on the controller, depending on the differences between the projects, the following options
will be presented:
Login with online change: execute the login and send the new project without stopping the current controller application
(see Run Mode item), updating the changes when a new cycle is executed
Login with download: execute the login and send the new project with the controller stopped (see Stop Mode item).
When the application is initiated, the update will have been done already
Login without any change: executes the login without sending the new project
ATTENTION
In the online changes is not permitted to associate symbolic variables mapping from a global
variable list (GVL) and use these variables in another global variable list (GVL).
If the new application contains changes on the configuration, the online change will not be possible. In this case, the
MasterTool IEC XE requests whether the login must be executed as download (stopping the application) or if the operation
must be canceled, as shown on the following figure.
PS.: The button Details... shows the changes made in the application.
38
4. INITIAL PROGRAMMING
Finally, at the end of this process the MasterTool IEC XE offers the option to transfer (download) the source code to the
internal memory of the device, as shown on the following figure:
Transfering the source code is fundamental to ensure the future restoration of the project and to perform modifications on
the application that is loaded into the device.
39
4. INITIAL PROGRAMMING
Figure 25 shows the application in execution. In case the POU tab is selected, the created variables are listed on a monitor-
ing window, in which the values can be visualized and forced by the user.
If the controller already have a boot application internally stored, it goes automatically to Run Mode when the device is
powered on, with no need for an online command through MasterTool IEC XE.
40
4. INITIAL PROGRAMMING
In case the controller is initialized without the stored application, it automatically goes to Stop Mode, as it happens when a
software exception occurs.
ATTENTION
When a controller is with forced variables and it is de-energized, the variables will lose the
forcing in the next initialization.
The limit of forcing for all models of Nexto controllers is 128 variables.
4.11. Logout
To finalize the online communication with the controller, the command Logout must be executed, located in the Online
menu, as shown on Figure 27.
41
4. INITIAL PROGRAMMING
Next, just select the desired controller and click OK as shown on Figure 29.
42
4. INITIAL PROGRAMMING
To ensure that the project loaded in the controller is identical and can be accessed in other workstations, consult the
chapter Projects Download/Login Method without Project Differences at the MasterTool IEC XE User Manual MT8500 -
MU299609.
ATTENTION
The memory size area to store a project in the Nexto Xpress controller is defined on General
Features table.
ATTENTION
The Upload recovers the last project stored in the controller as described in the previous
paragraphs. In case only the application was downloaded, without transfering its source
code, it will not be possible for it to be recovered by the Upload procedure.
4.13.2. Stop
When a CPU is in Stop mode, all application tasks are stopped. The variable values in the tasks are kept with the current
value and output points go to the safe state.
When a CPU goes to the Stop mode due to the download of an application, the variables in the application tasks will be
lost except the persistent variables type.
43
4. INITIAL PROGRAMMING
4.13.3. Breakpoint
When a debugging mark is reached in a task, it is interrupted. All the active tasks in the application will not be interrupted,
continuing their execution. With this feature, it’s possible to go through and investigate the program flow step by step in Online
mode according to the positions of the interruptions included through the editor.
For further information about the use of breakpoints, please consult the MasterTool IEC XE Utilization Manual - MU299609.
4.13.4. Exception
When a CPU is in Exception it indicates that some improper operation occurred in one of the application active tasks. The
task which caused the Exception will be suspended and the other tasks will pass for the Stop mode. It is only possible to take
off the tasks from this state and set them in execution again after a new CPU start condition. Therefore, only with a Reset
Warm, Reset Cold, Reset Origin or a CPU restart puts the application again in Run mode.
44
4. INITIAL PROGRAMMING
PROGRAM MainPrg
VAR
isFirstCycle : BOOL := TRUE;
END_VAR
IF isFirstCycle THEN
StartPrg();
isFirstCycle := FALSE;
ELSE
UserPrg();
END_IF;
MainPrg call other two POUs of program type, named StartPrg and UserPrg. While the UserPrg is always called, the
StartPrg is only called once in the PLC application start.
Differently from the MainPrg program, that must not be modified, the user can change the StartPrg and UserPrg programs.
Initially, when the project is created from the wizard, these two programs are created empty, but the user might insert code in
them.
45
4. INITIAL PROGRAMMING
The following picture shows an example of the presentation of this GVL when in Online mode.
46
4. INITIAL PROGRAMMING
Where:
Device name: Name that shows on TreeView to the MODBUS device.
Requisition Number: Requisition number that was declared on the MODBUS device requisition table following the
sequence from up to down, starting on 0001.
Example:
Device.Application.Disables
VAR_GLOBAL
MODBUS_Device_DISABLE_0001 : BOOL;
MODBUS_Device_DISABLE_0002 : BOOL;
MODBUS_Device_DISABLE_0003 : BOOL;
MODBUS_Device_1_DISABLE_0001 : BOOL;
MODBUS_Device_1_DISABLE_0002 : BOOL;
END_VAR
The automatic generation through button Generate Disabling Variables only create variables, and don’t remove automati-
cally. This way, in case any relation is removed, its respective disabling variable must be removed manually.
The Disables GVL is editable, therefore the requisition disabling variables can be created manually without need of fol-
lowing the model created by the automatic declaration and can be used both ways at same time, but must always be of BOOL
type. And it is need to take care to do not delete or change the automatic declared variables, cause them can being used for
some MODBUS device. If the variable be deleted or changed then an error is going to be generated while the project is being
47
4. INITIAL PROGRAMMING
compiled. To correct the automatically declared variable name, it must be followed the model exemplified above according to
the device and the requisition to which they belong.
The following picture shows an example of the presentation of this GVL when in Online mode. If the variable values are
TRUE it means that the requisition to which the variables belongs is disabled and the opposite is valid when the variable value
is FALSE.
Where:
Device Name: Name that appear at the Tree View to the device.
Mapping Number: Number of the mapping that was declared on the device mapping table, following the up to down
sequence, starting with 0001.
ATTENTION
It is not possible to associate quality variables to the direct representation MODBUS Master/-
Client drivers’ mappings. Therefor it is recommended the use of symbolic mapping MOD-
BUS drivers.
Examples:
Device.Application.Qualities
VAR_GLOBAL
MODBUS_Device_QUALITY_0001: LibDataTypes.QUALITY;
MODBUS_Device_QUALITY_0002: LibDataTypes.QUALITY;
MODBUS_Device_QUALITY_0003: LibDataTypes.QUALITY;
END_VAR
The Quality GVL, is editable, therefore the mapping quality variables can be created manually without need to follow the
automatic declaration model, and can be used both ways at same time. But must always be of LibDataTypes.QUALITY type
and take care to don’t delete or change a variable automatically declared, because they might being used by some device. If the
variable be deleted or changed an error is going to be generated while the project is being compiled. To correct the automatically
48
4. INITIAL PROGRAMMING
declared variable name, it must be followed the model exemplified above according to the device and the requisition to which
they belong.
To the MODBUS communication devices the quality variables behave on the way showed at Table 40.
ATTENTION
If a symbolic mapping MODBUS Client/Master driver’s variable be mapped in Server IEC
60870-5-104 driver, it is necessary that the MODBUS mapping quality variables had been
created to generate valid quality events to such Server IEC 60870-5-104 points. Case op-
posite, aren’t going to be generated “bad” quality events to Server IEC60870-5-104 clients
in the situations that MODBUS Master/Client can’t communicate with its slaves/servers, by
example.
The following picture shows an example of the presentation of this GVL when in Online mode.
49
4. INITIAL PROGRAMMING
Where:
Device Name: Name that appear at the TreeView to the device.
Mapping Number: Number of the mapping that was declared on the device mapping table, following the up to down
sequence, starting with 0001.
Variable Type: NXMODBUS_DIAGNOSTIC_STRUCTS.
T_DIAG_MODBUS_RTU_MAPPING_1 to MODBUS Master and
NXMODBUS_DIAGNOSTIC_STRUCTS.
T_DIAG_MODBUS_ETH_MAPPING_1 to MODBUS Client.
ATTENTION
The requisition diagnostics variables of direct mapping MODBUS Master/Client are de-
clared at System_Diagnostics GVL.
Example:
Device.Application.ReqDiagnostics
VAR_GLOBAL
MODBUS_Device_REQDG_0001 : NXMODBUS_DIAGNOSTIC_STRUCTS.
T_DIAG_MODBUS_RTU_MAPPING_1;
MODBUS_Device_REQDG_0002 : NXMODBUS_DIAGNOSTIC_STRUCTS.
T_DIAG_MODBUS_RTU_MAPPING_1;
MODBUS_Device_REQDG_0003 : NXMODBUS_DIAGNOSTIC_STRUCTS.
T_DIAG_MODBUS_RTU_MAPPING_1;
MODBUS_Device_1_REQDG_0001 : NXMODBUS_DIAGNOSTIC_STRUCTS.
T_DIAG_MODBUS_ETH_MAPPING_1;
MODBUS_Device_1_REQDG_0002 : NXMODBUS_DIAGNOSTIC_STRUCTS.
T_DIAG_MODBUS_ETH_MAPPING_1;
END_VAR
The ReqDiagnostics GVL is editable, therefore the requisitions diagnostic variables can be manually created without need
to follow the model created by the automatic declaration. Both ways can be used at same time, but the variables must always
be of type reffering to the device. And take care to don’t delete or change a variable automatically declared, because they might
being used by some device. If the variable be deleted or changed an error is going to be generated while the project is being
compiled. To correct the automatically declared variable name, it must be followed the model exemplified above according to
the device and the requisition to which they belong.
The following picture shows an example of the presentation of this GVL when in Online mode.
50
4. INITIAL PROGRAMMING
51
5. CONFIGURATION
5. Configuration
The Nexto Xpress controllers are configured and programmed through the MasterTool IEC XE software. The configura-
tion defines the behavior and utilization modes for peripherals use and special features of the controller. The programming
represents the application developed by the user, also known as Application.
52
5. CONFIGURATION
Notes:
SNTP Server: It is possible to define a preferential address and another secondary one in order to access a SNTP server
and, therefore, to obtain a synchronism of time. If both fields are empty, the SNTP service will remain disabled.
Time zone: The time zone configuration is used to convert the local time into UTC and vice versa. While some sync
sources use the local time (IEC 60870-5-104 protocol, SetDateAndTime Function), others use the UTC time (SNTP). The UTC
time is usually used to stamp events (IEC 60870-5-104 protocol and MasterTool Device LOG), while the local time is used by
anothers CPU’s features (GetDateAndTime function).
It is allowed to enable more than one sync source on the project, however the device doesn’t supports the synchronism from
more than one sync source during operation. Therefore there is implicitly defined a priority mechanism. The synchronism
through SNTP is more prioritary than through IEC 60870-5-104 protocol. So, when both sources are enabled and SNTP server
is present, it is going to be responsible for the CPU’s clock sync, and any sync command from IEC 60870-5-104 is going to be
denied.
In case the synchronism is through IEC 60870-5-104 protocol, the user must enable the time sync at the protocol con-
figuration screen to receive the clock synchronization. To set this option on the device, check the parameter Enable Time
Synchronization available at the Application Layer section.
53
5. CONFIGURATION
ATTENTION
If the PLC receives a time sync command from the control center, and this option is disabled,
an error answer will be returned to that command. But if this option is enabled then a success
message will be returned to the control center, even that the sync command be discarded for
there is another synchronism method active with higher priority.
This synchronism method should be used only as an auxiliary synchronism method, once the precision of the clock sync
process depends a lot on delays and traffic on the network, as well as the processor load on the CPU, as this mechanism is
treated by a low priority task.
5.1.2.2. SNTP
When enabled, the controller will behave as a SNTP client, which is, it will send requests of time synchronization to
a SNTP/NTP server which can be in the local net or in the internet. The SNTP client works with a 1 ms resolution. The
precision of the time sync through SNTP depends on the protocol configurations (minimum error to clock update) and the
features of the Ethernet network where it is, if both client and server are in the same network (local) or in different networks
(remote). Typically the precision is in tens of milliseconds order.
The controller sends the cyclic synchronization requests according to the time set in the SNTP Synchronization Period
field. In the first synchronization attempt, just after the service start up, the request is for the first server set in the first server IP
address. In case it does not respond, the requests are directed to the second server set in the second server IP address providing
a redundancy of SNTP servers. In case the second server does not respond either, the same process of synchronization attempt
is performed again but only after the Period of Synchronization having been passed. In other words, at every synchronization
period the controller tries to connect once in each server, it tries the second server in case the first one does not respond. The
waiting time for a response from the SNTP server is defined by default in 5 s and it cannot be modified.
If, after a synchronization, the difference between the current time of the controller and the one received by the server is
higher than the value set in the Minimum Error Before Clock Update parameter, the controller time is updated.
SNTP uses the time in the UTC (Universal Time Coordinated) format, so the Time zone parameter needs to be set correctly
so the time read by the SNTP will be properly converted to a local time.
The execution process of the SNTP client can be exemplified with the following steps:
1. Attempt of synchronization through the first server. In case the synchronization occurs successfully, the controller waits
the time for a new synchronization (Synchronization Period) and will synchronize again with this server, using it as a
primary server. In case of failure (the server does not respond in less than 5 s) step 2 is performed.
2. Attempt of synchronization through the second server. In case the synchronization occurs successfully, the controller
waits the time for a new synchronization (Synchronization Period) and will try to synchronize with this server using the
primary server. In case of failure (the server does not respond in less than 5 s) the time relative to the Synchronization
Period is waited and step 1 is performed again.
As the waiting time for the response of the SNTP server is 5 s, the user must pay attention to lower than 10 s values for the
Synchronization Period. In case the primary server does not respond, the time for the synchronization will be the minimum
of 5 s (waiting for the primary server response and the synchronization attempt with secondary server). In case neither the
primary server nor the secondary one responds, the synchronization time will be 10 s minimum (waiting for the two servers
response and the new connection with first server attempt).
ATTENTION
The SNTP Service depends on the user application only for its configuration. Therefore,
this service will be performed even when the controller is in STOP or BREAKPOINT modes
since there is an application in the controller with the SNTP client enabled and properly set.
The DST configuration must be done indirectly through the function SetTimeZone, which changes the time zone applied to
the RTC. In the beginning of the DST, it has to be used a function to increase the time zone in one hour. At the end of the DST,
it is used to decrease it in one hour.
For further information, see the section RTC Clock of this manual.
54
5. CONFIGURATION
which the value and the quality are calculated internally by the user application, that is, they don’t have an external origin like
occur with points linked to IEDs (Communication drivers of type Master/Client).
This Internal Points configuration tab’s function is to relate the variable which represents a point’s value with the one
which represents its quality. It must be used to relate value and quality variables internally created on the PLC program ( as in
a GVL), which ones typically will be afterlly mapped to a communication driver, of type Server, for communication with the
control center.
ATTENTION
If a value variable doesn’t own a related quality variable, it will be reported as default a
constant good quality (no significant indication) when the value variable is reported to a
client or control center.
In this way, this tab purpose isn’t to create or declare internal points. To do that, just declare value and/or quality variables
in a GVL and map it on the communication driver.
The internal points configuration, shown in the figure below, follow the parameters described in the table below. It’s
possible to configure up to 5120 entries on Internal Points table.
55
5. CONFIGURATION
The internal point’s quality is a trust level information about the value stored on that point. The quality may inform, for
example, that the value stored is out of range, or yet that it is valid, but low trusted.
The Standards like IEC 104 have their own formats to representation of point’s quality information. The Nexto Series,
by its turn, have its own quality format (but quite similar to IEC 61850) called Internal Quality. This format is defined by
type QUALITY (library LibRtuStandard) and it is used internally to quality storage, allowing to be done conversion between
protocols without information loss.
The following tables define the protocols own formats conversion to internal format. Case it is necessary to consult the
conversion between protocols, it is needed to analyze in two steps, looking each of the tables to internal format and after
correlating them.
This is the QUALITY structure. The table below shows detailed each of its components.
56
5. CONFIGURATION
57
5. CONFIGURATION
The tables below show respectively the digital, analog and counters internal point’s conversion to IEC 60870-5-104 of
Nexto Series available to MT8500.
58
5. CONFIGURATION
As the MODBUS standard don’t specify quality types to each point, but for help on use of each point’s communication
diagnostic, MasterTool allows the quality variables mapping, through an internal own structure, to each MODBUS point. The
table below describes the quality types that each MODBUS point can assume.
59
5. CONFIGURATION
60
5. CONFIGURATION
The advanced configurations section allows to configure additional parameters of the serial port as described below:
5.3.1. NET 1
61
5. CONFIGURATION
The parameters related to CANopen protocol are described on Communication Protocols section.
62
5. CONFIGURATION
One of these objects is the GVL IntegratedIO, which is created automatically by MasterTool IEC XE and contains a list of
global symbolic variables that are directly mapped to the onboard inputs and outputs.
The other object is the connector Integrated I/O, which contains the configuration for each type of I/O point. These
configurations will be detailed on next sections.
63
5. CONFIGURATION
Note:
Input Filter Time Constant: The filter sampling is performed on MainTask (or Refresh function), then it’s recommended
to use multiple values of the task interval.
For each configuration described above, the remaining fast input signals (not used by the high-speed counter units) can be
used as external interruption, respecting the maximum number of this kind of logical element specified on Technical Descrip-
tion section.
The configuration of high-speed counters and interruptions is located on the following screen:
When selecting the function of a fast input, the following inputs are automatically assigned (locked for edition) according
to the mode of the high-speed counter unit.
The table below shows the possible configuration values for each fast input:
64
5. CONFIGURATION
Even if a fast input is configured as a counter or interruption, it’s digital value can still be read through Integrate-
dIo.DigitalInputs variable. The next subsections give more details about the Fast Inputs configuration and programming.
The high-speed counter units have multiple operating modes. The following table describes the details of each of these
modes:
Quadrature 2X
65
5. CONFIGURATION
Quadrature 4X
The overall behavior is the same for all counters: when counting UP and the maximum positive value is reached, the next
value will be the minimum negative value. The same thing happens for the oposite direction, so when counting DOWN and
the minimum negative value is reached, the next value will be the maximum positive value.
The user program can access the high-speed counters through the FastInputs symbolic structure, which is automatically
created on IntegratedIo GVL. For each high-speed counter unit, there are 3 main areas as shown on the following figure:
66
5. CONFIGURATION
The command and status are structures of bits that allow the user program to control the counter operation. The following
table describes the counter command structure.
67
5. CONFIGURATION
Additionally to the IntegratedIo global variables, there is a function block from LibIntegratedIo library which allows to
instantiate high-speed counter in POUs written in graphical languages (e.g Ladder Logic Diagram). This function block is,
actually, a wrapper to the structured variables described before. The figure below shows the function block instantiated in a
Ladder program.
The table below describes the inputs and outputs variables of the function block.
68
5. CONFIGURATION
The high-speed counter units have the ability to generate interrupts by comparison, i.e., when the counter reach a certain
comparison value, an specific task will run and interrupt the main program execution. Each high-speed counter unit have two
comparison values, called Comparer0 and Comparer1, which are present on the corresponding global symbolic data structure
or FunctionBlock as described on previous sections. The configuration of counter interrupt for each high-speed counter unit is
located on the following screen:
69
5. CONFIGURATION
The table below shows the possible configuration values for the counter interrupt:
The counter interrupt will generate an specific event. This event must trigger the execution of external event task, which
must call an specific POU. For example, the comparison event generated for Counter 0 is called COUNTER0_EVT. So, an
external event task called Counter0InterruptTask must be configured to be triggered by this event, and must call a POU called
Counter0InterruptPrg which will contain the user program to be executed.
The figure below shows this configuration scenario in MasterTool IEC XE.
The fast inputs can be set as Interruption (Rising Edge) mode, which means that when a rising edge (0V to 24V transition)
is performed on the input, an specific task will run and interrupt the main program execution.
Each external interruption will generate an specific event. This event must trigger the execution of external event task,
which must call an specific POU. For example, the external interruption event generated for fast input I02 is called FIN2_EVT.
70
5. CONFIGURATION
So, an external event task called FastInputI02InterruptTask must be configured to be triggered by this event, and must call a
POU called FastInputI02InterruptPrg which will contain the user program to be executed.
The figure below shows this configuration scenario in MasterTool IEC XE.
ATTENTION
The external interruption input have a 10ms time window filter to protect the controller
against spurious transitions on the input signal. This window starts right after the occu-
rance of the interruption and, during this time, any other external interruption event will be
discarded.
ATTENTION
The external interruption does not supports reentrancy. If another interruption occurs (af-
ter the filter time) and its program execution is still not finished, this interruption will be
discarded.
71
5. CONFIGURATION
The PTO function can be assigned only for Q14 and Q16. When the output is configured on this mode, the adjacent output
(Q15 or Q17) will be forced to normal digital output mode.
As shown on the previous table, the fast outputs can be configured as normal digital output. In this case, its digital value
can be set using the standard global variable IntegratedIo.DigitalOutputs.
When configured as VFO/PWM or PTO, the user program can control the fast ouputs through the FastOutputs symbolic
structure, which is automatically created on IntegratedIo GVL as shown on the following figure:
72
5. CONFIGURATION
The next subsections give more details about how to use these pulse generator functions, describing these structures for
each mode.
5.5.3.1. VFO/PWM
The VFO/PWM (Variable Frequency Output / Pulse Width Modulator) is a pulse generator output mode where the fre-
quency and duty cycle can be controlled by the user program. It’s appliable, for example, to control the power transfered to an
electric load or to control the angle of a servo motor. The principle of operation of VFO/PWM output is very simple, see the
pulsed waveform that is shown in the figure below:
73
5. CONFIGURATION
The figure shows a pulsed waveform, where T is the period of the pulses and τ is the pulse width. Those are the pulse
parameters which can be changed on VFO/PWM mode. The frequency is defined as the inverse of period, then:
1
f= T
The duty cycle is the reason between the pulse width and the period, then:
τ
D= T 100%
To control the VFO/PWM output, the user program must access the VFO_PWM variable of the fast output structure. The
structure of VFO_PWM is shown on the table below:
Once the Enable command is TRUE, the input parameters will be continuously checked and the status variables will be
updated accordingly.
Additionally to the IntegratedIo global variables, there is a function block from LibIntegratedIo library which allows to
instantiate VFO/PWM in POUs written in graphical languages (e.g Ladder Logic Diagram). This function block is, actually,
a wrapper to the structured variables described before. The figure below shows the function block instantiated in a Ladder
program.
The table below describes the inputs and outputs variables of the function block.
74
5. CONFIGURATION
5.5.3.2. PTO
The PTO (Pulse Train Output) is a pulse generator mode. It’s used, for example, to control step motors responsible for
positioning of mechanisms with considerable inertia. For these cases, the rotation speed must increase slowly (acceleration)
when the movement is starting and decrease slowly (deceleration) when the movement is stopping. These acceleration and
deceleration are made on pulse train by increasing and decreasing the frequency of the pulses, maintaining the 50% of duty
cycle.
There are a set of parameter that must be defined for a pulse train: Start frequency, operation frequency, stop frequency,
acceleration profile, total number of pulses, number of pulses in acceleration step, number of pulses in deceleration step. The
figure below shows, on Cartesian plane, the relation between the frequency of the pulses and time. The pulse train shown is
called trapezoidal profile, because the acceleration and deceleration ramps produce a trapezium shape.
75
5. CONFIGURATION
For some applications it is more recommended to use the “S” profile, which acceleration and deceleration curves are similar
to “S” shape. The figure below shows this profile.
Besides the PTO parameters, there are status information and commands that the user program can use to control the
output. Some important status information are the pulse counter (proportional to a position), the pulse train step (acceleration,
operation, deceleration) and, even, if the output is working fine. The commands required to control PTO are to start the pulse
train, to stop the pulse train and to stop the pulse train softly (soft stop). The soft stop command is very important, once can
be used for emergency situations where the system can’t stop abruptly. The figures below shows how the soft stop command
change the pulse train when it is performed. The dashed blue lines represents the PTO if the soft stop command is performed
on acceleration and operation steps. The soft stop command on deceleration step has no effect, once the system is already
stopping.
76
5. CONFIGURATION
To control the PTO, the user program must access the PTO variable of the fast output structure. The structure of PTO is
shown on the table below:
77
5. CONFIGURATION
Once the Start command is TRUE, the input parameters will be continuously checked and the status variables will be
updated accordingly.
Additionally to the IntegratedIo global variables, there is a function block from LibIntegratedIo library which allows to
instantiate PTO in POUs written in graphical languages (e.g Ladder Logic Diagram). This function block is, actually, a wrapper
to the structured variables described before. The figure below shows the function block instantiated in a Ladder program.
78
5. CONFIGURATION
The table below describes the inputs and outputs variables of the function block.
79
5. CONFIGURATION
Notes:
Input Type: Be sure to use the proper pin on the terminal block correspondent to the selected type (voltage or current).
Open Loop Value: : Determines the behavior of the input variable when set to 4 - 20 mA scale and current less than 3
mA.
80
5. CONFIGURATION
81
5. CONFIGURATION
The next table describes additional details about each input type:
Temperature Coef-
Input type Measurement Band Count Resolution
ficient (α)
400 Ω - 0 to 400 Ω 0 to 4000 0.1 Ω
4000 Ω - 0 to 4000 Ω 0 to 4000 1Ω
Pt100E, 0,00385 -200 to 850 ◦ C -2000 to 8500 0.3 ◦ C
Pt1000E -328 to 1562 ◦ F -3280 to 15620 0.6 ◦ F
Pt100A, 0,003916 -200 to 630 ◦ C -2000 to 6300 0.3 ◦ C
Pt1000A -328 to 1166 ◦ F -3280 to 11660 0.6 ◦ F
82
5. CONFIGURATION
83
5. CONFIGURATION
The Mode field defines which configuration the controller should load for its interfaces. This field can be configured as
Defined By Web Page or Defined By Application.
When set to Defined by Application, the interface table is disabled, not allowing changes, as shown in the figure below. In
this mode, the settings applied to the controller are those defined by the application.
ATTENTION
The table for network configuration is displayed only when there is no application on the
controller or the controller is not running. It is not possible to change the network settings
while an application is running on the controller.
Below is an image with Defined by Application mode selected, showing the interface table disabled.
84
5. CONFIGURATION
For the Defined by web page mode, the interface table remains enabled, as shown in the figure below.
In this mode, the user can configure the IP Address, Netmask, and Gateway of each of the available Ethernet interfaces.
To have the settings applied to the controller, simply click the Apply button. This process checks if there were any errors
in the configuration made and, if so, displays a message on the browser screen indicating the error. If your settings are correct,
85
5. CONFIGURATION
after clicking Apply, a confirmation window appears in your browser to apply the new settings. By clicking OK, the settings
are sent to the controller and applied.
ATTENTION
When making network changes in the controller, the interfaces will be restarted, which may
cause a communication loss. This is especially true when changing the IP address value.
When applying settings using the Defined by Application mode, the controller will assume the configuration that was
defined by the loaded application. If there is no application, the current configuration will be maintained, with only the
configuration mode being changed.
Using the Defined by Web Page mode, the addresses indicated on the web page will be loaded.
ATTENTION
The Defined by Web Page mode configures the interfaces to operate in Simple Mode.
The network sniffer, shown in the figure below, can be used to observe traffic on physical interfaces, except for USB devices
such as modems and wifi adapters. It has two basic settings:
Number of Packets: This is the number of packets you want to capture. The configured value of this parameter must be
within the range of 1 to 25000 packets;
Idle Timeout (seconds): If there is no packet traffic on the interface after this configured timeout, Sniffer is terminated. It
can be configured with values between 1 and 3600 seconds.
Only a few moments after the screen opens will the Run button, which starts Sniffer’s execution, become available. The
Download button will only be unlocked if there is a Sniffer related file available for download. If the Sniffer has never been
run or the file is deleted, the button will not be available.
When running the Network Sniffer, the page will disable the edit fields, the Download button will be locked, and the Run
button will become the Stop button, as shown in the figure below.
The Stop button can be used to end the sniffer execution at any time after it has been started.
86
5. CONFIGURATION
For each of the interfaces on which Sniffer runs, it generates a .pcap file. These files are named according to the name of
the controller and the interface that was analyzed, for example, NX3008_NET1.pcap. These files are found inside a .zip file,
also named according to the name of the controller, for example, NX3008_capture.zip.
At the end of the sniffer execution, a message is displayed asking whether or not to automatically download the generated
files. These files are stored in the InternalMemory folder of the User Files Memory and can be accessed through the controller’s
programming software. The downloaded file is always in the .zip extension, which groups the other files.
If any problems occur related to insufficient memory due to the generation of sniffer files, it will be indicated to the user. It
is recommended to try running the analyzer again with a smaller Number of Packets configuration.
The network sniffer can terminate its execution for three reasons: insufficient memory, idle time limit of interfaces ex-
ceeded, and manual cancellation.
The content of this page changes dynamically according to the type of USB device that is connected. In the example above,
there is no device connected.
The following sections describe all the types of USB devices currently supported. If an unsupported device is connected,
the page will inform that device is unknown:
87
5. CONFIGURATION
Mass storage devices can be used to expand the controller’s flash memory to store big amount of data, like on datalogger
applications, for instance. To use a USB mass storage device, simply connect it to the USB port. After a few seconds, when
the device is properly detected and mounted, the USB LED will turn on and the device information will appear on section USB
Devices located at the tab PLC Management of the controller’s diagnostics webpage as shown below:
The information shown on the status section of this page is also available in the symbolic variables diagnostics structure
88
5. CONFIGURATION
The device can be ejected using the command provided on the Commands area of this page as indicated on the picture
above.
After the device is properly detected and mounted, a new folder called Mass_Storage will appear on the controller’s
memory as shown on the picture below:
The USB mass storage device can be used to prevent the controller from automatically loading the application after the
power on. To do that, simply place an empty text file called "dontbootapp.txt" on the root folder of mass storage device. The
presence of this file is informed in the Special Files field on controller’s system webpage as shown below.
89
5. CONFIGURATION
The USB mass storage device can also be used to transfer an application to the controller. To do that, place the two files
Application.app and Application.crc on the root folder of mass storage device (these files are created using MasterTool IEC
XE executing the command Online -> Create boot application when offline). After the power on, if the controller detects the
presence of these files on the USB mass storage device, the following sequence of actions will occur:
The controller will start copy of the application from USB device to internal memory
After finishing the copy process, the USB device will be ejected (USB LED will turn off)
The new application will start (RUN) automatically (if "dontbootapp.txt" is not present)
The presence of the application is informed in the Special Files field on controller’s system webpage as shown below:
90
5. CONFIGURATION
Note that it is possible to have multiple Special Files in the same Mass Storage. In the example above, the PLC will transfer
the new application to the internal memory but not load it on startup (hence, will not go to RUN).
Controller Manufacturer
FT232 FTDI
PL2303 Prolific
This port is intended to be used exclusively with the Serial communication function blocks provided by the NextoSerial
library, allowing to implement a point-to-point communication with equipments that use simple protocols (non time critical)
like Radio modems, Barcode readers, RFID readers, etc... Additionally, this kind of solution has the following limitations:
Baud Rate: values lower than 4800 bps are not supported
Data Bits: value “5” is not supported (only 6, 7 or 8)
Parity: values “mark” and “space” are not supported (only Odd, Even and None)
Stop Bits: value “1.5” is not supported (only 1 or 2)
After plugging the converter into the USB port, the USB LED may turn on indicating that the device was properly detected
and mounted and the device information will appear on section USB Devices located at the tab PLC Management of the
controller’s System Web Page as shown below:
The information shown on this page is also available in the symbolic variables diagnostics structure (see Section Diagnos-
tics via Variables).
This additional serial port will be identified internally as COM10, and will not have a representation on the project treeview.
From this point, this port can be used for communication using the NextoSerial functions similar to the native ports. For this
kind of port, the handshake configuration is limited to RS232_MANUAL only (must be considered when configuring the port
with SERIAL_CFG function).
91
5. CONFIGURATION
The bridge modem is a non-managed device that implements a direct connection (pass through) to the mobile data network,
so all the connection requests coming from the internet will reach the controller’s operating system. For this kind of device,
the configuration is performed through the controller’s system web page as described further on this section.
On the other hand, the router modem is a managed device that implements a firewall with configurable network policies.
For this kind of device, all the configuration is performed through a proprietary web page that is embedded into the device.
By default, the Modem blocks any kind of inbound connections (i.e, will not allow the remote access). To allow this, the user
must configure the modem through the device embedded web page to open the TCP port related to the desired service (some
manufacturers calls this feature as Virtual Server or Port Forwarding). The following table describes the number of the TCP
port associated to the main services of the PLC.
Port Service
80 Embedded system web page
8080 Embedded Webvisu web page
1217 MasterTool programming
The management of the USB Modem functionality is done through the USB Devices page in the PLC Management tab of
the controller’s system webpage. Once the Modem device is properly detected and mounted, the USB LED will turn on and
the device information will appear as shown below:
92
5. CONFIGURATION
ATTENTION
The provider APN and PIN code fields are mandatory for every SIM chip. If the provider
informs these parameters, they shall be used. In other hand, it’s known that several SIM
chips simply doesn’t care for the content of these fields, using internal predefined values. In
this case, these fields of the web page can be left with the default values and the connection
will proceed successfully. Values like "zero" for PIN Code and "empty" for the Provider
APN are not allowed.
The operation principle of USB Modem functionality is rather simple. For bridge devices, once the device is properly
detected and the SIM parameters configured, the controller starts a background process, which continuously controls the
modem to keep it connected to the internet. This eliminates the need of any kind of manual intervention, so if the connection
is dropped for some reason (bad reception, carrier outage, etc.), the controller will try to reconnect automatically. The status
of this process can be observed by the Connection Status field. For router modems, the device contains a similar process that
runs internally (independent from the controller) that is called Auto Connect. It generally comes enabled by default, but can be
disabled through the modem web page.
One important aspect to consider is that, if the USB Modem is configured, the controller system will set it as the default
gateway for all Ethernet communication. It means that, if the controller is simultaneously connected to a local network (NET1),
which has also access to the internet, all the Ethernet messages addressed to external IPs will route through the USB Modem
(and not through NET1). NET1 returns as the default gateway when the USB Modem was removed.
The configuration and operation sequence can be summarized into the following steps:
93
5. CONFIGURATION
Plug the device into the USB port. After some seconds, the USB Devices page will show the Device as "Modem". If not,
the device might be unsupported or defective.
(For bridge devices) Set the SIM parameters (Provider APN - Access Point Name and the chip PIN code) as informed
by the SIM chip provider. After clicking on Apply button, the connection process will start. Once configured, it is not
necessary to set this information anymore. It will be saved on the controller’s memory.
Watch the connection status on the corresponding field. If everything goes fine, after some seconds it will inform that
the modem is connected to the internet, and an IP address will appear in its field.
Once connected to the internet, this communication channel can be used for several purposes. One typical use case is to
implement telemetry solution using MQTT Client Function Block to publish data. Another use case is to access the controller
remotely. In this case, it is necessary to know the modem IP address on the internet. However, this address is dynamic and
changes on every connection process. One way to workaround this problem is to publish the IP address (available on the
modem diagnostic variables) through MQTT.
With the Modem IP address, it is possible to perform remote access to the controller’s system web page to view status and
diagnostics (firmware update is not supported). Also, it allows to program the controller remotely using MasterTool IEC XE.
For this, the gateway must be configured with the Modem IP address like shown on the following picture:
ATTENTION
For bridge devices, or router devices with external access enabled (port forwarding), once
connected to the internet, anyone who knows the modem IP address will be able to access
the controller remotely. So, for security reasons, it is EXTREMELY important and recom-
mended to configure the User Rights on the controller to restrict the online operations of
MasterTool IEC XE with login and password.
94
5. CONFIGURATION
The management of the WiFi Adapter functionality is done through the USB Devices page in the PLC Management tab of
the controller’s system webpage. Once the WiFi adapter device is properly detected and mounted, the USB LED will turn on
and the device information will appear as shown below:
95
5. CONFIGURATION
IP Address, Network Mask and Gateway: only available when the IP definition is set as "Static". These fields will be
used to configure the network parameters of the WiFi adapter.
Default Gateway: this field defines what network interface will be used as a Gateway to access the Internet. It is
possible to choose the "WiFi Adapter" or the "Local Ethernet" for this function.
ATTENTION
For proper operation, the WiFi adapter network (defined by IP and Mask) must be different
from the one configured for NET1.
The configuration and operation sequence can be summarized into the following steps:
Plug the device into the USB port. After some seconds, the USB Devices page will show the Device as "WiFi Adapter".
If not, the device might be unsupported or defective.
Set the network configuration. After clicking on Apply button, the connection process will start. Once configured, it is
not necessary to set this information anymore. It will be saved on the controller’s memory.
Watch the connection status on the corresponding field. If everything goes fine, after some seconds it will inform that
the adapter is connected to the WiFi network.
96
5. CONFIGURATION
The following picture shows the page of a controller connected to a WiFi network:
Once connected to the WiFi network, this communication channel can be used for several purposes. To program the PLC
with MasterTool IEC XE, the gateway must be configured with the IP address assigned to the WiFi adapter (similar to the
USB Modem, Figure 73). This IP address can also be used to access the controller’s system web page, where it is possible to
perform a firmware update, which is not available when using the USB Modem. Additionally, this communication channel can
also be used with the MQTT client Function Block to report data to an external broker on the internet (in this case, the WiFi
adapter as Default Gateway).
The Nexto Xpress series of controllers allows implementing a second Ethernet port using an USB Adapter to Ethernet. The
following table shows the list of supported devices.
Adapter Manufacturer
USB 3.0 to Gigabit SuperSpeed Ethernet Adapter UE300 TP-LINK
USB31000S USB 3.0 to Gigabit Ethernet Adapter STAR TECH
The management of the Ethernet Adapter functionality is done through the USB Devices page in the Management tab of
the controller’s system web page. Once the USB Ethernet adapter device is properly detected and mounted, the USB LED will
turn on and the device information will appear as shown below:
97
5. CONFIGURATION
The USB Ethernet adapter’s page contains basically two sections: Status and Configuration.
The Status section shows all diagnostics related to the Ethernet adapter: Link state, IP address, Netmask, Gateway and
MAC address. These fields are automatically updated based on the current state of the device. These informations are also
provided in the symbolic variables diagnostics structure (see Section Diagnostics via Variables).
The Configuration section is composed by the following parameters: IP address, Netmask and Gateway. These fields will
be used to configure the Ethernet adapter’s network parameters.
ATTENTION
For proper operation, the Ethernet adapter network (defined by IP and Mask) must be differ-
ent from the one configured for NET1.
98
5. CONFIGURATION
Besides that, the Configuration section contains the Apply button for that the IP, Netmask and Gateway settings are defi-
nitely applied. After the device is correctly configured with compatible network parameters, whenever the adapter is connected,
the last configuration performed will be applied, regardless of whether it is a different adapter than the last configured one.
ATTENTION
The USB Ethernet adapter becomes the Default Gateway when configured.
The configuration and operation sequence can be summarized into the following steps:
Plug the device into the USB port. After some seconds, the USB Devices page will show the Device as "Ethernet
Adapter". If not, the device might be unsupported or defective.
Set the network configuration. After filling in the fields, use the Apply button to carry out the settings. Once configured,
it is not necessary to set this information anymore. It will be saved on the controller’s memory.
Watch the status of the network settings on the corresponding field. If everything goes fine, after some seconds it will be
showed the parameters applied in the last item. After this, just it is necessary to connect an Ethernet cable to establish a
connection with the network (when the cable was connected, the Link state must go to UP).
The following picture shows the page of a controller with an USB Ethernet Adapter configured and connected to a network:
99
5. CONFIGURATION
Figure 79: USB Ethernet Adapter Page with Configuration Applied and Link UP
The USB Ethernet adapter allows the controller expands its network interfaces, creating the possibility of dedicating the
NET1 to run a communication protocol, for example, the protocol to SoftMotion. Therefore, the adapter can be used for other
purposes, such as programming the PLC with the MasterTool IEC XE or using the IP address to access the web page of the
controller system, where it is also possible to perform a firmware update.
Notes:
Mapped Points: It refers to the maximum number of mapped points supported by the CPU. Each mapping supports one
or more mapped points, depending on the size of the data when used with variables of type ARRAY.
100
5. CONFIGURATION
Mappings: A “mapping” is the relationship between an internal application variable and an object of the application
protocol. This field informs the maximum number of mappings supported by the CPU. It corresponds to the sum of all
mappings made within the instances of communication protocols and their respective devices.
Requests: The sum of requests for communication protocols, declared on the devices, cannot exceed the maximum number
of requests supported by the CPU.
Control Centers: Control Center is all client device connected to the CPU through protocol IEC 60870-5-104. This
field informs the maximum of client devices of control center type supported by the CPU. Correspond to the sum of all client
devices of communication protocol Server IEC 60870-5-104 (does not include master or clients from MODBUS RTU Slave
and MODBUS Server protocols)
The limitations of the MODBUS protocol for symbolic mappings can be seen in the table below.
Notes:
Devices per instance:
Master or Client Protocol: Number of slave or server devices supported by each Master or Client protocol instance.
MODBUS RTU Slave Protocol: the limit (1) informed relates to serial interfaces that do not allow a Slave to establish
communication through the same serial interface, simultaneously, with more than one Master device. It’s not necessary,
nor is it possible to declare or configure the Master device in the instance of the MODBUS RTU slave protocol. The
master device will have access to all the mappings made directly on the instance of MODBUS RTU slave protocol.
MODBUS RTU Server Protocol: the limit (2) informed relates to the Ethernet interfaces, which limit the amount of
connections that can be established with other devices through a single Ethernet interface. It is not necessary, nor is it
possible to declare or configure Clients devices in the instance of the MODBUS Server protocol. All Clients devices
will have access to all the mappings made directly in the instance of the MODBUS Server protocol.
Requests by device: Number of requests, such as reading or writing holding registers, which can be configured for each of
the devices (slaves or servers) from Master or Client protocols instances. This parameter does not apply to instances of Slave
or Server protocols.
Simultaneous Requests per Instance: Number of requests that can be simultaneously transmitted by each client protocol
instance or that can be received simultaneously by each server protocol instance. MODBUS RTU protocol instances, Master
or Slave, do not support simultaneous requests.
Simultaneous Requests per Device: Number of requests that can be simultaneously transmitted for each MODBUS server
device, or may be received simultaneously from each MODBUS client device. MODBUS RTU devices, Master or Slave do
not support simultaneous requests.
The limitations of the IEC 60870-5-104 Server protocol can be seen in the table below.
Notes:
Devices per instance: Quantity of client devices, of type control center, supported for each IEC 60870-5-104 Server
protocol instance. The limit informed might be smaller because of the CPU total limits (check Table 74).
101
5. CONFIGURATION
Simultaneous requests per instance: Quantity of requests that can be received simultaneously by each instance of Server
protocol.
Simultaneous requests per device: Quantity of requests that can be received simultaneously of each IEC 60870-5-104
Client device.
Notes:
Symbol : Protocol remains active and operating normally.
Symbol : Protocol is disabled.
EtherCAT: The tests were performed using the default value defined in PLC Settings (see table PLC Settings), with option
Update I/O during stop checked and option Configure all outputs to default.
MODBUS Symbol Slave/Server: To keep the protocol communicating when the CPU isn’t in RUN or after a breakpoint,
it’s need to check the option “Keep the communication running on CPU stop”.
102
5. CONFIGURATION
The CPU’s event queue is redundant, that means it is synchronized each cycle between both CPUs, when is used CPU’s
redundancy. Further information can be found on the section about CPU redundancy.
The in and out of events in this queue follows the concept of producer/consumer. Producers are those system elements
capable of generate events, adding events in the CPU’s queue, while the consumers are those system elements which receive
and use this events, taking them of the CPU’s queue. The figure below describes this working, including the example of some
events consumers and producers.
5.8.3.1. Consumers
The consumers are typically communication drivers that will communicate with SCADA or HMI. After been stored in
CPU’s queue, the consumers receive the events related to communication points mapped in its configuration. These events are
then stored in a consumer’s own events queue, which the size and working are described on the communication driver specific
section.
103
5. CONFIGURATION
Once stored in CPU’s queue, each event is transmitted to the consumer that has this communication point in its data base.
On the figure above, the Event 0 is referred to a communication point mapped to two control centers IEC 60870-5-104 (Client
1 and 2). Thus the Event 1 is referred to a communication point mapped only to one control center IEC 60870-5-104 (Client
2). By its time, the Event 2 is referred to a communication point mapped to another control center IEC 60870-5-104 (Client
3).
The events remain stored in the CPU’s queue until all its consumers acknowledge its receiving. The criteria used to confirm
the receive is specific of each consumer. In case of the IEC 60870-5-104 Server, the acknowledge occurs when the event is
transmitted to the IEC 60870-5-104 client.
In Nexto Series case, there are no diagnostics available to watch the CPU’s events queue occupation, not even information
about the queue overflow. However the consumers have a diagnostics group referred to its events queue. Further information
can be found at the specific driver communication section.
The overflow sign to the consumers’ events queue occurs in two situations:
When the consumer events queue is out of space to store new events
If the CPU aborted the event generation (because occurred to more events in a single execution cycle than the events
queue total size)
5.8.3.3. Producers
The producers are typically communication drivers or PLC internal elements that are capable to generate events. The
previous figure show some examples.
Internal Points: This is a PLC’s firmware internal element, which detects events each execution cycle (MainTask)
to those communication points that don’t have a defined origin and then inserts the events in the CPU’s queue. The
maximum number of events that can be detected in each MainTask cycle is equal to the CPU’s events queue size. In case
the number of generated events is bigger than this, in a single cycle, the exceeding are going to be lost.
MODBUS Driver (Client/Server/Master/Slave): The variables value change caused by MODBUS read/write are de-
tected at each MainTask cycle and then the events are inserted in CPU’s queue. In Client/Master cases, are also generated
quality events when there is a communication failure with the slave device.
104
5. CONFIGURATION
Notes:
bExec: When FALSE, the command just stop being intercepted for the user application, but it keeps being treated normally
by the server.
bDone: After the command interception, the user is going to be responsible for treat it. At the end of the treatment, this
input must be enabled for a new command can be received. Case this input is not enabled, the block is going to wait the time
defined in dwTimeout, to then become capable of intercept new commands.
eCommandResult: Treatment results of command intercepted by user. The result returned to the client that sent the
command, which must be attributed together with the input bDone, is converted to the protocol’s format from which was
received the command. In Nexto Series it is only supported the interception of commands coming from protocol IEC 60870-
5-104. In protocol interception, any return different from SUCCESS results in a negative Acknowledge.
ATTENTION
It is not recommended the simultaneous commands interception to one same variable by two
or more CommandReceiver function blocks. Just one of the function blocks will intercept
correctly the command, being able to suffer undesirable interference from the others function
blocks if addressed to the same variable.
105
5. CONFIGURATION
Note:
eStatus: Return of a register process of a communication point command interception. When the interception is regis-
tered with success OK_SUCCESS is returned, else ERROR_FAILED is. In case interceptor register failure, commands to the
determined point are not intercepted by this function block. TYPE_RESULT is defined in LibDataTypes library.
Supported commands are described on table below:
The parameters that build the sSelectParameters, sOperateParameters and sCancelParameters structures are described on
the following table:
106
5. CONFIGURATION
107
5. CONFIGURATION
To intercept commands to a specific point, first it is need to load in the dwVariableAddr parameter the variable address cor-
respondent to the point wanted to intercept the commands and then execute a pulse in the bExec parameter. Once the command
was intercepted, the function block informs that a command was intercepted through bCommandAvailable parameter. The
intercepted command information are then filled in the sCommand and eStatus output parameters, according to the received
command type. This operation depends only of the received command type, don’t matter the variable’s data type to which is
being intercepted the command. The interception is finished and then the function block can be released to intercept a new
command when bDone parameter is true. Yet must be pointed the command processing result in eCommandResult.
108
5. CONFIGURATION
There are two configuration modes for this protocol. One makes use of Direct Representation (%Q), in which the variables
are defined by its address. The other, called Symbolic Mapping has the variables defined by its name.
Regardless of the configuration mode, the steps to insert a protocol instance and configure the serial interface are the same.
The procedure to insert a protocol instance is found in detail in the MasterTool IEC XE User Manual - MU299609 or in the
section Inserting a Protocol Instance. The remaining configuration steps are described below for each mode.
Add the MODBUS RTU Master Protocol instance to the serial channel COM 1 or COM 2 (or both, in case of two
communication networks). To execute this procedure, see Inserting a Protocol Instance section.
Configure the serial interface, choosing the transmission speed, the RTS/CTS signals behavior, the parity, the channel
stop bits, among others configurations by a double click on the COM 1 or COM 2 serial channel. See Serial Interface
section.
To configure this protocol using symbolic mapping, you must perform the following steps:
Configure the general parameters of the MODBUS Master protocol, like: transmission delay times and minimum inter-
frame as in Figure 81.
Add and configure devices via the General Parameters tab, defining the slave address, communication time-out and
number of communication retries as can be seen in Figure 82.
Add and configure the MODBUS mappings on Mappings tab as Figure 83, specifying the variable name, data type, and
the data initial address, the data size and range are filled automatically.
Add and configure the MODBUS requests as presented in Figure 84, specifying the function, the scan time of the request,
the starting address (read/write), the data size (read/write) and generate diagnostic variables and disabling the request
via the buttons at the bottom of the window.
The general parameters, found on the MODBUS protocol initial screen (figure below), are defined as:
Notes:
Send Delay: The answer to a MODBUS protocol may cause problems in certain moments, as in the RS-485 interface or
other half-duplex. Sometimes there is a delay between the slave answer time and the physical line silence (slave delay to put
RTS in zero and put the RS-485 in high impedance state). To solve this problem, the master can wait the determined time in
this field before sending the new request. Otherwise, the first bytes transmitted by the master could be lost.
Minimum Interframe: The MODBUS standard defines this time as 3.5 characters, but this parameter is configurable in
order to attend the devices which do not follow the standard.
109
5. CONFIGURATION
The MODBUS protocol diagnostics and commands configured, either by symbolic mapping or direct representation, are
stored in T_DIAG_MODBUS_RTU_MASTER_1 variables. For the direct representation mapping, they are also in 4 bytes and
8 words which are described in table below (where “n” is the configured value in the %Q Start Address of Diagnostics Area
field):
110
5. CONFIGURATION
111
5. CONFIGURATION
Note:
Counters: All MODBUS RTU Master diagnostics counters return to zero when the limit value 65535 is exceeded.
The devices configuration, shown on figure below, follows the following parameters:
Notes:
Slave Address: According to the MODBUS standard, the valid slave addresses are from 0 to 247, where the addresses
from 248 to 255 are reserved. When the master sends a writing command with the address configured as zero, it is making
broadcast requests in the network.
Communication Time-out: The communication time-out is the time that the master waits for a response from the slave
to the request. For a MODBUS RTU master device it must be taken into account at least the following system variables: the
time it takes the slave to transmit the frame (according to the baud rate), the time the slave takes to process the request and the
response sending delay if configured in the slave. It is recommended that the time-out is equal to or greater than the time to
transmit the frame plus the delay of sending the response and twice the processing time of the request. For more information,
see Communication Performance section.
Maximum number of retries: Sets the number of retries before reporting a communication error. For example, if the
slave does not respond to a request and the master is set to send three retries, the error counter number is incremented by one
unit when the execution of these three retries. After the increase of the communication error trying to process restarts and if
the number of retries is reached again, new error will increment the counter.
The MODBUS relations configuration, showed on figure below, follows the parameters described on table below:
112
5. CONFIGURATION
Notes:
Value Variable: this field is used to specify a symbolic variable in MODBUS relation.
Data type: this field is used to specify the data type used in the MODBUS relation.
113
5. CONFIGURATION
The configuration of the MODBUS requests, viewed in figure below, follow the parameters described in table below:
114
5. CONFIGURATION
Notes:
Setting: the number of factory default settings and the values for the column Options may vary according to the data type
and MODBUS function (FC).
Function Code: MODBUS (FC) functions available are the following:
Code
DEC HEX Description
1 0x01 Read Coils (FC 01)
2 0x02 Read Input Status (FC 02)
3 0x03 Read Holding Registers (FC 03)
4 0x04 Read Input Registers (FC 04)
115
5. CONFIGURATION
Code
DEC HEX Description
5 0x05 Write Single Coil (FC 05)
6 0x06 Write Single Holding Register (FC 06)
15 0x0F Write Multiple Coils (FC 15)
16 0x10 Write Multiple Holding Registers (FC 16)
22 0x16 Mask Write Holding Register (FC 22)
23 0x17 Read/Write Multiple Holding Registers (FC 23)
Polling: this parameter indicates how often the communication set for this request must be performed. By the end of a
communication will be awaited a time equal to the value configured in the field polling and after that, a new communication
will be executed.
Read Data Start Address: field for the initial address of the MODBUS read data.
Read Data Size: the minimum value for the read data size is 1 and the maximum value depends on the MODBUS function
(FC) used as below:
Read Coils (FC 01): 2000
Read Input Status (FC 02): 2000
Read Holding Registers (FC 03): 125
Read Input Registers (FC 04): 125
Read/Write Multiple Registers (FC 23): 121
Read Data Range: this field shows the MODBUS read data range configured for each request. The initial address, along
with the read data size will result in the range of read data for each request.
Write Data Start Address: field for the initial address of the MODBUS write data.
Write Data Size: the minimum value for the write data size is 1 and the maximum value depends on the MODBUS
function (FC) used as below:
Write Single Coil (FC 05): 1
Write Single Register (FC 06): 1
Write Multiple Coils (FC 15): 1968
Write Multiple Registers (FC 16): 123
Mask Write Register (FC 22): 1
Read/Write Multiple Registers (FC 23): 121
Write Data Range: this field shows the MODBUS write data range configured for each request. The initial address, along
with the read data size will result in the range of write data for each request.
Diagnostic Variable: The MODBUS request diagnostics configured by symbolic mapping or by direct representation, are
stored in variables of type T_DIAG_MODBUS_RTU_MAPPING_1 for Master devices and T_DIAG_MODBUS_ETH_CLIENT_1
for Client devices and the mapping by direct representation are in 4-byte and 2-word, which are described in Table 99 ("n" is
the value configured in the %Q Start Address of Diagnostics Area field).
116
5. CONFIGURATION
Notes:
Exception Codes: The exception codes presented in this field are values returned by the slave. The definitions of the ex-
ception codes 128, 129 and 255 presented in the table are valid only when using Altus slaves. Slaves from other manufacturers
might use other definitions for each code.
117
5. CONFIGURATION
Disabling Variable: variable of Boolean type used to disable, individually, MODBUS requests configured on request tab
via button at the bottom of the window. The request is disabled when the variable, corresponding to the request, is equal to 1,
otherwise the request is enabled.
Last Error Code: The codes for the possible situations that cause an error in the MODBUS communication can be
consulted below:
ATTENTION
Differently from other application tasks, when a depuration mark in the MainTask is reached,
the task of a Master MODBUS RTU instance and any other MODBUS task will stop running
at the moment that it tries to perform a writing in a memory area. It occurs in order to keep
the consistency of the memory areas data while a MainTask is not running.
To configure this protocol using symbolic mapping, you must perform the following steps:
118
5. CONFIGURATION
Configure the MODBUS slave protocol general parameters, as: slave address and communication times (available at the
Slave advanced configurations button).
Add and configure MODBUS relations, specifying the variable name, MODBUS data type and data initial address.
Automatically, the data size and range will be filled, in accordance to the variable type declared.
5.8.6.1.1. MODBUS Slave Protocol General Parameters – Configuration via Symbolic Mapping
The general parameters, found on the MODBUS protocol initial screen (figure below), are defined as.
The MODBUS slave protocol communication times, found in the Advanced... button on the configuration screen, are
divided in: Task Cycle, Send Delay and Minimum Interframe as shown in figure below and in table below.
119
5. CONFIGURATION
Notes:
Task Cycle: the user will have to be careful when changing this parameter as it interferes directly in the answer time, data
volume for scan and mainly in the CPU resources balance between communications and other tasks.
Send Delay: the answer to a MODBUS protocol may cause problems in certain moments, as in the RS-485 interface or
other half-duplex. Sometimes there is a delay between the time of the request from the master and the silence on the physical
line (slave delay to put RTS in zero and put the RS-485 in high impedance state). To solve this problem, the master can wait
the determined time in this field before sending the new request. On the opposite case, the first bytes transmitted by the master
could be lost.
Minimum Interframe: the MODBUS standard defines this time as 3.5 characters, but this parameter is configurable in
order to attend the devices which don’t follow the standard.
The MODBUS Slave protocol diagnostics and commands configured, either by symbolic mapping or direct representation,
are stored in T_DIAG_MODBUS_RTU_SLAVE_1 variables. For the direct representation mapping, they are also in 4 bytes and
8 words which are described in table below (where “n” is the configured value in the %Q Start Address of Diagnostics Area):
120
5. CONFIGURATION
121
5. CONFIGURATION
122
5. CONFIGURATION
Note:
Counters: all MODBUS RTU Slave diagnostics counters return to zero when the limit value 65535 is exceeded.
The MODBUS relations configuration, showed on figure below, follows the parameters described on table below:
Notes:
Value Variable: this field is used to specify a symbolic variable in MODBUS relation.
Data Type: this field is used to specify the data type used in the MODBUS relation.
123
5. CONFIGURATION
Data Range: this field shows the user the memory address range used by the MODBUS relation.
ATTENTION
Differently from other application tasks, when a depuration mark in the MainTask is reached,
the task of a MODBUS RTU Slave instance and any other MODBUS task will stop running
at the moment that it tries to perform a writing in a memory area. It occurs in order to keep
the consistency of the memory areas data while a MainTask is not running.
The association of MODBUS variables with CPU symbolic variables is made by the user through relations definition via
MasterTool IEC XE configuration tool. It’s possible to configure up to 32 relations for the server mode and up to 128 relations
124
5. CONFIGURATION
for the client mode. The relations in client mode, on the other hand, must respect the data maximum size of a MODBUS
function: 125 registers (input registers or holding registers) or 2000 bits (coils or input status). This information is detailed in
the description of each protocol.
All relations, in client mode or server mode, can be disabled through direct representation variables (%Q) identified as
Disabling Variables by MasterTool IEC XE. The disabling may occur through general bits which affect all relations of an
operation mode, or through specific bits, affecting specific relations.
For the server mode relations, IP addresses clusters can be defined with writing and reading allowance, called filters. This
is made through the definition of an IP network address and of a subnet mask, resulting in a group of client IPs which can
read and write in the relation variables. Reading/writing functions are filtered, in other words, they cannot be requested by any
client, independent from the IP address. This information is detailed in the MODBUS Ethernet Server protocol.
When the MODBUS TCP protocol is used in the client mode, it’s possible to use the multiple requests feature, with the
same TCP connection to accelerate the communication with the servers. When this feature isn’t desired or isn’t supported by
the server, it can be disabled (relation level action). It is important to emphasize that the maximum number of TCP connections
between the client and server is 63. If some parameters are changed, inactive communications can be closed, which allows the
opening of new connections.
The tables below bring, respectively, the complete list of data and MODBUS functions supported by the Nexto CPUs.
Code
DEC HEX Description
1 0x01 Read Coils (FC 01)
2 0x02 Read Input Status (FC 02)
3 0x03 Read Holding Registers (FC 03)
4 0x04 Read Input Registers (FC 04)
5 0x05 Write Single Coil (FC 05)
6 0x06 Write Single Holding Register (FC 06)
15 0x0F Write Multiple Coils (FC 15)
16 0x10 Write Multiple Holding Registers (FC 16)
22 0x16 Mask Write Holding Register (FC 22)
23 0x17 Read/Write Multiple Holding Registers (FC 23)
Independent of the configuration mode, the steps to insert an instance of the protocol and configure the Ethernet interface
are equal. The remaining configuration steps are described below for each modality.
Add one or more instances of the MODBUS Ethernet client or server protocol to Ethernet channel. To perform this
procedure, refer to the section Inserting a Protocol Instance.
Configure the Ethernet interface. To perform this procedure, see section Ethernet Interface.
125
5. CONFIGURATION
To configure this protocol using Symbolic Mapping, it’s necessary to execute the following steps:
Configure the general parameters of MODBUS protocol client, with the Transmission Control Protocol (TCP) or RTU
via TCP.
Add and configure devices by setting IP address, port, address of the slave and time-out of communication (available on
the Advanced Settings button of the device).
Add and configure the MODBUS mappings, specifying the variable name, data type, data initial address, data size and
variable that will receive the quality data.
Add and configure the MODBUS request, specifying the desired function, the scan time of the request, the initial address
(read/write), the size of the data (read/write), the variable that will receive the data quality and the variable responsible
for disabling the request.
5.8.8.1.1. MODBUS Client Protocol General Parameters – Configuration via Symbolic Mapping
The general parameters, found on the MODBUS protocol configuration initial screen (figure below), are defined as:
The MODBUS Client protocol diagnostics and commands configured, either by symbolic mapping or direct representation,
are stored in T_DIAG_MODBUS_ETH_CLIENT_1 variables. For the direct representation mapping, they are also in 4 bytes
and 8 words which are described in table below (where “n” is the configured value in the %Q Start Address of Diagnostics
Area):
126
5. CONFIGURATION
127
5. CONFIGURATION
Note:
Counters: all MODBUS TCP Client diagnostics counters return to zero when the limit value 65535 is exceeded.
The devices configuration, shown on figure below, follows the following parameters:
Notes:
IP Address: IP address of Modbus Server Device.
TCP Port: if there are multiple instances of the protocol added in a single Ethernet interface, different TCP ports must be
selected for each instance. Some TCP ports, among the possibilities mentioned above, are reserved and therefore cannot be
used. See table Reserved TCP/UDP ports.
Slave address: according to the MODBUS standard, the valid address range for slaves is 0 to 247, where addresses 248 to
255 are reserved. When the master sends a command of writing with the address set to zero, it is performing broadcast requests
on the network.
The parameters in the advanced settings of the MODBUS Client device, found on the button Advanced... in the General
Parameters tab are divided into: Maximum Simultaneous Requests, Communication Time-out, Mode of Connection Time-out
and Inactive Time.
128
5. CONFIGURATION
Notes:
Maximum Simultaneous Requests: it is used with a high scan cycle. This parameter is fixed in 1 (not editable) when the
configured protocol is MODBUS RTU over TCP.
Communication Time-out: the Communication time-out is the time that the client will wait for a server response to the
request. For a MODBUS Client device, two variables of the system must be considered: the time the server takes to process
a request and the response sending delay in case it is set in the server. It is recommended that the time-out is equal or higher
than twice the sum of these parameters. For further information, check Communication Performance section.
Mode: defines when the connection with the server is finished by the client. Below follows the available options:
Connection is closed after a time-out or Connection is never closed in normal situations: Those options presents the same
behavior of Client, close the connection due non response of a request by the Server before reaching the Communication
Time-out.
Connection is closed at the end of each communication: The connection is closed by the Client after finish each request.
Connection is closed after an Inactive Time: The connection will be closed by the Client if it reach the Inactive Time
without performing a request to the Server.
Inactive Time: inactivity connection time.
The MODBUS relations configuration, showed on figure below, follows the parameters described on table below:
129
5. CONFIGURATION
Notes:
Value Variable: this field is used to specify a symbolic variable in MODBUS relation.
Data type: this field is used to specify the data type used in the MODBUS relation.
The configuration of the MODBUS requests, viewed in figure below, follow the parameters described in table below:
130
5. CONFIGURATION
131
5. CONFIGURATION
Notes:
Setting: the number of factory default settings and the values for the column Options may vary according to the data type
and MODBUS function (FC).
Function Code: MODBUS (FC) functions available are the following:
Code
DEC HEX Description
1 0x01 Read Coils (FC 01)
2 0x02 Read Input Status (FC 02)
3 0x03 Read Holding Registers (FC 03)
4 0x04 Read Input Registers (FC 04)
5 0x05 Write Single Coil (FC 05)
6 0x06 Write Single Holding Register (FC 06)
15 0x0F Write Multiple Coils (FC 15)
16 0x10 Write Multiple Holding Registers (FC 16)
22 0x16 Mask Write Holding Register (FC 22)
23 0x17 Read/Write Multiple Holding Registers (FC 23)
Polling: this parameter indicates how often the communication set for this request must be performed. By the end of a
communication will be awaited a time equal to the value configured in the field polling and after that, a new communication
will be executed.
Read Data Start Address: field for the initial address of the MODBUS read data.
Read Data Size: the minimum value for the read data size is 1 and the maximum value depends on the MODBUS function
(FC) used as below:
Read Coils (FC 01): 2000
Read Input Status (FC 02): 2000
Read Holding Registers (FC 03): 125
Read Input Registers (FC 04): 125
Read/Write Multiple Registers (FC 23): 121
Read Data Range: this field shows the MODBUS read data range configured for each request. The initial address, along
with the read data size will result in the range of read data for each request.
Write Data Start Address: field for the initial address of the MODBUS write data.
Write Data Size: the minimum value for the write data size is 1 and the maximum value depends on the MODBUS
function (FC) used as below:
Write Single Coil (FC 05): 1
Write Single Register (FC 06): 1
Write Multiple Coils (FC 15): 1968
132
5. CONFIGURATION
133
5. CONFIGURATION
Notes:
Exception Codes: the exception codes show in this filed is the server returned values. The definitions of the exception
codes 128, 129 and 255 are valid only with Altus slaves. For slaves from other manufacturers these exception codes can have
different meanings.
Disabling Variable: field for the variable used to disable MODBUS requests individually configured within requests. The
request is disabled when the variable, corresponding to the request, is equal to 1, otherwise the request is enabled.
Last Error Code: The codes for the possible situations that cause an error in the MODBUS communication can be
consulted below:
134
5. CONFIGURATION
ATTENTION
Unlike other tasks of an application, when a mark is reached at MainTask debugging, the
MODBUS Ethernet Client instance task or any other MODBUS task will stop being executed
at the moment it tries to write in the memory area. This occurs in order to maintain data
consistency of memory areas while MainTask is not running.
To start a MODBUS Client relation in acyclic form, it is suggested the following method which can be implemented in a
simple way in the user application program:
Define the maximum polling time for the relations;
Keep the relation normally disabled;
Enable the relation at the moment the execution is desired;
Wait for the confirmation of the relation execution finishing and, at this moment, disable it again.
To configure this protocol using Symbolic Mappings, it is necessary to execute the following steps:
Configure the MODBUS server protocol general parameters, as: TCP port, protocol selection, IP filters for Reading
and Writing (available at the Filters Configuration button) and communication times (available at the Server Advanced
Configurations button).
Add and configure MODBUS mappings, specifying the variable name, data type, data initial address and data size.
The description of each configuration is related ahead in this section.
5.8.9.1.1. MODBUS Server Protocol General Parameters – Configuration via Symbolic Mapping
The general parameters, found on the MODBUS protocol initial screen (figure below), are defined as.
135
5. CONFIGURATION
Notes:
TCP Port: if there are multiple instances of the protocol added in a single Ethernet interface, different TCP ports must be
selected for each instance. Some TCP ports, among the possibilities mentioned above, are reserved and therefore cannot be
used. See table Reserved TCP/UDP ports.
The settings present on the Filters... button, described in table below, are relative to the TCP communication filters:
Note:
Filters: filters are used to establish a range of IP addresses that have write or read access to MODBUS relations, being
individually configured. The permission criteria is accomplished through a logical AND operation between the Write Filter
Mask and the IP address of the client. If the result is the same as the Write Filter IP Address, the client is entitled to write. For
example, if the Write Filter IP Address = 192.168.15.0 and the Write Filter Mask = 255.255.255.0, then only customers with
IP address = 192.168.15.x shall be entitled. The same procedure is applied in the Read Filter parameters to define the read
rights.
The communication times of the MODBUS server protocol, found on the Advanced... button of the configuration screen,
are divided into: Task Cycle and Connection Inactivity Time-out.
136
5. CONFIGURATION
Notes:
Task Cycle: the user has to be careful when changing this parameter as it interferes directly in the answer time, data
volume for scanning and mainly in the CPU resources balance between communications and other tasks.
Connection Inactivity Time-out: this parameter was created in order to avoid that the maximum quantity of TCP con-
nections is reached, imagining that inactive connections remain open on account of the most different problems. It indicates
how long a connection (client or server) can remain open without being used (without exchanging communication messages).
If the specified time is not reached, the connection is closed releasing an input in the connection table.
The diagnostics and commands of the MODBUS server protocol configured, either by symbolic mapping or by direct
representation, are stored in variables of type T_DIAG_MODBUS_ETH_SERVER_1 and the mapping by direct representation
are in 4-byte and 8-word, which are described in table below (n is the value configured in the %Q Start Address of Diagnostics
Area field):
137
5. CONFIGURATION
138
5. CONFIGURATION
Note:
Counters: all counters of the MODBUS Ethernet Server Diagnostics return to zero when the limit value 65535 is exceeded.
The MODBUS relations configuration, showed on figure below, follows the parameters described on table below:
Default
Configuration Description Options
Value
Name of a variable declared
Value Variable Symbolic variable name -
in a program or GVL
Coil
Data Type MODBUS data type - Input Status
Holding Register
Input Register
139
5. CONFIGURATION
Default
Configuration Description Options
Value
Starting address of the
Data Start Address - 1 to 65536
MODBUS data
Absolute Data Start Ad- Start address of absolute
- -
dress data of Modbus as its type
Data Size Size of the MODBUS data - 1 to 65536
Data range address config-
Data Range - -
ured
Notes:
Value Variable: this field is used to specify a symbolic variable in MODBUS relation.
Data Type: this field is used to specify the data type used in the MODBUS relation.
Data Start Address: data initial address of the MODBUS relation.
Absolute Data Start Address: absolute start address of the MODBUS data according to their type. For example, the
Holding Register with address 5 has absolute address 400005. This field is read only and is available to assist in Client/Master
MODBUS configuration that will communicate with this device. The values depend on the base address (offset) of each data
type and allowed MODBUS address for each data type.
Data Size: the Data Size value sets the maximum amount of data that a MODBUS relation can access from the initial
address. Thus, in order to read a continuous range of addresses, it is necessary that all addresses are declared in a single
relation. This field varies according to the configured type of MODBUS data.
Data Range: is a read-only field and reports on the range of addresses that is being used by this mapping. It is formed by
the sum of the fields Data Start Address and Data Size. There can be no range overlays with others mappings of the same Data
Type.
ATTENTION
Unlike other tasks of an application, when a mark is reached at MainTask debugging, the
MODBUS Ethernet Server instance task or any other MODBUS task will stop being exe-
cuted at the moment it tries to write in the memory area. This occurs in order to maintain
data consistency of memory areas while MainTask is not running.
140
5. CONFIGURATION
The figure above shows an architecture to communicate a SCADA system and PLCs in automation projects. All the roles
present on a communication are explicit on this figure regardless of the equipment in which it’s executed, since they can be
done in the same equipment or in various ones. Each of the roles of this architecture are described on table below.
Role Description
The field devices and the PLCs are where the operation state and
plant control information are stored. The SCADA system ac-
Programmable Controllers and
cess the information on these devices and store on the SCADA
Field Devices Level
server, so that the SCADA clients can consult it during the plant
operation.
The acquisition network is where the requests for data collected
Acquisition Network by field devices travel, to request the data collected from the
field devices.
A gateway enables the communication between the OPC DA
Server and Nexto Series PLCs. A gateway in the same sub-
Gateway for PLC Communica-
net of the PLC is always necessary, as described in chapter
tion
Communication Settings of MasterTool IEC XE User Manual
– MU299609.
The OPC DA Server is a Module responsible of receiving the
OPC Server Module OPC DA requests and translate them to the communication with
the field devices.
141
5. CONFIGURATION
Role Description
The OPC Client Device module is responsible for the requests to
Device Module OPC Client the OPC DA Server using the OPC DA protocol. The collected
data is stored on the SCADA Server database.
The SCADA Server is responsible for connecting to the various
SCADA Server Level communication devices and store the data collected by them on
a database, so that it can be consulted by the SCADA Clients.
The supervision network is the network through which the
SCADA Clients are connected to the SCADA Servers. In a
Supervision Network topology in which there aren’t multiple Client or where the
Server and the Client are installed on the same equipment, this
kind of network doesn’t exist.
The SCADA Clients are responsible for requesting to the
SCADA Servers the necessary data to be shown in a screen
SCADA Client Level where the operation of a plant is being executed. Through then
it is possible to execute readings and writings on data stored on
the SCADA Server database.
The relation between the tags on the supervision system and the process data on the controller variables is totally trans-
parent. This means that, if there’s an alteration on the data areas through the development of the project, it isn’t necessary to
rework the relations between the information on the PLC and the SCADA, just use the new variable provided by the PLC on
the systems that request this data.
The use of OPC offers more productivity and connectivity with SCADA systems. It contributes with the reduction of
applications development time and with the maintenance costs. It even makes possible the insertion of new data on the
communication in a simplified form and with greater flexibility and interoperability between the automation system, due to the
fact that it’s an open standard.
The installation of the OPC DA Server is done altogether with MasterTool IEC XE installation, and its settings are done
inside the tool. It’s worth notice that the OPC is available only with the local Ethernet interface of the Nexto CPUs. The
Ethernet expansion modules do not support this functionality.
Unlike the communication with drivers such as MODBUS and PROFIBUS DP, to set an OPC DA communication it’s only
necessary to correctly set the node and indicate which variables will be used in the communication. There are two ways to
indicate which variables of the project will be available in the OPC DA Server. In both cases it’s necessary to add the object
Symbol Configuration to the application, in case it isn’t present. To add it, right-click over the object Application and select
the option.
ATTENTION
The variables shown in the objects IoConfig_Globals, IoConfig_Application_Mappings and
IoConfig_Global_Mappings are used internally for I/O control and shouldn’t be used by the
user.
ATTENTION
In addition to the variables declared at SFC language POUs, some implicitly created vari-
ables are also shown. To each step created, a type IecSfc.SFCStepType variable is created,
where the step states can be monitored, namely whether it is active or not and the time that
it’s active as in norm IEC 61131-1. To each transition, a BOOL type variable is created
that defines if the transition is true or false. These variables are shown in the object Symbol
Configuration that can be provided access to the OPC Client.
142
5. CONFIGURATION
The table below presents the descriptions of the Symbol Configuration object screen fields.
Field Description
Symbols Variable identifier that will be provided to the OPC DA Server.
Indicates what the possible access right level are in the declared
symbol. When not utilized, this column remains empty, and the
Access Rights access right level is maximum. Otherwise the access right level
can be modified by clicking over this field. The possible options
are:
Read only
Write only
Read and Write
Indicates the maximum access right level that is possible to as-
sign to the variable. The symbols hold the same meanings from
Maximal
the ones in Access Rights. It’s not possible to change it and it’s
indicated by the presence or not of the attribute ’symbol’
Indicates if attribute ’symbol’ is being used when the variable is
declared. When not used, this column remains empty. For the
Attribute cases in which the attribute is used, the behavior is the follow-
ing:
attribute ’symbol’ := ’read’ the column shows
attribute ’symbol’ := ’write’ the column shows
attribute ’symbol’ := ’readwrite’ the column shows
Type Data type of the declared variable.
When the data type is a Struct, a button is enabled in this col-
Members umn. Clicking on the button will allow the selection of which
elements of that struct will be provided to the OPC DA Server.
Variable comment, inserted on the POU or GVL where the vari-
able was declared. To show up as a variable comment here, the
Comment comment must be entered one line before the variable on the
editor, while in text mode, or in the comment column when in
tabular mode.
When altering the project settings, such as adding or removing variables, it’s necessary to run the command Build, in
order to refresh the list of variables. This command must be executed until the message in Figure 97 disappear. After this, all
available variables in the project, whether they are declared on POUs, GVLs or diagnostics, will be shown here and can be
selected. The selected variables will be available on the OPC DA Server to be accessed by the Clients.
143
5. CONFIGURATION
After this procedure, the project must be loaded into a PLC so the variables will be available for communication with
the OPC DA Server. If the object Symbol Configuration screen is open and any of the variables, POUs or GVLs selected is
changed, its name will appear with the red color. The situations in which this may happen is when a variable is deleted or the
attribute value is modified.
It’s also possible to set which variables will be available on the OPC DA Server through an attribute inserted directly on
the POUs or GVLs where the variables are declared. When the attribute ’symbol’ is present on the variable declaration, and it
may be before the definition of the POU or GVL name, or to each variable individually, these variables are sent directly to the
object Symbol Configuration, with a symbol in the Attribute column. In this case it’s necessary, before loading the project into
the CPU, to run the command Build from within the object Symbol Configuration.
The valid syntaxes to use the attribute are:
attribute ’symbol’ := ’none’ – when the attribute value is ’none’, the variables won’t be available to the OPC DA Server
and won’t be shown in the object Symbol Configuration screen.
attribute ’symbol’ := ’read’ - when the attribute value is ’read’, the variables will be available to the OPC DA Server
with read only access right.
attribute ’symbol’ := ’write’ - when the attribute value is ’write’, the variables will be available to the OPC DA Server
with write only access right.
attribute ’symbol’ := ’readwrite’ – when the attribute value is ’readwrite’, the variables will be available to the OPC DA
Server with read and write access right.
In the following example of variable declaration, the variables A and B settings allow that an OPC DA Server access them
with read and write access. However the variable C cannot be accessed, while the variable D can be accessed with read only
access rights.
When a variable with a type different from the basic types is defined, the use of the attribute must be done inside the
declaration of this DUT and not only in the context in which the variable is created. For example, in the case of a DUT
instance inside of a POU or a GVL that has an attribute, it will not impact in the behavior of this DUT instance elements. It
will be necessary to apply the same access right level on the DUT declaration.
144
5. CONFIGURATION
ATTENTION
The configurations of the symbols that will be provided to the OPC DA Server are stored
inside the PLC project. By modifying these configurations it’s necessary to load the appli-
cation on the PLC so that it’s possible to access those variables.
ATTENTION
When a variable is removed from the project and loaded on the PLC unchecking it from the
object Symbol Configuration, the variable can no longer be read with the OPC Client. If the
variable is added again to the project, with the same name and same context, and inserted on
the object Symbol Configuration, it will be necessary to reboot the OPC Client to refresh the
variable address reference, which will be created on a different memory area of the PLC.
The configuration of the PLC is done inside MasterTool IEC XE through the option available in the Online. It’s necessary
to run MasterTool IEC XE as administrator.
The Gateway Configuration is the same set in the Gateway used for the communication between the MasterTool IEC XE
and the PLC and described in Communication Settings, present in the MasterTool IEC XE User Manual – MU299609. If the
configuration used is localhost the Gateway Address must be filled with 127.0.0.1. This configuration is necessary because
the OPC DA Server uses the same communication gateway and the same protocol used for communication between PLC and
MasterTool IEC XE.
There’s the option Using the Gateway Embedded in PLC that can be selected when it’s desired to use the Gateway that is in
PLC itself. This option can be used to optimize the communication, since it prevent excess traffic through a particular station,
when more than one station with OPC Client is connected to the same PLC.
To configure the PLC, there are two possible configuration types, depending on the selection of the checkbox Use TCP/IP
Blockdriver. When the option isn’t selected, the field Device Name must be filled with the name of the PLC. This is the name
displayed by the PLC selected as active in the Communication Settings screen.
The other option is to use the IP Address of the Ethernet Interfaces. The same address set on the configuration screens must
be put in this field. Furthermore, when this method is used, the port number must be set to 11740. The confirmation will save
the OPC DA Server configurations.
145
5. CONFIGURATION
Default Set-
Device Configuration Description Options
ting
PLC description inside the This field is a STRING and
OPC DA Server configura- it accepts alphanumeric (let-
tion file. This field can have ters and numbers) charac-
any name, but for organiza- ters and the “_” character.
Name ‘PLC01’
tional purposes, it’s recom- It’s not allowed to initiate
mended to use the project a STRING with numbers or
name that is loaded in the with “_”. It allows up to 49
PLC. characters.
IP Address of the computer
that the OPC DA Server is
installed, for the cases in
which all PLCs are in the
Gateway Address same subnetwork. If there’s 127.0.0.1 0.0.0.0 to 255.255.255.255
some PLC that it’s in an-
other subnetwork, it must be
specified the Gateway used
in that subnetwork.
TCP Port for the connection
Gateway Port 1217 2 to 65534
with the Gateway.
It’s the PLC name displayed
in the Communication Set-
This field is a STRING and
tings of the Device tab. The
it accepts any characters,
name is the STRING before
as done in the PLC name
Device Name the hexadecimal value that ‘0000’
configuration in the Device
is between [ ]. Enabled
Communication Settings tab.
only when the checkbox Use
It allows up to 49 characters.
TCP/IP Blockdriver is not
selected.
IP address of the PLC. En-
abled only when the check-
box Use TCP/IP Block-
IP Address Active 192.168.15.1 0.0.0.0 to 255.255.255.255
driver is selected. It is used
only when the setting is not
redundant.
IP address of the PLC A. En-
abled only when the config-
uration is redundant. It is
IP Address PLC A the primary PLC address to 192.168.15.69 0.0.0.0 to 255.255.255.255
which the server will com-
municate if there is no fail-
ure.
IP address of the PLC B. En-
abled only when the config-
uration is redundant. It is the
IP Address PLC B 192.168.15.70 0.0.0.0 to 255.255.255.255
secondary PLC address to
which the server will com-
municate if a failure occurs.
TCP Port. Enabled only
when the checkbox Use
Device Port 11740 11740 or 11739
TCP/IP Blockdriver is se-
lected.
Table 125: Configuration Parameter of each PLC for the OPC DA Server
146
5. CONFIGURATION
When a new PLC needs to be configured on the OPC DA Server, simply press the New Device button and the configuration
will be created. When the setup screen is accessed, a list of all PLCs already configured on the OPC DA Server will be
displayed. Existing configurations can be edited by selecting the PLC in the Devices list and editing the parameters. The PLCs
settings that are no longer in use can be deleted. The maximum number of PLCs configured in an OPC DA Server is 16.
If the automation architecture used specifies that the OPC DA Server must be ran on a computer that does not execute
communication with the PLC via MasterTool IEC XE, the tool must be installed on this computer to allow OPC DA Server
configuration in the same way as done in other situations.
ATTENTION
To store the OPC DA Server configuration, the MasterTool IEC XE must be run with ad-
ministrator rights on the Operational System. Depending on the OS version, this privilege
must be done in the moment that the program is executed: right-click the MasterTool IEC
XE icon and choose Run as Administrator.
ATTENTION
The settings of a PLC on the OPC DA Server are not stored in the project created in Mas-
terTool IEC XE. For this reason, it can be performed with an open or closed project. The
settings are stored in a configuration file where the OPC DA Server is installed. When chang-
ing the settings, it is not required to load the application on the PLC, but depending on the
OPC Client it may be necessary to reconnect to the server or load the settings for the data to
be updated correctly.
Using the button Read Project Configuration, as shown in Figure 99, you can assign the configuration of the open project
to the PLC configuration that is being edited. For this option to work correctly, there must be an open project and an Active
Path should be set as described in Communication Settings, present in the MasterTool IEC XE User Manual – MU299609. If
any of these conditions is not met an error message will be displayed and no data will be modified.
When the above conditions are valid, the PLC settings receive the parameters of the opened project. The IP Address and
Gateway Port information are configured as described in Communication Settings according to the Active Path. However, the
IP Address settings are read from NET 1 Ethernet interface settings. The port for connection to the PLC is always assigned in
this case as 11740.
For each PLC created in the OPC DA Server, status variables are generated, named _CommState and _CommStateOK. The
_CommState variable indicates the communication between the OPC and the PLC state. This state can interpreted by the OPC
Clients according to table below.
147
5. CONFIGURATION
Table 126: Description of the Communication states between OPC DA Server and the PLC
The _CommStateOK is a variable of the Bool type that indicates if the communication between the OPC DA Server and
the PLC is working. When the value is TRUE, it indicates that the communication is working correctly. If the value is FALSE,
for some reason it isn’t possible to communicate with the PLC.
In addition to monitoring the communication status, the OPC Client can access information on the quality of communi-
cation. The quality bits form a byte. They are divided into three groups of bits: Quality, Substatus and Limit. The bits are
distributed as follows QQSSSSLL, in which QQ are the Quality bits, SSSS Substatus bits and LL Limit bits. In this case the QQ
bits are the most significant in the byte, while the LL bits are the least significant.
Table 127 presents the possible quality values. The OPC DA Server only returns Good and Bad Quality values. A OPC
Client can maintain the quality as Uncertain due to failures in which it can’t establish a connection to the Server. In case of
monitoring of the 8 quality bits directly from the OPC DA Server, the Substatus and Limit fields shall be null and the Good
Quality will be presented as the value 192 and the Bad Quality will be value 0.
148
5. CONFIGURATION
Note:
Maximum number of variables communicating with a single PLC: There is no configuration limit. The maximum
possible number of variables depends on the processing capacity of the device.
ATTENTION
The Maximum number of simultaneous connections of an OPC DA Server in a single PLC
is shared with connections made with the MasterTool IEC XE. I.e. the sum of connections of
OPC DA Server and MasterTool IEC XE should not exceed the maximum quantity defined
in Table 128.
The communication between the OPC DA Server and the PLC uses the same protocol used in the MasterTool IEC XE
communication with the PLC. This protocol is only available for the Ethernet interfaces of the Nexto Series CPUs, it’s not
possible to establish this kind of communication with the Ethernet expansion modules.
When a communication between the OPC DA Server and the PLC is established, these two elements start a series of
transactions aimed at solving the addresses of each declared variables, optimizing the communication in data reading regime.
Besides, it’s also resolved in this stage the communication groups used by some Clients in order to optimize the communication.
This initial process demands some time and depends on the quantity of mapped variables and the processing capacity of the
device.
After the configuration of the OPC DA Server, the available data on all PLCs can be accessed via an OPC Client. In the
configuration of the OPC Client, the name of the OPC DA Server must be selected. In this case the name is CoDeSys.OPC.DA.
The figure below shows the server selection on the client driver of the BluePlant SCADA software.
ATTENTION
The same way that in MasterTool IEC XE, some tools must be executed with administrator
privileges in the Operational System for the correct functioning of the OPC Client. Depend-
ing on the OS version, this privilege must be activated in the moment that the program is
executed. To do this, right-click MasterTool IEC XE icon and choose Run as Administrator.
149
5. CONFIGURATION
In cases where the server is remotely located, it may be necessary to add the network path or IP address of the computer
in which the server is installed. In these cases, there are two configuration options. The first is to directly configure it, being
necessary to enable the COM/DCOM Windows Service. However, a simpler way is to use a tunneller tool that abstracts the
COM/DCOM settings, and enable a more secure communication between the Client and the Server. For more information on
this type of tool, refer to the NAP151 - Tunneller OPC.
Once the Client connects with the Server, it’s possible to use the TAGs import commands. These commands consult the
information declared in the PLC, returning a list with all the symbols available in it.
The list of selected variables will be included in the Client communication list and can be used, for example, in a SCADA
system screen.
150
5. CONFIGURATION
ATTENTION
The simulation mode of MasterTool IEC XE software can be used for OPC communication
tests. The information on how to configure it are presented in the Testing an OPC Commu-
nication using the Simulator section of the MasterTool IEC XE User Manual – MU299609.
The figure above presents a typical architecture for SCADA system communication and PLCs in automation design. All
roles present in the communication are explicit in this figure regardless of where they are running, they may be on the same
equipment or on different equipment. Each of the roles of this architecture is described in table below.
151
5. CONFIGURATION
Role Description
The field devices and the PLCs are where the operation state and
plant control information are stored. The SCADA system ac-
Programmable Controllers and
cess the information on these devices and store on the SCADA
Field Devices Level
server, so that the SCADA clients can consult it during the plant
operation.
The OPC UA Server is an internal module of the PLCs respon-
OPC UA Server Modules sible for receiving the OPC UA requests and translating them
for communication with the field devices.
The acquisition network is the network in which OPC UA mes-
Acquisition Network sages travel to request the data that is collected from the PLCs
and field devices.
The OPC UA Client module, which is part of the SCADA
Server, is responsible for making requests to the OPC UA
OPC Client Device Module
Servers using the OPC UA protocol. The data collected by it
is stored in the SCADA Server database.
The SCADA Server is responsible for connecting to the various
SCADA Server Level communication devices and store the data collected by them on
a database, so that it can be consulted by the SCADA Clients.
The supervisory network is the network by which SCADA
Clients are connected to SCADA Servers, often using a propri-
etary SCADA system protocol. In a topology in which multiple
Supervision Network Clients are not used or the Server and Client are installed in the
same equipment, there is no such network, and in this case this
equipment must directly use the OPC UA protocol for commu-
nication with the PLC.
The SCADA Clients are responsible for requesting to the
SCADA Servers the necessary data to be shown in a screen
SCADA Client Level where the operation of a plant is being executed. Through then
it is possible to execute readings and writings on data stored on
the SCADA Server database.
When using the OPC UA protocol, the relationship between the tags of the supervisory systems and the process data in
the controller variables is completely transparent. This means that if data areas change during project development, there is no
need to re-establish relationships between PLC information and SCADA. Simply use the new variable provided by the PLC in
the systems that request this data.
The use of OPC UA offers greater productivity and connectivity with SCADA systems. It contributes to reduced application
development time and maintenance costs. It also enables the insertion of new data in the communication in a simplified way
with greater flexibility and interoperability among the automation systems as it is an open standard.
It is worth noting that the OPC UA is only available on the local Ethernet interfaces of the Nexto CPUs. Ethernet expansion
modules do not support this functionality.
The steps for creating a project with OPC UA are very similar to the steps described in the section Creating a Project
for OPC DA Communication. As with the OPC DA protocol, the configuration of the OPC UA protocol is based on the
configuration of the Symbol Configuration. To enable the OPC UA, simply enable the Support OPC UA Features option in the
configuration, as shown in figure below.
152
5. CONFIGURATION
ATTENTION
When enabling OPC UA protocol support, OPC DA protocol support is still enabled. You
can enable OPC UA and OPC DA communications at the same time to report the variables
configured on the Symbol Configuration object or via attributes.
Another way to access this configuration, once already created a project with the Symbol Configuration object, is given by
accessing the Settings menu of the configuration tab of the Symbol Configuration. Simply select the option Support OPC UA
features to enable support for the OPC UA protocol, as shown in figure below.
After this procedure the project can be loaded into a PLC and the selected variables will be available for communication
with the OPC UA Server.
153
5. CONFIGURATION
This section defines the types of variables that support communication via the OPC UA protocol, when declared within
GVLs or POUs and selected in the Symbol Configuration object (see previous section).
The following types of simple variables are supported:
BOOL
SINT
USINT / BYTE
INT
UINT / WORD
DINT
UDINT / DWORD
LINT
ULINT / LWORD
REAL
LREAL
STRING
TIME
LTIME
You can also use structured types (STRUCTs or Function Blocks) created from previous simple types.
Finally, it is also possible to create arrays of simple types or of structured types.
There is no configuration limit. The maximum possible number of variables depends on the processing capacity of the
device.
When a communication is established between the OPC UA Server and the PLC, these two elements initiate a series of
transactions that aim to solve the address of each declared variable, optimizing the communication in regime of reading of
data. In addition, at this stage, the classifications of the communication groups used by some Clients are also resolved in order
to optimize communication. This initial process takes some time and depends on the amount of variables mapped and the
processing capacity of the device.
If desired, the user can configure encryption for OPC UA communication using the Basic256SHA256 profile, for a secure
connection (cyber security).
To configure encryption on an OPC UA server, you must create a certificate for it using the following steps in the MasterTool
programmer:
1. Define an active path for communication with the controller (no login required);
2. From the View menu, select Security Screen;
3. Click the Devices tab on the left side of this screen;
4. Click the icon to perform a refresh;
5. Click on the Device icon, below which will open several certificates (Own Certificates, Trusted Certificates, Untrusted
Certificates, Quarantined Certificates);
6. Click the icon to generate a certificate and select the following parameters:
Key length (bit): 3072
Validity period (days): 365 (can be modified if desired)
7. Wait while the certificate is calculated and transferred to the controller (this may take a few minutes);
8. Reboot the controller.
9. On the OPC UA client, perform the necessary procedures to connect to the OPC UA server and generate a certificate
with the Basic256Sha256 profile (see specific OPC UA client manual for details);
154
5. CONFIGURATION
10. Back to MasterTool, click on the icon of the Security Screen to perform a refresh;
11. On the Security Screen, select the "Quarantined Certificates" folder under the Device. In the right panel you should
observe a certificate requested by the OPC UA client;
12. Drag this certificate to the folder "Trusted Certificates";
13. Proceed with the settings in the OPC UA client (see specific OPC UA client manual for details).
To remove encryption previously configured on a controller, you must do the following:
1. Define an active path for communication with the controller (no login required);
2. From menu View, select Security Screen;
3. Click on the Devices on the left side of this screen;
4. Click the icon to perform a refresh;
5. Click on the Device icon, below which will open several certificates (Own Certificates, Trusted Certificates, Untrusted
Certificates, Quarantined Certificates);
6. Click the folder "Own Certificates" and in the right panel select the certificate (OPC UA Server);
7. Click the icon to remove this project and driver certificate;
8. Reset (turn off and on) the controller.
Some OPC UA communication parameters are configured on the OPC UA client, and negotiated with the OPC UA server
at the time the connection between both is established. The following subsections describe the main OPC UA communication
parameters, their meaning, and care to select appropriate values for them.
In an OPC UA client it is possible to group the variables of a server into different subscriptions. Each subscription is a
set of variables that are reported in a single communication packet (PublishResponse) sent from the server to the client. The
selection of the variables that will compose each subscription is made in the OPC UA client.
ATTENTION
Grouping variables into multiple subscriptions is interesting for optimizing the processing
capacity and consumption of Ethernet communication bandwidth. Such aspects of optimiza-
tion are analyzed in greater depth in the application note NAP165, where some rules for the
composition of subscriptions are suggested. This application note also discusses in more
depth several concepts about the OPC UA protocol.
Some of the communication parameters described below must be defined for the server as a whole, others for each sub-
scription, and others for each variable that makes up a subscription.
This parameter defines the IP address and TCP port of the server, for example:
opc.tcp://192.168.17.2:4840
In this example, the IP address of the controller is 192.168.17.2.
The TCP port should always be 4840.
The Publishing Interval parameter (unit: milliseconds) must be set for each subscription.
The Sampling Interval parameter must be set for each variable (unit: milliseconds). However, in many OPC UA clients, the
Sampling Interval parameter can be defined for a subscription, being the same for all the variables grouped in the subscription.
Only the variables of a subscription whose values have been modified are reported to the client through a Publish Re-
sponse communication packet. The Publishing Interval parameter defines the minimum interval between consecutive Publish
Response packets of the same subscription, in order to limit the consumption of processing and Ethernet communication
bandwidth.
To find out which subscription variables have changed and are to be reported to the client in the next Publish Response
packet, the server must perform comparisons, and such (samplings) are performed by the same with the Sampling Interval. It
is recommended that the value of Sampling Interval varies between 50% and 100% of the value of the Publishing Interval,
because there is a relatively high processing consumption associated with the comparison process executed in each Sampling
Interval.
It can be said that the sum between Publishing Interval and Sampling Interval is the maximum delay between changing a
value on the server and the transmission of the Publish Response packet that reports this change. Half of this sum is the average
delay between changing a value on the server and the transmission of the Publish Response packet that reports this change.
155
5. CONFIGURATION
These parameters must be maintained with the following fixed values, which are usually the default values on the clients:
Queue Size: 1
Discard Oldest: enable
According to the OPC UA standard, it is possible to define these parameters for each variable. However, many clients
allow you to define common values for all variables configured in a subscription.
Queue Size must be retained with value 1 because there is no event support in this implementation of the OPC UA server,
so it is unnecessary to define a queue. Increasing the value of Queue Size may imply increase communication bandwidth and
CPU processing, and this should be avoided.
Discard Oldest must be maintained with the enable value, so that the Publish Response package always reports the most
recent change of value detected for each variable.
These parameters must be maintained with the following fixed values, which are usually the default values in the clients:
Filter Type: DataChangeFilter
Deadband Type: none
According to the OPC UA standard, it is possible to define these parameters for each variable. However, many clients
allow you to define common values for all variables configured in a subscription.
The Filter Type parameter must be of DataChangeFilter, indicating that value changes in the variables should cause it to
be transmitted in a Publish Response package.
Deadband Type should be kept in “none” because there is no implementation of deadbands for analog variables. In this
way, any change of the analog variable, however minimal, causes its transmission in a Publish Response package.
To reduce processing power and Ethernet communication bandwidth, you can deploy deadbands on your own as follows:
Do not include the analog variable in a subscription;
Instead, include in a subscription an auxiliary variable linked to the analog variable;
Copy the analog variable to the auxiliary variable only when the user-managed deadband is extrapolated.
It is suggested that the following parameters be maintained with the following values, which are usually the default values
in the clients:
PublishingEnabled: true
MaxNotificationsPerPublish: 0
Priority: 0
156
5. CONFIGURATION
After configuration of the OPC UA Server the data available in all PLCs can be accessed via a Client OPC UA. In the
configuration of the OPC UA Client, the address of the correct OPC UA Server must be selected. In this case the address
opc.tcp://ip-address-of-device:4840. The figure below shows the server selection in the SCADA BluePlant client software
driver.
ATTENTION
Like MasterTool IEC XE, some tools need to be run with administrator rights on the Op-
erating System for the correct operation of the OPC UA Client. Depending on the version
of the Operating System this right must be authorized when running the program. For this
operation right click on the tool executable and choose the option Run as administrator.
Once the Client connects to the Server, TAG import commands can be used. These commands query information declared
in the PLC, returning a list with all the symbols made available by the PLC.
157
5. CONFIGURATION
The list of selected variables will be included in the Client’s communications list and can be used, for example, in screens
of a SCADA system.
5.8.12. EtherNet/IP
The EtherNet/IP is a master-slave architecture protocol, consisting of an EtherNet/IP Scanner (master) and one or more
EtherNet/IP Adapters (slave).
The Ethernet/IP protocol is based on CIP (Common Industrial Protocol), which have two primary purposes: The transport
of control-oriented data associated with I/O devices and other system-related information to be controlled, such as configuration
parameters and diagnostics. The first one is done through implicit messages, while the second one is done through explicit
messages.
Their runtime system can act as either Scanner or Adapter. Each CPU’s NET interface support only one EtherNet/IP
instance and it can’t be instanced on an Ethernet expansion module.
An EtherNet/IP Adapter instance supports an unlimited number of modules or Input/Output bytes. In these modules, can
be added variables of types: BYTE, BOOL, WORD, DWORD, LWORD, USINT, UINT, UDINT, ULINT, SINT, INT, DINT,
LINT, REAL and LREAL.
ATTENTION
EtherNet/IP can’t be used together with Ethernet NIC-Teaming nor with Half-Cluster’s re-
dundancy.
ATTENTION
To avoid communication issues, EtherNet/IP Scanner can only have Adapters configured
within the same subnetwork.
5.8.12.1. EtherNet/IP
To add an EtherNet/IP Scanner or Adapter it’s needed to add an EtherNet/IP Interface under the NET interface. This can
be done through the command Add Device. Under this EtherNet/IP Interface it’s possible to add a Scanner or an Adapter.
158
5. CONFIGURATION
159
5. CONFIGURATION
5.8.12.2.1. General
After open the Adapter declared under the Scanner it’s possible to configure it as needed. The first Tab is General, on it is
possible to configure the IP address and the Electronic Keying parameters. These parameters must be checked or unchecked
if the adapter being used is installed on MasterTool. Otherwise, if the adapter used is type Generic, then the fields Vendor
ID, Device type, Product code, Major revision and Minor revision must be fulfilled with the correct information and the boxes
checked as long as needed.
160
5. CONFIGURATION
5.8.12.2.2. Connections
The upper area of the Connections tab displays a list of all configured connections. When there is an Exclusive Owner
connection in the EDS file, it is inserted automatically when the Adapter is added. The configuration data for these connections
can be changed in the lower part of the view.
Notes:
For two or more EtherNet/IP Scanners to connect to the same Remote Adapter:
1. Only one of the Scanners can establish an Exclusive Owner connection.
2. The same value of RPI(ms) must be configured for the Scanners.
The configuration data is defined in the EDS file. The data is transmitted to the remote adapter when the connection is
opened.
161
5. CONFIGURATION
Default
Configuration Description Options
Value
Request Packet Interval: ex- Multiple the Interval of the
RPI (ms) change interval of the input 10 ms Bus Cycle Task to which it
and output data. is associated
Size of the producer data
O -> T Size (Bytes) from the Scanner to the Depends on adapter’s EDS 0 - 65527
Adapter (O -> T)
Size of the consumer data
T -> O Size (Bytes) from the Adapter to the Depends on adapter’s EDS 0 - 65531
Scanner (T -> O)
Config #1 Size (Bytes) Size of configuration data 1. Depends on adapter’s EDS -
Config #2 Size (Bytes) Size of configuration data 2. Depends on adapter’s EDS -
Address of the configuration
Connection Path objects - input objects - out- Depends on adapter’s EDS -
put objects.
To add new connections there is the button Add Connection... which will open the New connection window. On this
window it’s possible to configure a new type of connection from the ones predefined on Adapter’s EDS or a generic connection
from zero.
5.8.12.2.3. Assemblies
The upper area of the Assemblies tab displays a list of all configured connections. When a connection is selected, the
associated inputs and outputs are displayed in the lower area of the tab.
162
5. CONFIGURATION
Configuration Description
Opens the dialog box “Add
Add
Input/Output”
Deletes all selected Input-
Delete
s/Outputs.
Moves the selected In-
Move Up put/Output within the
list.
The order in the list deter-
Move Down mines the order in the I/O
mapping.
Configuration Description
Name of the input/output to
Name
be inserted.
Help String
Type of the input/output to
Data type be inserted. This type also
define its Bit Length.
This value must not be
Bit Length
edited.
I/O Mapping tab shows, in the Variable column, the name of the automatically generated instance of the Adapter under
IEC Objects. In this way, the instance can be accessed by the application. Here the project variables are mapped to adapter’s
inputs and outputs.
The EtherNet/IP Adapter requires Ethernet/IP Modules. The Modules will provide I/O mappings that can be manipulated
by user application through %I or %Q addresses according to its configuration.
New Adapters can be installed on MasterTool with the EDS Files. The configuration options may differ depending on the
device description file of the added Adapter.
163
5. CONFIGURATION
5.8.12.3.1. General
The first tab of the EtherNet/IP Adapter is the General tab. Here you can set the parameters of the Electronic Keying used
in the scanner to check compatibility. In this tab, you can also install the EDS of the device directly in the MasterTool device
repository or export it.
On the EtherNet/IP I/O Mapping tab, you can configure which bus cycle task the Adapter will execute.
164
5. CONFIGURATION
5.8.12.4.1. Assemblies
The parameters of the module’s General tab follow the same rules as described in the 131 and 132 tables.
The I/O Mapping tab shows, in the Variable column, the name of the automatically generated Adapter instances. In this
way, the instance can be accessed by the user application.
165
5. CONFIGURATION
The table below shows the supported variable type by the Nexto Series CPU for each protocol IEC 60870-5-104 data type.
Notes:
Regulating Step Command: The Lower and Higher object states of the C_RC_NA are associated respectively to OFF
and ON internal DBP type states.
Step Position Information: According to item 7.3.1.5 of Standard IEC 60870-5-101, this 8 bit variable is compose by two
fields: value (defined by the 7 bits less significant) and transient (defined as the most significant bit, which indicates when the
measured device is transitioning).
Below, there is a code example for fields manipulation in an USINT type variable. Attention, because this code doesn’t
consist if the value is inside the range, therefore this consistency remains at user’s charge.
166
5. CONFIGURATION
PROGRAM UserPrg
VAR
usiVTI: USINT; // Value with transient state indication, mapped for the Client
siValue: SINT; // Value to be converted to VTI. Must be between -64 and +63
bTransient: BOOL; // Transient to be converted to VTI
END_VAR
PROGRAM UserPrg
VAR
iAnalogIn: INT;
iAnalogOut: INT;
diCounter: DINT;
END_VAR
The double digital points are used to indicate equipment position, such as valves, circuit breakers and secctioners, where
the transition between open and close states demand a determined time. Can thus indicate an intermediary transition state
between both final states.
Double digital points are also used as outputs and, in an analogous way, it is necessary to keep one of the outputs enabled
for a certain time to complete the transition. Such actuation is done through pulses, also known by trip/close commands, with
determined duration (enough to the switching of the device under control).
Consult the Double Points section of Utilization Manual for information about double digital points through DBP data
type.
Once the Nexto Series digital input and output modules don’t support DBP points mapping, some application trickery
are needed to make it possible. Remembering that is also not possible to use the PulsedCommand function, defined at the
LibRtuStandard library, to operate the Nexto Series digital double points.
For the digital input modules it is needed two auxiliary variables’ declaration, to be mapped on the digital input module,
besides the double point that is wished to map on the server:
167
5. CONFIGURATION
Done the variables declaration, it is necessary to create a link between the value variables and the digital input module
quality, through the CPU’s Internal Points tab:
The double point value variable must be mapped at the server IEC 60870-5-104 driver, and both simple variables at the
Nexto Series digital input module (in that example, a NX1001). Typically the OFF (TRIP) state is mapped to the even input
and the ON (CLOSE) state to the odd input.
Figure 119: Double Point Variables Mapping on the Client IEC 60870-5-104
168
5. CONFIGURATION
At last, the user must insert two code lines in its application, to be cyclically executed, to simple variables value attribution
to double point:
DBP value variable, index ON, receive simple point ON value
DBP value variable, index OFF, receive simple point OFF value
For the digital output modules it must be used the CommandReceiver function block to intercept double points actuation
commands originated from the clients IEC 60870-5-104. Consult the section Interception of Commands Coming from the
Control Center for further information.
The example code below, POU CmdRcv, treats pulsed commands received from clients for a digital double point, mapped
in a NX2020 module. Besides the following ST code it is need to map a DBP point in Nexto’s IEC 60870-5-104 server.
Figure 122: Mapping of Digital Output Double Point variables on IEC 60870-5-104 Client
PROGRAM CmdRcv
VAR
CmdReceive: CommandReceiver; // Interceptor Instance
169
5. CONFIGURATION
COMMAND_TYPE.NO_COMMAND:
COMMAND_TYPE.SELECT:
COMMAND_TYPE.OPERATE:
170
5. CONFIGURATION
fbPulsedCmd(
byCmdType:= 102,
byPulseTime:= DWORD_TO_BYTE(CmdReceive.sCommand.sOperateParameters.
sValue.sDoublePoint.sPulseConfig.dwOffDuration/10),
ptDbpVarAdr:= ADR(dbpIEC104),
stQuality:= IOQualities.QUALITY_NX2020[5],
byStatus=> byResult);
END_IF
ELSE
// Returns command not supported
byResult:= 1;
END_IF
COMMAND_TYPE.CANCEL:
END_CASE
END_IF
CmdReceive();
IF CmdReceive.bDone THEN
CmdReceive.bDone:= FALSE;
END_IF
As can be observed in the previous code, to help in the pulse generation in Nexto’s digital double outputs, it was created
171
5. CONFIGURATION
and used a function block equivalent to PulsedCommand function of library LibRtuStandard. The PulsedCommandNexto()
function block shows up coded in ST language.
FUNCTION_BLOCK PulsedCommandNexto
VAR_INPUT
byCmdType: BYTE; // command type:
// 100 = status
// 101 = close/on
// 102 = trip/off
byPulseTime: BYTE; // Pulse duration (in hundredths of second)
ptDbpVarAdr: POINTER TO DBP; // DBP variable address (can be mapped)
stQuality: QUALITY; // DBP point quality(digital module)
END_VAR
VAR_OUTPUT
bON: BOOL; // Odd output mapped on Nexto DO module
bOFF: BOOL; // Even output mapped on Nexto DO module
byStatus: BYTE:= 7; // Function return:
// 1 = invalid command
// 2 = Time out of valid range (2..255)
// 3 = command changed in running time
// 4 = module did not answer to the command (absent)
// 5 = command started or running
// 6 = There is already an active command on this point
// 7 = pulse command finished with success
END_VAR
VAR
byState: BYTE; // Function block state
udiPulseEnd: UDINT; // Pulse end instant
END_VAR
172
5. CONFIGURATION
byStatus:= 2;
END_IF
END_CASE
173
5. CONFIGURATION
To the General Parameters configuration of an IEC 60870-5-104 Server according to figure below follow the table below
parameters:
Factory De-
Parameter Description Possibilities
fault
Set the connection mode
Connection Mode with the Connected Client Port Port
modules. IP
Defines which PLC’s TCP
port number will be used to
communicate with the Con-
TCP Port 2404 1 to 65535
nected Client modules. In
case the “Connection Mode”
field is set as "IP".
To configure the IEC 60870-5-104 Server data relation, viewed on figure below follow the parameters described on table
below:
174
5. CONFIGURATION
Factory De-
Parameter Description Possibilities
fault
Name of a variable declared
Value Variable Symbolic variable name -
in a POU or GVL
Single Point Information
Double Point Information
Step Position Information
Measured Value (Normal-
IEC 60870-5-104 object ized)
Object Type -
type configuration Measured Value (Scaled)
Measured Value (Short
Floating Point)
Integrated Totals
Single Command
Double Command
Regulating Step Command
Setting Point Command
(Normalized)
Setting Point Command
(Scaled)
Setting Point Command
(Short Floating Point)
IEC 60870-5-104 mapping
Object Address - 1 to 65535
first point’s index
Specifies the maximum data
quantity that an IEC 60870-
Size - 1 to 86400000
5-104 mapping will can ac-
cess
Configured data address
Range - -
range
Name of the symbolic vari- Name of a variable declared
Counter Variable able which will hold the - in a POU, GVL or counter
counter variable’s value module
Name of the symbolic vari-
Name of a variable declared
Dead Band Variable able which will hold the -
in a POU or GVL
dead band’s value
Defines the dead band type Absolute
Dead Band Type Disabled
to be used in the mapping Disabled
Integrated
Defines if it is required a
Select Required previous select to run a com- False True
mand False
175
5. CONFIGURATION
Factory De-
Parameter Description Possibilities
fault
Defines the short pulse time
Short Pulse (ms) to an IEC 60870-5-104 digi- 1000 1 to 86400000
tal command
Defines the long pulse time
Long Pulse (ms) to an IEC 60870-5-104 digi- 2000 1 to 86400000
tal command
Notes:
Value Variable: When a read command is sent, the return received in the answer is stored in this variable. When it is a
write command, the written value is going to be stored in that variable. The variable can be simple, array, array element or can
be at structures.
Counter Variable: This field applies only on mapping of Integrated Totals type objects, being this the controller variable
to be managed on process. It must has same type and size of the variable declared on Value Variable column, which value is
going to be read, or reported to, the client in case of events.
ATTENTION
When the Counter Variable has a quality variable associated, to the quality to be transferred
to the frozen variable at freeze command, it must be associated a quality variable to the
frozen one. This procedure must be done through Internal Points tab.
Dead Band Variable: This field applies only to input analog variables (Measured Value type objects) mappings. It must
has same type and size of the variable declared on Value Variable column. New dead band variable values are going to be
considered only when the input analog variable change its value.
Dead Band Type: The configuration types available to dead band are:
Short Pulse and Long Pulse: At the define of short and long pulses duration time it must be considered the limits
supported by the device which will treat the command. For example, case the destiny is an output card, which is not supported
in native by Nexto Series. It must be checked at the module’s Datasheet what the minimum and maximum times, as well as
the resolution, to running the pulsed commands.
To the IEC 60870-5-104 Server link layer parameters configuration, shown on figure below, follow the described parameters
on table below:
176
5. CONFIGURATION
Factory De-
Parameter Description Possibilities
fault
Listened port address to
client connection. Used
Port Number 2404 1 to 65535
when the client connection
isn’t through IP
Connected client IP, used
IP Address when the client connection 0.0.0.0 1.0.0.1 to 223.255.255.254
is through IP
IEC 60870-5-104 address,
Common Address of
if the connected client is 1 1 to 65534
ASDU
through IP
Time period (in seconds)
that the device waits the re-
ceiving of an acknowledge
Time-out t1 (s) 15 1 to 180
message after sent an APDU
message type I or U (data),
before close the connection
Time period (in seconds)
that the device waits to
Time-out t2 (s) send a watch message (S- 10 1 to 180
Frame) acknowledging the
data frame receiving
Time period (in seconds) in
what is going to be sent a
Time-out t3 (s) message to link test in case 20 1 to 180
there is no transmission by
both sides
Maximum number of data
messages (I-Frame) trans-
Parameter k (APDUs) 12 1 to 12
mitted and not acknowl-
edged
177
5. CONFIGURATION
Factory De-
Parameter Description Possibilities
fault
Maximum number of
data messages (I-Frame)
Parameter w (APDUs) 8 1 to 8
received and not acknowl-
edged
Note:
The fields Time-out t1 (s), Time-out t2 (s) and Time-out t3 (s) are dependents between themselves and must be configured
in a way that Time-out t1 (s) be bigger than Time-out t2 (s) and Time-out t3 (s) be bigger than Time-out t1 (s). If any of these
rules be not respected, error messages are going to be generated during the project compilation.
ATTENTION
For slow communication links (example: satellite communication), the parameters Time-out
t1 (s), Time-out t2 (s) and Time-out t3 (s) must be properly adjusted, such as doubling the
default values of these fields.
To configure the IEC 60870-5-104 Server application layer, shown on figure below, follow the parameters described on
table below:
Factory De-
Parameter Description Possibilities
fault
Enable Time Synchroniza- Option to Enable/Disable Disabled
Disabled
tion time sync request Enabled
Option to Enable/Disable
Time Synchronization
the treatment of the synchro- Disabled
Command Received in Enabled
nization command in local Enabled
Local Time
time
178
5. CONFIGURATION
Factory De-
Parameter Description Possibilities
fault
Option to Enable/Disable
Use Local Time instead of Disabled
the time stamp in local time Disabled
UTC Time Enabled
for events
Time period in which the
selection command will
remain active (the count
Maximum Time Between
starts from the received 5 1 to 180
Select and Operate (s)
selection command ac-
knowledge) waiting the
Operate command
Transmission Mode of Analog input events trans- All Events All Events (SOE)
Analog Input Events mission mode (SOE) Most Recent Event
Freeze by
counter-
Frozen counters transmis- interrogation Freeze by counter-
Transmission Mode sion mode (Integrated To- command, interrogation command,
tals) transmit transmit spontaneously
sponta- Freeze and transmit by
neously counter-interrogation
command
Notes:
Enable Time Synchronization: Once enabled, allow the IEC 60870-5-104 Server adjust the CPU’s clock when a sync
command is received.
Time Synchronization Command Received in Local Time: When enabled, the IEC 60870-5-104 Server adjusts the CPU
clock by treating the time received in the synchronization command as local time. Otherwise, this time is considered UTC.
Use Local Time instead of UTC Time: Once enabled, the time stamp of the events generated by IEC 60870-5-104 Server
will be sent according to the CPU’s local time.
ATTENTION
When the time sync option is checked in more than one server, the received times from
different servers will be overwritten in the system clock in a short time period, being able to
cause undesirable behaviors due to delays on messages propagation time and system load.
Transmission Mode of Analog Inputs Events: The Analog Inputs Events transmission modes available are the following:
Table 139: IEC 60870-5-104 Server Transmission Modes of Analog Inputs Events
Transmission Mode: The available transmission modes of the frozen counters (Integrated Totals) are the following:
179
5. CONFIGURATION
Table 140: IEC 60870-5-104 Server Transmission Modes of the Frozen Counters
ATTENTION
The Standard IEC 60870-5-104, section Transmission control using Start/Stop, foresee the
commands STARTDT and STOPDT utilization to data traffic control between client and
server, using simple or multiple connections. Despite Nexto supports such commands, its
utilization isn’t recommended to control data transmission, mainly with redundant CPUs,
because such commands aren’t synchronized between both CPUs. Instead of using multiple
connections between client and Nexto server, it’s suggested the use of NIC Teaming re-
sources to supply (physically) redundant Ethernet channels and preserve the CPU resources
(CPU control centers).
The IEC 60870-5-104 Server protocol diagnostics are stored in T_DIAG_IEC104_SERVER_1 type variables, which are
described in table below:
180
5. CONFIGURATION
The standard IEC 60870-5-104 foresee four different command qualifiers for the objects Single Command, Double Com-
mand and Regulating Step Command, all supported by the Nexto Server.
Each object type has a specific behavior to each command qualifier, as can be seen on the table below.
Note:
Command Interception: For further information about commands interception of IEC 608705-104 clients, consult section
Interception of Commands Coming from the Control Center, implemented through CommandReceiver function block.
181
5. CONFIGURATION
A special care must be taken considering the physical bus lenght and the selected baudrate. The following table shows the
maximum bus lenght that can be used safely with a given baudrate:
The configuration of a CANopen network uses the same standard procedure of other fieldbuses configuration on MasterTool
IEC XE.
To add a CANopen Manager, right-click on the CAN interface and select Add Device. Expand the itens until finding
CANopen_Manager device and click on the Add Device button. The CANopen Manager device will appear below the CAN
interface as shown on the following picture:
182
5. CONFIGURATION
To add a CANopen slave device, first you need to install it on the Device Repository. To do that, go to Tools -> Device
Repository and install the device EDS file.
After that, right-click on the CANopen_Manager device and click on Add Device. Search the devices you desire and click
on Add Device button like shown on the following picture:
The CANopen Manager comes with a ready-to-use configuration (default values). Typically, it is just needed to set the
correct baudrate and slave address to have a network running.
The main parameters of CANopen manager are located at General tab:
The detailed description of CANopen Manager general parameters can be found on section Device Editors -> CANopen
of MasterTool IEC XE Online Help (F1).
Additionally, the tab CANopen I/O Mapping allows to change the bus cycle task:
183
5. CONFIGURATION
By default, the bus cycle task is configured to use the MainTask. This is the recommended setting for most of the applica-
tions. Changing this setting is only required on a very specific scenario which requires the implementation of a time-critical
control loop using CANopen I/O (5ms lets say) that can not be performed on MainTask due to heavy application code.
The configuration of CANopen Remote Devices (Slaves) is separated in the first four tabs shown on the following picture:
The General tab contains the slave address (Node ID), Nodeguarding and Emergency object settings.
The PDO tab contains the configuration of process data (I/O data) that will be exchanged.
The SDO tab contains the SDO objects which can be selected to be accessed by SDO read/write FunctionBlock provided
by CiA405 library.
The detailed description of CANopen Slave parameters can be found on section "Device Editors -> CANopen of Master-
Tool IEC XE Online Help (F1).
184
5. CONFIGURATION
In this tab, it’s possible to choose the controller operation mode through the configuration parameter. This is available only
when the controller is in STOP. Use the Apply Configuration button to change to the desired mode. The Xpress will reboot and
configure the new operation mode. The available options are:
Programmable Controller: default controller function, which can be programmed according to user needs.
CANopen Slave: remote I/O expansion function, where the controller becomes a CANopen slave, which can commu-
nicate to other controllers through CANopen Manager.
ATTENTION
The remote operation mode uses an application developed only for I/O expansion, which
runs in a 5 ms MainTask cycle. It’s not possible change or download an application in this
mode.
When in remote operation mode, some features of the controller will be modified. The controller can’t be found by the
MasterTool. However, it’s possible to find the device via Easy Connection, even change its IP, without erase the application.
Besides that, in the Firmware Update tab on the Web page, the Erase Application option is unavailable.
185
5. CONFIGURATION
Click in the items with the + on the right to expand the configuration panel. All parameters shown in the I/O Configuration
are the same mentioned in the Integrated I/O section. While the CANopen Slave Configuration parameters are the same of
those in the CANopen Manager section.
After the configuration step, it’s possible to use the Export Configuration button to download a file called WebRemote-
Configuration.config. This file contains all parameters configured in the Remote I/O Configuration screen. You can use this
file to load the configuration through the Import Configuration button. Besides that, you can download the CANopen Slave
Electronic Data Sheet (EDS) file directly by the Download EDS button in the Web.
When the configuration is done, click in Apply Configuration to reboot the controller with the new settings. The Web page
will automatically reload to the configured IP. The mode change can be confirmed by the CANopen Slave in the Operation
Mode field, in the PLC Overview tab.
186
5. CONFIGURATION
Therefore, it’s possible to use a controller with the CANopen Manager feature (e.g. XP325) to access the CANopen Slave
I/O. See the CANopen Manager section in this document to learn how use this feature. The CANopen Slave Remote PDOs are
organized as follow:
Digital I/Os are accessed by groups. They use a byte, where each bit is an digital I/O (e.g. I00 is the less significant bit
- LSB - and I07, the most significant bit - MSB). Analog I/Os are transmitted/received directly through an integer. And the
diagnostics of each analog I/O are received in a byte, according to the following tables:
187
5. CONFIGURATION
ATTENTION
PDOs can’t be edited or removed from the CANopen Slave. It’s not possible to create your
own CANopen slave device.
How the CANopen Slave is not accessible by the user via MasterTool, the RUN and STOP state of the application are con-
trolled by the CANopen slave operation state. To put the CANopen Slave in RUN, it’s necessary to set the state to Operational
(green symbol next to the device). To put it in STOP, you need to use the NMT Function Block of the CiA405 library - see
Online Help (F1) - to change the CANopen slave operation state (recommended). Or, you can remove the CAN connector
of the remote controller. The CAN LED can keep blinking once it indicates the message transmission and reception, not the
operation state of the CANopen protocol.
188
5. CONFIGURATION
For a device MODBUS Ethernet Server, we can assert that the device is capable to answer a x number of requisitions per
second. Or, in other words, the Server is able to transfer n bytes per second, depending on the size of each requisition. As
smaller is the cycle time of the MODBUS Server task, higher is the impact of the number of connections in his answer rate.
However, for cycle times smaller than 20 ms this impact is not linear and the table below must be viewed for information.
The table below exemplifies the number of requisitions that a MODBUS Server inserted in a local Ethernet interface is
capable to answer, according to the cycle time configured for the MODBUS task and the number of active connections:
189
5. CONFIGURATION
ATTENTION
The communication performances mentioned in this section are just examples, using a CPU
with only one device MODBUS TCP Server, with no logic to be executed inside the appli-
cation that could delay the communication. Therefore, these performances must be taken as
the maximum rates.
For cycle times equal or greater than 20 ms, the increase of the answer rate is linear, and may be calculated using an
equation:
N = C x (1 / T )
Where:
N is the medium number of answers per second;
C is the number of active connections;
T is the MODBUS task interval in seconds.
As an example a MODBUS Server, with only one active connection and a cycle time of 50 ms we get:
C = 1; T = 0,05 s;
N = 1 x (1 / (0,05))
N = 20
That is, in this configuration the MODBUS Server answers, on average, 20 requisitions per second.
In case the obtained value is multiplied by the number of bytes in each requisition, we will obtain a transfer rate of n bytes
per second.
190
5. CONFIGURATION
5.12. SNMP
5.12.1. Introduction
SNMP (Simple Network Management Protocol) is a protocol widely used by network administrators to provide important
information and diagnostic equipment present in a given Ethernet network.
This protocol uses the concept of agent and manager, in which the manager sends read requests or write certain objects to
the agent. Through a MIB (Management Information Base) the manager is aware of existing objects in the agent, and thus can
make requests of these objects, respecting the read permissions or writing the same.
MIB is a collection of information organized hierarchically in which each object of this tree is called OID (Object Identi-
fier). For all equipments with SNMP, it is mandatory to support MIB-II, which have key information for managing Ethernet
networks.
By default, the SNMP agent is activated, i.e., the service is initialized at the time the controller is started. The access to the
agent information is via the Ethernet interface, TCP port 161. The following figure shows an example of an SNMP manager
reading some values.
191
5. CONFIGURATION
For SNMPv3, in which there is user authentication and password to requests via SNMP protocol, is provided a standard
user described in the User and SNMP Communities section.
If you want to disable the service, change the SNMPv3 user or communities for SNMPv1 / v2c predefined, you must access
the controller’s web page as described on the following section.
192
5. CONFIGURATION
ATTENTION
The Username and Password to access the agent via SNMP protocol are the same used to
login on the SNMP Settings web page.
It’s possible to access SNMP v3 using default user, see table below:
For all settings of communities, user and password, some limits must be respected, as described on the following table:
193
5. CONFIGURATION
5.13.1.1.1. GetDateAndTime
194
5. CONFIGURATION
PROGRAM UserPrg
VAR
Result : RTC_STATUS;
DATEANDTIME : EXTENDED_DATE_AND_TIME;
xEnable : BOOL;
END_VAR
--------------------------------------------------------------------------
IF xEnable = TRUE THEN
Result := GetDateAndTime(DATEANDTIME);
xEnable := FALSE;
END_IF
5.13.1.1.2. GetTimeZone
The following function reads the Time Zone configuration, this function is directly related with time in Time Zone at SNTP
synchronism service:
195
5. CONFIGURATION
PROGRAM UserPrg
VAR
GetTimeZone_Status : RTC_STATUS;
TimeZone : TIMEZONESETTINGS;
xEnable : BOOL;
END_VAR
--------------------------------------------------------------------------
IF xEnable = TRUE THEN
GetTimeZone_Status := GetTimeZone(TimeZone);
xEnable := FALSE;
END_IF
5.13.1.1.3. GetDayOfWeek
When called, the function will read the day of the week and fill the structure DAYS_OF_WEEK.
Utilization example in ST language:
PROGRAM UserPrg
VAR
DayOfWeek : DAYS_OF_WEEK;
END_VAR
--------------------------------------------------------------------------
DayOfWeek := GetDayOfWeek();
196
5. CONFIGURATION
The clock settings are made through function and function blocks as follows:
5.13.1.2.1. SetDateAndTime
SetDateAndTime function is used to write the settings on the clock. Typically the precision is on the order of hundreds of
milliseconds.
When a rising edge occurs at the REQUEST input, the function block will write the new DATEANDTIME values on the
clock. If the writing is successfully done, the DONE output will be equal to TRUE. Otherwise, the ERROR output will be equal
to TRUE and the error will appear in the STATUS variable.
Utilization example in ST language:
PROGRAM UserPrg
VAR
SetDateAndTime : SetDateAndTime;
xRequest : BOOL;
DateAndTime : EXTENDED_DATE_AND_TIME;
xDone : BOOL;
197
5. CONFIGURATION
xExec : BOOL;
xError : BOOL;
xStatus : RTC_STATUS;
END_VAR
--------------------------------------------------------------------------
IF xRequest THEN
SetDateAndTime.REQUEST:=TRUE;
SetDateAndTime.DATEANDTIME:=DateAndTime;
xRequest:= FALSE;
END_IF
SetDateAndTime();
SetDateAndTime.REQUEST:=FALSE;
IF SetDateAndTime.DONE THEN
xExec:=SetDateAndTime.EXEC;
xError:=SetDateAndTime.ERROR;
xStatus:=SetDateAndTime.STATUS;
END_IF
ATTENTION
If you try to write time values outside the range of the RTC, the values are converted to
valid values, provided they do not exceed the valid range of 01/01/2000 to 12/31/2035. For
example, if the user attempts to write the value 2000 ms, it will be converted to 2 seconds,
write the value 100 seconds, it will be converted to 1 min and 40 seconds. If the type value
of 30 hours, it is converted to 1 day and 6 hours, and so on.
5.13.1.2.2. SetTimeZone
The following function block makes the writing of the time zone settings:
When called, the function will configure the TIMEZONE with the new system time zone configuration. The configuration
results is returned by the function.
198
5. CONFIGURATION
PROGRAM UserPrg
VAR
Status : RTC_STATUS;
TimeZone : TIMEZONESETTINGS;
xWrite : BOOL;
END_VAR
--------------------------------------------------------------------------
//FB SetTimeZone
IF (xWrite = TRUE) THEN
Status := SetTimeZone(TimeZone);
IF Status = RTC_STATUS.NO_ERROR THEN
xWrite := FALSE;
END_IF
END_IF
ATTENTION
To perform the clock should be used time and date values within the following valid range:
00:00:00 hours of 01/01/2000 to 12/31/2035 23:59:59 hours, otherwise , is reported an error
through the STATUS output parameter. For details of the STATUS output parameter, see the
section RTC_STATUS.
5.13.2.1. EXTENDED_DATE_AND_TIME
This structure is used to store the RTC date when used the function blocks for date reading/setting within milliseconds of
accuracy. It is described in the table below:
199
5. CONFIGURATION
5.13.2.2. DAYS_OF_WEEK
5.13.2.3. RTC_STATUS
This enumerator is used to return the type of error in the RTC setting or reading and it is described in the table below:
5.13.2.4. TIMEZONESETTINGS
This structure is used to store the time zone value in the reading/setting requests of the RTC’s function blocks and it is
described in table below:
200
5. CONFIGURATION
Note:
Function Blocks of Writing and Reading of Date and Hour: different libraries of NextoStandard, which have function
blocks or functions that may perform access of reading and writing of date and hour in the system, are not indicated. The
NextoStandard library has the appropriate interfaces for writing and reading the system’s date and hour accordingly and for
informing the correct diagnostics.
After updating the CPU column of files, the root directory of files stored in the CPU will be shown. Then it will be possible
to select the folder where the files will be transferred to. The “InternalMemory” folder is a default folder to be used to store
files in the CPU’s internal memory, since it is not possible to transfer files to the root directory. If necessary, the user can create
other folders in the root directory or subfolders inside the “InternalMemory” folder.
ATTENTION
The files contained in the folder of a project created by MasterTool IEC XE have special
names reserved by the system in this way cannot be transferred through the Files tab. If the
user wishes to transfer a project to the user memory, you must compact the folder and then
download the compressed file (*.zip for example).
In case it is necessary to transfer documents from the CPU to the PC in which the MasterTool IEC XE software is installed,
the user must follow a very similar procedure to the previously described, as the file must be selected from the right column
and the button “«” pressed, placed on the center of the screen.
Furthermore, the user has some operation options in the storing files area, which are the following:
New directory : allows the creation of a new folder in the user memory area.
Delete item : allows the files excluding in the folders in the user memory area.
Refresh : allows the file updating, on the MasterTool IEC XE screen, of the files in the user memory area and in the
computer.
201
5. CONFIGURATION
ATTENTION
For a CPU in Stop Mode or with no application, the transfer rate to the internal memory is
approximately 150 Kbytes/s.
202
5. CONFIGURATION
203
5. CONFIGURATION
204
5. CONFIGURATION
205
5. CONFIGURATION
5.15.1.1. SERIAL_CFG
This function block is used to configure and initialize the desired serial port. After the block is called, every RX and TX
queue associated to the serial ports and the RX and TX FIFO are restarted.
206
5. CONFIGURATION
Utilization example in ST language, after the library Nexto Serial is inserted in the project:
PROGRAM UserPrg
VAR
Config: SERIAL_CFG;
Port: SERIAL_PORT := COM1;
Parameters: SERIAL_PARAMETERS := (BAUDRATE := BAUD9600,
DATABITS := DATABITS_8,
207
5. CONFIGURATION
STOPBITS := STOPBITS_1,
PARITY := PARITY_NONE,
HANDSHAKE := RS232_RTS,
UART_RX_THRESHOLD := 8,
MODE :=NORMAL_MODE,
ENABLE_RX_ON_TX := FALSE,
ENABLE_DCD_EVENT := FALSE,
ENABLE_CTS_EVENT := FALSE);
Status: SERIAL_STATUS;
END_VAR
//INPUTS:
Config.REQUEST := TRUE;
Config.PORT := Port;
Config.PARAMETERS := Parameters;
//FUNCTION:
Config();
//OUTPUTS:
Config.DONE;
Config.EXEC;
Config.ERROR;
Status := Config.STATUS; //If it is necessary to treat the error.
5.15.1.2. SERIAL_GET_CFG
The function block is used to capture the desired serial port configuration.
208
5. CONFIGURATION
PROGRAM UserPrg
VAR
GetConfig: SERIAL_GET_CFG;
Port: SERIAL_PORT := COM1;
Parameters: SERIAL_PARAMETERS;
Status: SERIAL_STATUS;
END_VAR
//INPUTS:
GetConfig.REQUEST := TRUE;
GetConfig.PORT := Port;
//FUNCTION:
GetConfig();
//OUTPUTS:
GetConfig.DONE;
GetConfig.EXEC;
GetConfig.ERROR;
Status := GetConfig.STATUS; //If it is necessary to treat the error.
Parameters := GetConfig.PARAMETERS; //Receive the parameters of desired serial
port.
5.15.1.3. SERIAL_GET_CTRL
This function block is used to read the CTS, DSR and DCD control signals, in case they are available in the serial port. A
false value will be returned when there are not control signals.
209
5. CONFIGURATION
Utilization example in ST language, after the library is inserted in the project and the serial port configured:
PROGRAM UserPrg
VAR
Get_Control: SERIAL_GET_CTRL;
210
5. CONFIGURATION
5.15.1.4. SERIAL_GET_RX_QUEUE_STATUS
This block is used to read some status information regarding the RX queue, specially developed for the normal mode, but
it can also be used in the extended mode.
211
5. CONFIGURATION
Utilization example in ST language, after the library is inserted in the project and the serial port configured:
PROGRAM UserPrg
VAR
Get_Status: SERIAL_GET_RX_QUEUE_STATUS;
Port: SERIAL_PORT := COM1;
Status: SERIAL_STATUS;
Status_RX: SERIAL_RX_QUEUE_STATUS;
END_VAR
//INPUTS:
Get_Status.REQUEST := TRUE;
Get_Status.PORT := Port;
//FUNCTION:
Get_Status();
//OUTPUTS:
Get_Status.DONE;
Get_Status.EXEC;
Get_Status.ERROR;
Status := Get_Status.STATUS; //If it is necessary to treat the error.
Status_RX := Get_Status.RXQ_STATUS; //If it is necessary to treat the error of
the RX.
5.15.1.5. SERIAL_PURGE_RX_QUEUE
This function block is used to clean the serial port RX queue, local and remote. The UART RX FIFO is restarted too.
212
5. CONFIGURATION
Utilization example in ST language, after the library is inserted in the project and the serial port configured:
PROGRAM UserPrg
VAR
Purge_Queue: SERIAL_PURGE_RX_QUEUE;
Port: SERIAL_PORT := COM1;
Status: SERIAL_STATUS;
END_VAR
//INPUTS:
Purge_Queue.REQUEST := TRUE;
Purge_Queue.PORT := Port;
//FUNCTION:
213
5. CONFIGURATION
Purge_Queue();
//OUTPUTS:
Purge_Queue.DONE;
Purge_Queue.EXEC;
Purge_Queue.ERROR;
Status := Purge_Queue.STATUS; //If it is necessary to treat the error.
5.15.1.6. SERIAL_RX
This function block is used to receive a serial port buffer, using the RX queue normal mode. In this mode, each character
in the RX queue occupy a single byte which has the received data, storing 5, 6, 7 or 8 bits, according to the serial interface
configuration.
214
5. CONFIGURATION
Utilization example in ST language, after the library is inserted in the project and the serial port configured:
PROGRAM UserPrg
VAR
Receive: SERIAL_RX;
Port: SERIAL_PORT := COM1;
Buffer_Pointer: ARRAY [0..1023] OF BYTE; //Max size.
Status: SERIAL_STATUS;
END_VAR
//INPUTS:
Receive.REQUEST := TRUE;
Receive.PORT := Port;
Receive.RX_BUFFER_POINTER := ADR(Buffer_Pointer);
Receive.RX_BUFFER_LENGTH := 1024; //Max size.
Receive.RX_TIMEOUT := 10000;
//FUNCTION:
Receive();
//OUTPUTS:
215
5. CONFIGURATION
Receive.DONE;
Receive.EXEC;
Receive.ERROR;
Status := Receive.STATUS; //If it is necessary to treat the error.
Receive.RX_RECEIVED;
Receive.RX_REMAINING;
5.15.1.7. SERIAL_RX_EXTENDED
This function block is used to receive a serial port buffer using the RX queue extended mode as shown in the Serial
Interface section.
216
5. CONFIGURATION
Utilization example in ST language, after the library is inserted in the project and the serial port configured:
PROGRAM UserPrg
VAR
Receive_Ex: SERIAL_RX_EXTENDED;
Port: SERIAL_PORT := COM1;
Buffer_Pointer: ARRAY [0..1023] OF SERIAL_RX_CHAR_EXTENDED;
Status: SERIAL_STATUS;
217
5. CONFIGURATION
END_VAR
//INPUTS:
Receive_Ex.REQUEST := TRUE;
Receive_Ex.PORT := Port;
Receive_Ex.RX_BUFFER_POINTER := ADR(Buffer_Pointer);
Receive_Ex.RX_BUFFER_LENGTH := 1024; //Max size.
Receive_Ex.RX_TIMEOUT := 10000;
//FUNCTION:
Receive_Ex();
//OUTPUTS:
Receive_Ex.DONE;
Receive_Ex.EXEC;
Receive_Ex.ERROR;
Status := Receive_Ex.STATUS; //If it is necessary to treat the error.
Receive_Ex.RX_RECEIVED;
Receive_Ex.RX_REMAINING;
Receive_Ex.RX_SILENCE;
5.15.1.8. SERIAL_SET_CTRL
This block is used to write on the control signals (RTS and DTR), when they are available in the serial port. It can also set
a busy condition for the transmission, through BREAK parameter and it can only be used if the modem signal is configured
for RS232_MANUAL.
218
5. CONFIGURATION
Utilization example in ST language, after the library is inserted in the project and the serial port configured:
PROGRAM UserPrg
VAR
Set_Control: SERIAL_SET_CTRL;
Port: SERIAL_PORT := COM1;
Status: SERIAL_STATUS;
END_VAR
//INPUTS:
Set_Control.REQUEST := TRUE;
219
5. CONFIGURATION
Set_Control.PORT := Port;
Set_Control.RTS_VALUE := FALSE;
Set_Control.RTS_EN := FALSE;
Set_Control.DTR_VALUE := FALSE;
Set_Control.DTR_EN := FALSE;
Set_Control.BREAK := FALSE;
//FUNCTION:
Set_Control();
//OUTPUTS:
Set_Control.DONE;
Set_Control.EXEC;
Set_Control.ERROR;
Status := Set_Control.STATUS; //If it is necessary to treat the error.
5.15.1.9. SERIAL_TX
This function block is used to transmit a data buffer through serial port and it is only finalized after all bytes were transmitted
or after time-out (generating errors).
220
5. CONFIGURATION
Utilization example in ST language, after the library is inserted in the project and the serial port configured:
PROGRAM UserPrg
VAR
Transmit: SERIAL_TX;
Port: SERIAL_PORT := COM1;
Buffer_Pointer: ARRAY [0..9] OF BYTE := [0,1,2,3,4,5,6,7,8,9];
Status: SERIAL_STATUS;
END_VAR
//INPUTS:
221
5. CONFIGURATION
Transmit.REQUEST := TRUE;
Transmit.PORT := Port;
Transmit.TX_BUFFER_POINTER := ADR(Buffer_Pointer);
Transmit.TX_BUFFER_LENGTH := 10;
Transmit.TX_TIMEOUT := 10000;
Transmit.DELAY_BEFORE_TX := 1000;
Transmit.CLEAR_RX_BEFORE_TX := TRUE;
//FUNCTION:
Transmit();
//OUTPUTS:
Transmit.DONE;
Transmit.EXEC;
Transmit.ERROR;
Status := Transmit.STATUS; //If it is necessary to treat the error.
Transmit.TX_TRANSMITTED;
5.15.2.1. RefreshIntegratedIoInputs
This function allows to update all the inputs integrated to the controller’s CPU instantly. The function has no input param-
eters and only finishes the execution after updating all the integrated inputs.
5.15.2.2. RefreshIntegratedIoOutputs
This function allows to update all the outputs integrated to the controller’s CPU instantly. The function has no input
parameters and only finished the execution after updating all the integrated outputs.
222
5. CONFIGURATION
The three blocks already available in the MasterTool IEC XE software NextoStandard library are described below (for the
library insertion proceeding, see MasterTool IEC XE Programming Manual – MP399609, section Library).
5.15.3.1. TOF_RET
The function block TOF_RET implements a time delay to disable an output. When the input IN has its state changed from
(TRUE) to (FALSE), or a falling edge, the specified time PT will be counted and the Q output will be driven to (FALSE) at the
end of it. When the input IN is in logic level 1 (TRUE), the output Q remain in the same state (TRUE), even if this happened
in the middle of the counting process. The PT time can be changed during the counting as the block assumes the new value if
the counting hasn’t finished. Figure 159 depicts the TOF_RET block and Figure 160 shows its graphic behavior.
223
5. CONFIGURATION
5.15.3.2. TON_RET
The TON_RET implements a time delay to enable an output. When the input IN has its state changed from (FALSE) to
(TRUE), or a rising edge, the specified time PT will be counted and the Q output will be driven to (TRUE) at the end of it.
When the input IN is in logic level 0 (FALSE), the output Q remain in the same state (FALSE), even if it happens in the middle
of the counting process. The PT time can be changed during the counting as the block assumes the new value if the counting
hasn’t finished. Figure 161 depicts the TON_RET block and Figure 162 shows its graphic behavior.
224
5. CONFIGURATION
5.15.3.3. TP_RET
The TP_RET function block works as a trigger. The timer which starts when the IN input has its state changed from
(FALSE) to (TRUE), that is, a rising edge, it is increased until the PT time limit is reached. During the counting, the Q output
225
5. CONFIGURATION
is (TRUE), otherwise it is (FALSE). The PT time can be changed during the counting as the block assumes the new value if
the counting has not finished. Figure 163 depicts the TP_RET and Figure 164 shows its graphic behavior.
PROGRAM UserPrg
VAR RETAIN
bStart : BOOL;
TP_RET : TP_RET;
END_VAR
// Configure TP_RET
TP_RET( IN := bStart,
PT := T#20S);
226
5. CONFIGURATION
bStart := FALSE;
5.16. Device
5.16.1. User Management and Access Rights
It provides functions to define users accounts and to configure the access rights to the project and to the CPU. Using the
software MasterTool IEC XE, it’s possible to create and manage users and groups, setting, different access right levels to the
project.
Simultaneously, the Nexto CPUs have an user permissions management system that blocks or allows certain actions for
each user group in the CPU. For more information, consult the MasterTool IEC XE User Manual MT8500 – MU299609, in
the User Management and Access Rights section.
Parameter Description
Application for I/O handling Application that is responsible for the I/O handling.
TRUE: The values of the input and output channels are also
Refresh I/Os in stop refreshed when the PLC is in STOP mode. If the watchdog de-
tects a malfunction, the outputs are set to the predefined default
values.
FALSE: The values of the input and output channels in STOP
mode are not refreshed.
227
5. CONFIGURATION
Parameter Description
Handling of the output channels when the controller enters
STOP mode:
Behavior of the outputs at
Retain values: The current values are retained.
stop
All outputs to default value: The default values resulting from
the I/O mapping are assigned.
Execute program: The handling of the output values is con-
trolled by a program contained in the project which is executed
in STOP mode. Enter the name of the program in the field on
the right.
Globally defines whether or not the I/O variables are updated in
the bus cycle task.
This setting is effective for the I/O variables of the slaves and
Always update variables modules only if "deactivated" is defined in their update settings.
Deactivated (update only if used in a task): The I/O variables
are updated only if they are used in a task.
Enabled 1 (use bus cycle task if not used in any task): The
I/O variables in the bus cycle task are updated if they are not
used in any other task.
Enabled 2 (always in bus cycle task): All variables in each
cycle of the bus cycle task are updated, regardless of whether
they are used and whether they are mapped to an input or output
channel.
Task that controls the bus cycle. By default the task defined by
Bus cycle task the device description is entered.
By default, the bus cycle setting of the superordinate bus de-
vice applies (use cycle settings of the superordinate bus). This
means that the device tree is searched upwards for the next valid
definition of the bus cycle task.
Force variables for the I/O TRUE: When compiling the application, two global variables
mapping are created for each I/O channel which is mapped to a variable
in the I/O Mapping dialog.
TRUE: The CAA Device Diagnosis library is integrated in the
Activate diagnostics for de- project. An implicit function block is generated for each device.
vices If there is already a function block for the device, then either an
extended function block is generated (example: EtherCAT) or
another function block instance is added. This then contains a
general implementation of the device diagnostics.
Display I/O warnings as er- Warnings concerning the I/O configuration are displayed as er-
rors rors.
TRUE: Input and output variables(VAR_INPUT and
Enable symbolic access for VAR_OUTPUT) are automatically created for the I/O channels
I/Os of the device. For this purpose, an extended function block is
created for each slave. The basis is the existing function block
of the slave. This kind of automatically generated function
block can be accessed directly in the application code.
228
5. CONFIGURATION
5.17.2. Configuration
The FTP configuration is done through a dedicated section located in the Management tab of the controller’s System Web
Page, as shown below:
FTP is a separate feature from MasterTool IEC XE, meaning it does not require any interaction with the programming tool.
The settings applied on the FTP Server section take effect when confirmed through the Apply button and are automatically
saved in the controller. As long as the functionality is enabled, it will resume operation even after the device is restarted. The
following sections describe the possible configurations for FTP, divided according to the tables on this web page.
The first field in the table is Enable Server, which allows you to activate or deactivate the functionality. When the FTP
server is enabled, the settings from the web page are applied to the configuration files. That means the server is available
according to the configuration made. If FTP is disabled, the configuration is still stored, but the service cannot be used.
The Enable Security field serves to enable or disable encrypted communication. When security is enabled, the CP generates
a self-signed certificate to ensure secure communication using the SSL protocol. When the client establishes an authenticated
connection, the certificate and its corresponding information will be displayed, allowing the establishment of FTPS (FTP over
SSL) communication.
229
5. CONFIGURATION
ATTENTION
The FTPS certificate is valid for one year from the date of creation. To generate a new
certificate, simply reapply the configuration.
The Read-only Access parameter serves to enable or disable read-only access on the server. When enabled, it is not
possible to remove or add files on the server through the client. Only file transfers from the server to the client are allowed.
When disabled, all operations on the server are permitted.
The Idle Timeout (Seconds) parameter sets a maximum value for server idle time. If a client is connected without perform-
ing any operations within the defined value, the server will automatically terminate the connection.
The Maximum Connected Clients parameter defines the maximum number of clients connected to the server simultane-
ously.
ATTENTION
When adding a file, a second connection will be established with the server, counting as a
connected client. If the limit is set to only one client, it will not be possible to perform this
operation.
5.17.2.2.1. Username
The first field in the table is Username, which will be responsible for managing the authentication login when connecting
to the FTP server. After applying a new user configuration, the previous user will be removed if it is different. In other words,
there is only a single FTP user, but it is possible to have multiple connections with the same login.
5.17.2.2.2. Password
The Password field will be responsible for managing the authentication key when connecting to the FTP server. There is
no password recovery, only password resets or adding a new user configuration.
230
5. CONFIGURATION
5.17.2.3. Status
The Current Status field is responsible for displaying the current state of the FTP server. The possible states are: "Running",
"Not Running", and "Restarting Service". Each applied configuration will restart the service.
The Connected Clients field is responsible for displaying the number of clients connected simultaneously to the FTP server.
5.18. Firewall
5.18.1. Introduction
The Firewall is designed to increase the security of the device while it is in use. The main function of the Firewall is to
filter data packets coming into and leaving the device. The implemented filter uses information from each data packet to decide
whether that packet is allowed. The main parameters used are the input/output interfaces, the port, the transport layer protocol,
and the source and destination addresses.
5.18.2. Configuration
Firewall configuration is done through a dedicated section located in the Management tab of the controller’s System Web
Page, as shown below:
The Firewall is a separate feature from the MasterTool IEC XE, that is it doesn’t require any interaction with the program-
ming tool. Settings applied on the Firewall section take effect when confirmed with the Apply button, and are automatically
saved in the controller. If the feature is enabled, it will operate again even after rebooting the device.
The following sections describe the possible settings for the Firewall, divided according to the tables of the Firewall section.
231
5. CONFIGURATION
This table expands dynamically by selecting the options to enable UDP and TCP packet filters, revealing all the items that
can be configured. The first item in this table, Enable Firewall, is used to enable and disable this functionality. When the
Firewall is enabled, the web page settings, when submitted to the device, will be applied to the configuration files, and then
the Firewall will filter what has been configured. If the Firewall is disabled, the configuration that was made is stored, but the
rules are not applied in the controller.
The field Disable ICMP (Ping) enables or disables protection against the ICMP protocol. When protection is enabled,
the controller will not respond to Ping requests, since it will drop packets that use the ICMP protocol. When disabled, the
operation of the device for Ping responses maintains its normal behavior.
When enabled, the fields that enable UDP and TCP packet filtering, filter these protocols according to the limits configured
in their respective fields. The packet filtering rule works like this: for a packet to be accepted, there must be "credits" available,
and one credit is used to accept a data packet.
The setting of the field Burst of XXX Packets sets the initial value of packages (credits), which will be accepted. In this way,
it is possible to set an overflow limit for these packets, where if there is a large flow of packets, only the configured amount
will be accepted. The XXX Packages per Second field sets how many credits that rule will earn per second. For example, if the
value is 5, each second, the rule will receive five new credits, so it will be able to accept five more packages. The limitation
for this increment in the number of credits is the configuration of Burst of XXX Packets itself, and the limit set here is not
exceeded, even with the increment of packets every second. These settings are applied as a stock, where upon receiving a data
packet, it is first checked if there is any credit available in the stock, and then a decision is made whether or not to accept the
package. If the packet is accepted in this quantity filter, it is forwarded to the filter of the other firewall rules.
The setting Filter XXX per IP causes the rule to differentiate the source addresses of each packet and apply the packet per
second and packet overflow filters individually to each IP address. So, going back to the previous example, it can be considered
that each source address has its stock of credits, and one address cannot use the credits that are in the stock reserved for others.
ATTENTION
Negative values are not allowed for the XXX Packages per Second and Burst of XXX Packets
fields. If negative values are set, when applying the settings an error message will appear on
the screen indicating the field that had a conflict. If the filter is enabled, but the values in
these fields are left at 0, the filter is not applied.
The settings in this table are applied with the Apply button that appears in figure 170.
232
5. CONFIGURATION
The fields for selecting both incoming and outgoing policies have options to accept and drop. if the Firewall is active,
when data packets arrive, all the rules that have been configured are checked, and then the policy configured for these packets
is applied, whether Accept or Drop. So if an accept policy is set, Accept, all packets that do not match any configured rule will
be accepted by the firewall, and if a reject policy is set, Drop, they would all be dropped.
This table changes its format according to the selected Source Type, which can be IP or MAC. When the type is IP, the table
has the items shown in figure above, but when the type is selected as MAC, the source and destination mask fields disappear, as
well as the Destination Address field. The item Source Address now accepts a MAC address as input. Also, an address-based
MAC rule can only be configured as an input rule. In other words, the Direction field will be forced with the value INPUT.
With the Source Address and Destination Address fields, you can enter the addresses that will be configured for that specific
rule, and using the Source Mask and Destination Mask fields, you can configure a network range for this rule. If you only
configure the address, only the address will be assigned to the rule but with different netmask configurations, you can get IP
groups of various sizes to be applied to the rule.
Interface configuration makes it possible to individually select each physical or virtual interface available to the controller.
Based on which interface you select for a given rule, only data packets entering or leaving the interface will be filtered by the
Firewall. If you use the option Any, this rule will have no interface filter. So the filtering rule will be valid for all available
interfaces.
The Action field has three configuration options: ACCEPT, DROP, and REJECT. The action sets up what should be done
with the package whose characteristics match the rule applied. If the chosen action is ACCEPT, the data packet having
characteristics according to the rule will be accepted. If it is DROP, the packet will be dropped, and no reply will be sent to the
sender of the package. Finally, if it is set to REJECT, the packet will be rejected, and a reply will be sent to the sender, stating
that the requested host is inaccessible.
The Service Port field, is used to indicate which ports will be configured in this rule. All service ports that have a certain
protocol or communication standard for the controller, such as the MODBUS protocol that has the standard port 502, are
available with the service name and port used next to it. Thus, if you configure the rule for the MODBUS protocol, port 502
will be applied if you configure the rule for the WebVisu service, port 8080 will be applied, and so on for the other protocols
listed in the checkbox.
This field also has two other settings, which are Any and Other. When you select the Any option, the rule is applied to all
service ports except services except port 80 then two rules are created using the following port ranges: 1:79 and 81:65535. If
233
5. CONFIGURATION
you select the Other option, a text box appears in which you can configure the port you want, except for port 80. To configure
a port, you can type its number in the text box, but if you want to add more than a single port, you must use the "&" separator,
and if you want to insert a range of ports, simply enter the start and end port using the separator ":".
Example of configuring ports 120, 144, and the range 1300 to 1450 in the same field: 120 & 144 & 1300:1450.
This field doesn’t accept values outside the range 1:65535, port 80, or port repeats.
The HTTP port 80 can only be set by selecting it from the list of known protocols and cannot be applied to the NET 1
interface. So if the HTTP protocol is chosen, the Interface field NET 1 and Any won’t be selectable.
In the Protocol field, you can select between UDP, TCP, and UDP|TCP protocols. If you select the UDP|TCP option, two
rules will be created on the firewall, one for each transport protocol.
In the Direction field, you can select between INPUT, OUTPUT, and INPUT|OUTPUT. These options cause the rule to be
applied to packets arriving at the device, option INPUT, or leaving it, option OUTPUT. If the joint option is configured, two
rules will be created, one with each direction option.
The figure below demonstrates how a rule is applied:
After filling in the fields as you wish to configure the firewall rule, you must click the Add to list button. By doing this,
all the settings will be analyzed to check if there are invalid values or if there is any duplicate rule. It’s impossible to add two
rules with the same address, mask, interface, port, and direction parameters. If a conflict is found, a message will be displayed
indicating the field that contains an invalid setting or the ID number of the rule in the table whose settings caused the conflict
with the newly configured one.
After all, parameters are checked, the rule will be added to the list below the configuration table. This list expands
automatically as rules are added or deleted. If you want to exclude a rule from the list, you can place the mouse over the one
you want to exclude. When you do this, a red X button will appear on the right, as shown in the previous figure. By clicking it,
the rule will be deleted from the table.
When adding new rules, or deleting an existing one, in the rules table, the Apply button below must be clicked for the
configuration to be applied to the device.
ATTENTION
During the application of firewall rules, there may be a momentary instability in Ethernet
communication.
234
5. CONFIGURATION
5.19. OpenVPN
5.19.1. Introduction
VPN (Virtual Private Network), used for surfing unsecured networks, transmitting data, or simply accessing the Internet
with a high level of security and privacy. The VPN virtual network can be understood as a tunnel in which information travels
securely, protected by security certificates and keys. OpenVPN is an open-source service, which means that it is free to use
and distribute, and its source code is open for modifications if needed.
The main purpose of a VPN is to communicate securely over an unsecured network. To make this possible, data encryp-
tion is used based on certificates and keys generated using TLS, Transport Layer Security, a protocol that performs 256-bit
encryption, one of the most secure.
To perform the configuration of the OpenVPN client or server, the OpenVPN page was created in the Management tab of
the CPU’s System Web Page. As shown in the figure below.
Because it is located within the Management tab, access to this page is password protected. The following sections describe
the settings and functionality of this page.
235
5. CONFIGURATION
This section shows how OpenVPN configuration is performed. The settings will be divided into three parts: settings
common to both operating modes, settings unique to a server, and settings unique to a client.
236
5. CONFIGURATION
Looking at the figures with the client configurations, figure 173, and the server configuration, figure 172, you can identify
that several parameters are the same for both configurations. These are:
5.19.3.1.1. Mode
With the configuration of the Mode, you can select between two options, client or server. When you select one of the two
modes, the settings table changes automatically to allow the configuration of the necessary fields for each mode of operation.
5.19.3.1.2. Protocol
This field configures which transport protocol will be used for VPN communication. It can be set between UDP and TCP.
ATTENTION
The configuration of the server and all its clients must be the same. With a divergent config-
uration, OpenVPN is not able to perform communication.
This field sets the level that the log file will receive. The setting ranges from 0 to 5, 0 being the most basic level and 5
being the most advanced.
Level 0 only displays logs about some critical failure in OpenVPN and levels 4 and above are used for debugging as there
is a lot of information being written to the log file. For normal operation, it is recommended to use value 3.
This field only accepts numbers as input. You are not allowed to use letters or special characters.
This field sets the time, in seconds when the Ping request will be forwarded. This request serves to verify the connection
between the server and the clients.
This parameter can be set on both the server and the OpenVPN clients, but if this parameter is set on the server, the clients
will assume the server’s value and not the value set on them. If the server doesn’t have such a setting, each client assumes its
setting normally. If you want to disable pinging between the server and the clients, set the value to 0.
This field only accepts numbers as input. You are not allowed to use letters or special characters.
This field sets the time, in seconds when the timeout of the Ping request will occur. After the expiration of this time,
without a response from the other VPN device, it will be considered disconnected.
This parameter can be set on both the server and the OpenVPN clients, but if this parameter is set on the server, the clients
will assume half of the server’s value and not the value set on them. Clients receive half the amount to ensure that they are
disconnected in case the server disconnects. If the Server does not have such a setting, each client assumes its setting normally.
If you wish to disable this feature, set the value to 0.
This field only accepts numbers as input. You are not allowed to use letters or special characters.
In the fields CA Certificate, Device Certificate, Device Key and TA Key, you must select which security file, certificate, or
key, will be used to establish the OpenVPN communication. The options in each field, combobox, are filtered according to the
type of key file or certificate, although there is no differentiation between keys and certificates.
To be possible to select a file, it must first have been imported.
All security files are required for correct communication to be established between clients and the VPN server, except for
TAP Key. This key is optional for communication, but if it is used on the server, it becomes mandatory for all clients on the
server.
See the TLS Key and Certificate Management section for further information about generating certificates and security
keys based on TLS.
237
5. CONFIGURATION
5.19.3.1.7. TA Key
In the field TA Key it is set which type of encryption will be applied to the TA Key. This field stays hidden until you select a
file for the TLS key because it is only used in conjunction with this key. The default value of this parameter is SHA1, but you
can select from the following values: SHA256, SHA512, and MD5, in addition to the default SHA1.
ATTENTION
This configuration needs to be the same between the clients and the server in the same
OpenVPN network. If the value of this field is different between the client and server, the
connection will not be established.
The exclusive server configurations, seen in figure 172, are described below.
The IP range that will be used to assign the server and client addresses for the VPN network is configured by the server by
setting the IP Address and Mask Address fields. All IPs that will be assigned to the clients and the server will be taken from
the specified range.
The server’s IP address is always the first available value in the configured range, and for IP assignments to clients, the
values still available in the range are used, so the first available value is assigned as clients make their connection. For example,
if a network is configured with the addresses 10.8.12.4 and mask 255.255.255.248, the server will assume IP 10.8.12.5 which
is the first available address in the configured range. However, if mask 255.255.255.255.0 is set, the server will assume IP
10.8.12.1, which is the first available address in the range.
The IP and Mask address fields only accept settings that have the syntax of an IP address and mask address, respectively.
If anything out of the standard is configured, an alert message will be displayed, informing you that an error has occurred.
In this field, you can enable or disable communication between clients in the VPN network. When the option is selected
as Disabled, only client-server communication can be performed directly. If the option selected is Enabled, it will allow
communication between the clients themselves in addition to the client-server communication.
In this field, you can set the maximum number of clients that can connect to the server simultaneously. This field accepts
only numeric characters, and the minimum value is 1.
When you select OpenPVN’s operating mode as a server, a table will be displayed, normally hidden, which allows the
configuration of private networks that can be below the server and each client.
238
5. CONFIGURATION
To configure a private network that is below the server, simply select the network type as Server and configure the network
addresses and mask. Configuring a private network for a client requires, in addition to setting the type as Client, to enter the
Common Name of the client that owns the network being configured.
The Common Name of a client is set when generating the Device Certificate. This parameter is entered when creating the
certificate and is unique for each client and server. The configuration of these private networks creates a routing table that will
be checked when receiving or sending packets over the VPN.
Figure above, shows a configuration of a subnet 80 on the OpenVPN server, then a routing rule will be configured that will
forward the data packets that will be received by the VPN to the device interface configured on this network. It also creates a
rule, internal to the server, that if a data packet has the subnet 70, this packet will be routed and forwarded through the VPN
tunnel. The same behavior occurs with the client2 client, but with the subnets switched, because below this client is the 70
subnet and it will forward packets with the 80 subnet to the VPN tunnel.
See the following figure for an example of architecture:
239
5. CONFIGURATION
In the example picture, the NX3008 on the left has a private network 80 configured on its NET 2, and connected to it is an
NX3003 on the same network. The NX3008 on the right has a private network 70 configured on its NET 2 and connected to it
is an HMI, on the same network. The example architecture realizes the communication between the NX3003 and HMI devices
over VPN by configuring their respective private networks.
After filling the fields, shown in the figure 174, with the desired configuration, you must click on the blue + button that
appears on the far right of the configuration fields, so that the rule is added to the table. If you want to delete a rule, drag your
mouse over the rule you want to remove, and a red X will appear on the right, as shown in the image 174. By clicking on this
X, the rule is removed from the table.
For the settings present in the table to be applied to the device you must click the Apply button and confirm the operation
in the confirmation window that will appear. Ao serem aplicadas as regras, será exibida uma mensagem indicando se houve
êxito ou falha na operação.
There is only one configuration unique to OpenVPN clients on the page, which you can see in the picture 173. This
configuration is the IP Remote.
5.19.3.3.1. Remote IP
The Remote IP field sets the address where the VPN server is expecting communication from the clients. If an OpenVPN
server is established on a computer, the remote IP configuration must be done according to the IP address of this computer.
This field also accepts host names as the remote address, so you can set an IP or a hostname in this parameter.
ATTENTION
Because of the need to allow for such different parameters, IPs, and host names, the only
check that exists in this field is whether or not data exists. Be careful when performing the
configuration.
To enable the functionality, the checkbox Enabled, shown in the figure above, must be checked. If you just want to apply
the settings you have made and not enable OpenVPN, uncheck this checkbox.
After you have made all the desired settings, the settings must be applied to the device, to do this use the Apply button.
This button is shown in the figure 173 in the lower right corner. When the settings are applied and the VPN is enabled, the web
page will perform an automatic scroll to the OpenVPN status table, displayed in the Status Table section.
240
5. CONFIGURATION
In this section of the System Web Page, you can manage the security files. You can import files, monitor the validity of
certificates, download files uploaded to the device, and delete files that have been uploaded.
By clicking the Choose files button, you can import certificates and keys, these files must have the respective extensions
.crt and .key. This button opens a file explorer window and allows the selection of one file, i.e. multiple files.
ATTENTION
There is a limit of 12 files that can be imported into the controller.
The control of the files is done in the table, which is shown in the picture 176. This table adds new items, or removes them,
as the import or delete operations occur. You can identify whether the file is a key or a certificate by the second item in the
list, the Type, which indicates what that file is. For the certificates, their commons names and their expiry dates, both start and
expiry, are also displayed.
You can recover a file that has been imported into the part and also delete it. When you drag the mouse over a file in
the table, two buttons appear, one for downloading and one for deleting. The download button is a black arrow pointing
downwards, and the delete button is a red X.
241
5. CONFIGURATION
When VPN is disabled, the table has few parameters. The field Current State indicates whether the VPN is enabled or not,
and the other fields show which certificates and keys are configured for VPN communication. If one of the security files has
not been selected, the character "-" will appear instead of its name, indicating that there is no file configured.
The common name fields for the CA and the device display the names given to the respective certificates, certificate
authority, and device.
Next to the file name of each certificate is displayed the remaining time, in days, until its expiration date.
242
5. CONFIGURATION
When the functionality is enabled and the settings are applied on the device, the table has its cells dynamically modified so
that the remaining information is displayed. Information about the OpenVPN connection status can be found in the first two
topics of the list.
The item Current State has the states of Not Running, Starting service..., and Running, which indicate respectively that the
VPN is disabled, is starting or is enabled.
The item Connection State has the states Not connected, Connecting..., and Connected.
The other information that can be obtained from this table is the total connection time, the device’s IP address, and the
amount of data sent and received, in bytes. The status of how many clients are currently connected is only displayed when
OpenVPN is operating as a server.
The download file list is only displayed when there is a file to download. If there is no file, the list item remains hidden.
Clicking on any of the links will download the requested file through the browser.
243
5. CONFIGURATION
This topology allows the connection between two VPN hosts. Both hosts can be chosen to be configured as the server, then
the other should be configured as the client, or both hosts can be configured as clients and have a third host that will be the
server for the VPN network.
Setting up this type of architecture doesn’t require any specific configuration. In other words, there is no restriction on the
settings available on the OpenVPN web page.
This topology allows the connection between two VPN hosts, but one of these hosts also acts as a gateway to the VPN
network. Through this gateway, routing is performed to set up communication between hosts A, B1, B2, and Gateway B. In
this scenario, either Host A or Gateway B can be the server. When one is the server on the network, the other will be the client.
The hosts, B1 and B2, that are on a private Lan B network below Gateway B, don’t need to support OpenVPN to be able
to communicate since all communication is handled by the VPN network gateway.
To enable communication between all devices on the network, you need to create routing rules for the VPN tunnel. Please
refer to the section Private Networks to see how to create private network rules.
This VPN connection architecture requires some specific configurations. The server must have its topology configuration
as a Subnet, this being the default configuration of the controller, to configure the private networks under Gateway B, as seen
in the image above.
You also need to enter the address of the private network, Lan B, that will be communicating through the VPN. This
configuration is done using the command push "route Lan_B_IP Lan_B’s_Mask" and is required regardless of whether the
private network is located below the client or the OpenVPN server, but if the private network is below the VPN client, you
must add, in addition to this command, the following configuration: route route Lan_B_IP Lan_B’s_Mask. These settings are
written to the VPN server’s configuration file.
244
5. CONFIGURATION
This topology allows the connection between two VPN hosts, both of which acts as a gateway to the VPN network. Through
these gateways, access is provided to establish communication between hosts A1, A2, B1, B2, Gateway A, and Gateway B. In
this scenario, any gateway can assume the role of a server, so the other will be the client.
None of the hosts that are in a private network below one of the two gateways need to support OpenVPN to be able to
communicate, since all communication is handled by the VPN network gateways.
To enable communication between all devices on the network, you need to create routing rules for the VPN tunnel. Please
refer to the section Private Networks to see how to create private network rules.
The configurations for this architecture need the same specific settings described in section Host-to-Site Configuration,
with the difference that now, there are two private networks, and both must follow the configuration that has been demonstrated.
Assuming that Gateway A is the server on this connection, you should add the following commands to the configuration file:
push “route Lan_A_IP Lan_A’s_Mask”, route Lan_B_IP Lan_B’s_Mask, and push “route Lan_B_IP Lan_B’s_Mask”. If the
server is Gateway B, in the configuration file it would be added: push “route Lan_B_IP Lan_B’s_Mask”, route Lan_A_IP
Lan_A’s_Mask, and push “route Lan_A_IP Lan_A’s_Mask”.
245
6. MAINTENANCE
6. Maintenance
6.1. Diagnostics
Nexto Xpress controllers permit many ways to visualize the diagnostics generated by the system, which are:
Diagnostics via LED
Diagnostics via System Web Page
Diagnostics via Variables
Diagnostics via Function Blocks
The first one is purely visual, generated through two LEDs placed on the front panel (PWR and DG). The next feature is
the graphic visualization in a System Web Page. The diagnostics are also provided as global symbolic variables to be used
on the user application, for instance, being presented in a supervisory system. The last ones present specific conditions of the
system functioning.
These diagnostics function is to point possible system installation or configuration problems, and communication network
problems or deficiency.
246
6. MAINTENANCE
The user can choose from three language options: Portuguese, English and Spanish. The desired language is selected
through the upper right menu. Additionally, the management tab has other features like Firmware Update and SNMP.
Firmware Update tab is restricted to the user, that is, only for internal use of Altus. In cases where the update is performed
remotely (via a radio or satellite connection for example), the minimum speed of the link must be 128Kbps.
247
6. MAINTENANCE
Notes:
Hardware Failure: In case the Hardware Failure diagnostic is true, the controller must be sent to Altus Technical Assis-
tance, as it has problems in the RTC or other hardware resources.
Software Exception: In case the software exception diagnostic is true, the user must verify his application to guarantee
it is not accessing the memory wrongly. If the problem remains, the Altus Technical Support sector must be consulted. The
software exception codes are described next in the controller’s detailed diagnostics table.
Retentivity Error: If Retentive error flag is true, Altus Technical Support must be consulted. Reset Cold and Reset Origin
commands triggered by MasterTool does not cause the indication of this diagnostic.
The tables below contains Nexto Xpress controllers’ detailed diagnostics. It is important to have in mind the observations
below before consulting them:
Visualization of the Diagnostics Structures: The Diagnostics Structures added to the Project can be seen at the item
Library manager of MasterTool IEC XE tree view. There, it is possible to see all datatypes defined in the structure
Counters: All controller diagnostics counters return to zero when their limit value is exceeded
248
6. MAINTENANCE
249
6. MAINTENANCE
250
6. MAINTENANCE
251
6. MAINTENANCE
252
6. MAINTENANCE
253
6. MAINTENANCE
254
6. MAINTENANCE
255
6. MAINTENANCE
256
6. MAINTENANCE
Notes:
Exception Code: The exception codes generated by the RTS (Runtime System) is presented below:
257
6. MAINTENANCE
Brownout Reset: The brownout reset diagnostic is only true when the power supply exceeds the minimum limit required in
its technical features, remaining in low voltage, without suffering any interruption. The controller identifies the voltage break
and indicates the power supply failure diagnostic. When the voltage is reestablished, the controller is restarted automatically
and indicates the brownout reset diagnostic.
Parity Error Counter: When the serial COM 1 is configured Without Parity, this error counter won’t be incremented
when it receives a message with a different parity. In this case, a frame error will be indicated.
User Partition: The user partition is a memory area reserved for the storage of data in the CPU. For example: files with
PDF extension, files with DOC extension and other data.
RTD Inputs: the table below describes the behavior of over and under range diagnostics according to the input type
selected:
258
6. MAINTENANCE
6.1.4.1. GetTaskInfo
Below, the parameters that must be sent to the function for it to return the application information are described.
The data returned by the function, through the pointer informed in the input parameters are described on table below.
259
6. MAINTENANCE
Possible ERRORCODE:
NoError: success execution;
TaskNotPresent: the desired task does not exist.
Example of utilization in ST language:
PROGRAM UserPrg
VAR
sAppName : STRING;
psAppName : POINTER TO STRING;
sTaskName : STRING;
psTaskName : POINTER TO STRING;
pstTaskInfo : POINTER TO stTaskInfo;
TaskInfo : stTaskInfo;
Info : ERRORCODE;
END_VAR
//INPUTS:
sAppName := 'Application'; //Variable receives the application name.
psAppName := ADR(sAppName); //Pointer with application name.
sTaskName := 'MainTask'; //Variable receives task name.
psTaskName := ADR(sTaskName); //Pointer with task name.
pstTaskInfo := ADR(TaskInfo); //Pointer that receives task info.
//FUNCTION:
//Function call.
Info := GetTaskInfo (psAppName, psTaskName, pstTaskInfo);
//Variable Info receives possible function errors.
260
7. APPENDIXES
7. Appendixes
7.1. TLS Key and Certificate Management
This section covers the generation of security files, certificates, and keys using TLS. The certificates commented on below
are signed by CA. This type of certificate considers an entity, called Certificate Authority (CA), to generate the certificates.
This entity can be an official authority service or a simple computer. It is only necessary to restrict access to the CA to avoid
any security breach since this entity can generate certificates for any device. The image below shows how each device interacts
with the files.
First of all, the generated files are private keys. Each device has its key file, created either by the CA entity or the device
itself. The most important file is the CA private key ca.key, which must not leave the entity. The CA entity generates its
certificate based on its private key ca.crt. This certificate is a public file used by the devices to validate the VPN connection.
Generating certificates from the device first requires a request file (.csr or .req depending on the tool) based on the device’s
private key. This document presents two possible tools for generating certificate files: Easy-RSA and OpenSSL.
Make sure you have the date and time set correctly in the CA entity so that the generation of the certificates is based on a
current setting.
261
7. APPENDIXES
2 - Copy the file vars.example and rename it to vars in the tools folder.
3- Open the file vars with a text editor and change the Certification Authority information.
262
7. APPENDIXES
5- Then type ./easyrsa build-ca nopass to generate the CA certificate. Remove the nopass argument if you want to set a
password for the file. Enter the common name of the CA certificate when prompted (press enter to use the default Easy-RSA
CA as the common name).
6 - Generate the device key and request files using the command ./easyrsa gen-req DeviceName nopass. Change the
DeviceName with the desired common name. Again, remove the nopass argument to use a password for the certificate file.
When entering the Common Name as an argument, simply press Enter when prompted (red square).
263
7. APPENDIXES
7- Finally, type ./easyrsa sign-req server DeviceName to generate the device certificate. The DeviceName is the desired
common name, and the server is the type (use client if you are generating for a VPN client).
264
7. APPENDIXES
3- Then generate the CA certificate based on the private key, using the openssl req -new -x509 -days 365 -key ca.key -out
ca.crt command.
The parameter -days represents the expiration time for the certificate. Set it as desired. In this example, the certificate is
valid for one year. Fill in the values requested at the prompt as needed (press enter to use the default, which is enclosed in
square brackets []). It is mandatory to define a Common Name for the certificate work.
265
7. APPENDIXES
4- Now generate the device’s private key, similar to step 2, using the command openssl genrsa -out DeviceName.key 2048.
5- After that, generate the certificate request file based on the private key using the command openssl req -new -key
DeviceName.key -out DeviceName.csr.
Enter the desired information, and remember to use a common name other than CA.
6- Finally, generate the device certificate using the CA private key, the CA certificate, and the device certificate request file
using the openssl x509 -req -days 365 -in DeviceName.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out command.
Set the expiration date as desired with the parameter -days and the serial number of the certificate with the argument
-set_serial.
266
7. APPENDIXES
To execute the command, we used the executable installed with the OpenVPN package. The directory used in the image
above is an example and is optional. You can use only the desired file name too.
The command can be used to generate the key from Linux, but there is a minor change in the command compared to
Windows. To generate the key on Linux, use the following command: openvpn –genkey –secret ta.key. To run it, type the
command in the terminal, as follows the example:
This parameter is not mandatory for VPN communication, but if the server uses it, all its clients must also use it, and the
key for the server and the clients must be the same.
267