WEG plc500 Modbus Rtu Slave Applications Guides 10010165520 en
WEG plc500 Modbus Rtu Slave Applications Guides 10010165520 en
WEG plc500 Modbus Rtu Slave Applications Guides 10010165520 en
Application Note
Modbus/RTU Slave - Application Note
Series: PLC500
Language: English
Document: 10010165520 / 00
Contents
1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1 MODBUS/RTU NETWORK COMPONENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 RS485 INTERFACE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 NETWORK ARCHITECTURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 MODBUS/RTU SETTINGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.1 NETWORK SETTINGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2 I/O SETTINGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3 TERMINATION RESISTORS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 MONITORING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.1 COMMUNICATION ERRORS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.2 RS485 SERIAL INDICATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
INTRODUCTION
1 INTRODUCTION
This application manual describes how to operate the PLC500 in a Modbus/RTU network. Here, we will show
the settings for network slave. For the PLC500 product settings, follow the steps described in this document
to configure Modbus/RTU network properly.
ATTENTION!
! This application manual is intended for professionals trained in industrial networks. The devices
must be installed and configured according to manufacturer’s manual.
For the passive components of the network - cables, connectors, termination resistors, power supply - it is
recommended to use only components certified for industrial applications. See the product documentation for
information on the proper installation of the RS485 network.
For a more detailed description of the Modbus/RTU network operation and its settings, visit Codesys webpage
at: https://help.codesys.com/.
As shown in Figure 1.1, the RS485 connector is used for Modbus/RTU communication. Table 1.1 contains a
description of each pin.
Figure 1.2 shows the devices connected to the computer and among themselves through the RS485 interface.
In this example, the PLC300 is the Modbus/RTU network master, and the PLC500 is the slave.
PLC500 | 5
INTRODUCTION
PLC300:
PLC500: Modbus/RTU
Modbus/RTU
Slave
Master Termination
Termination
Figure 1.2: Network components.
✓
NOTE!
This application manual is intended for the PLC500 and the Codesys programming tool, we
recommend using the Codesys V3.5 SP18 or higher. If you need more information about the
Modbus/RTU communication protocol, see its manuals.
PLC500 | 6
SLAVE MODBUS/RTU SETTINGS
For a Modbus/RTU network settings and definitions, first create the project and include the PLC500 programmable
controller. In the Codesys software, create a new project, and choose the directory and name for the application.
Then, select the PLC500-WEG device and the desired programming language, as shown in Figure 2.1.
✓
NOTE!
In case the device PLC500 is not available in the Codesys options yet, you must download and
install the configuration file. See the Product Manual for the necessary steps and settings.
With the PLC500 device selected, you will have a project with the available network interfaces already preset,
as shown in Figure 2.2.
In the RS485 interface available in the project, you must add the Modbus Serial Device, as shown in Fig. 2.3.
PLC500 | 7
SLAVE MODBUS/RTU SETTINGS
By this point, the project should contain the Modbus_Serial_Device device under the RS485 interface.
PLC500 | 8
MODBUS/RTU SETTINGS
3 MODBUS/RTU SETTINGS
The network must be configured on the master to serve the addresses defined on the network slaves. The
parameters and addresses that will be transmitted from the network master must be set. Each slave device
must be configured with a unique address and at the same baud rate; otherwise, the network will experience
problems. In figure 3.1, the master device settings are defined.
ATTENTION!
! Use only ComPort 1 for the PLC500; if you use any other, a communication error will occur.
Before declaring the network variables, select the Offset value of the addresses. The addresses can be defined
independently for each function, as you can see in Start Addresses inside the red rectangle in Figure 3.2.
In this step, we declare the memory addresses reserved for the transmission variables, reading a value in the
network slave register and writing in another. Figure 3.3 below shows the Modbus functions for reading and
writing these data to the slave device.
PLC500 | 9
MODBUS/RTU SETTINGS
Channel 0 Channel 0
Write Single Register (Code 06) 100 ms Write Single Register (Code 06)
Offset - 0x4E20 (20000) Offset - 0x4E20 (20000)
Channel 1 Channel 1
Read Holding Registers (Code 03) 100 ms Read Holding Registers (Code 03)
Offset - 0x4E21 (20001) Offset - 0x4E21 (20001)
Figure 3.3: Settings for the transmission addresses.
The number of registers and coils declared in Figure 3.3 will be shown on the page indicated in Figure 3.4. Take
into account the difference between the Registers and Coils—the coils are in separate addresses and must be
enabled with Discrete Bit Areas.
The variables declared in the network can be monitored through two methods: first, to add the variables to the
Codesys program and monitor their values online; second, to enable Always Update Variables at the bottom
of the previous page, as indicated by the red arrow in Figure 3.5.
PLC500 | 10
MODBUS/RTU SETTINGS
Network Modbus/RTU must have resistors installed at its terminations, as they are essential for the correct
operation. The configuration of this item is done only through Codesys. For the PLC500, go to Setup and then
Setup Parameters, where the Termination Resistors fields are, as shown in Fig. 3.6.
PLC500 | 11
MONITORING
4 MONITORING
The status of the networks can be monitored in Devices, which indicates the state of each communication step
and informs the Status. When encountering connection problems, as shown in Figure 4.1, check that the cables
are properly connected and the settings again.
Figure 4.1: Indication of error in the communication with the slave device.
Connected to the PLC500, access Status tab within the created items indicated in Figure , Codesys will inform
the problem that is hindering the communication.
Figure 4.2: Indication of error in the communication with the slave device.
When the settings are correct and the devices identify each other, we should see all items in green, as shown
in Figure 4.3.
Figure 4.3: Indication of error in the communication with the slave device.
PLC500 | 12
MONITORING
The PLC500 programmable logic controller has LEDs on the front of the product that are used to indicate the
interfaces. The LED color indication shown in Figure 4.4 is described in Table 4.1.
PLC500 | 13
WEG Drives & Controls - Automation LTDA.
Jaraguá do Sul - SC - Brazil
Phone 55 (47) 3276-4000 - Fax 55 (47) 3276-4020
São Paulo - SP - Brazil
Phone 55 (11) 5053-2300 - Fax 55 (11) 5052-4212
[email protected]
www.weg.net