63
Twido Modbus with Magelis, Altivar, Lexium, TeSysU System User Guide [source code] 33004104.00 FEB 2007

Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Embed Size (px)

Citation preview

Page 1: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Twido Modbus with Magelis, Altivar, Lexium, TeSysU

System User Guide [source code]

3300

4104

.00

FEB 2007

Page 2: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

1

Contents

Application Source Code .......................................................................................................................4 Typical Applications ................................................................................................................................5 System.........................................................................................................................................................6

Architecture .........................................................................................................................................6 Installation............................................................................................................................................9

Hardware ..............................................................................................................................................10 Software ...............................................................................................................................................12 Communication ....................................................................................................................................13

Implementation .................................................................................................................................15 Communication ....................................................................................................................................17 PowerSuite Software ............................................................................................................................21 HMI .......................................................................................................................................................23 PLC.......................................................................................................................................................27 Devices.................................................................................................................................................43 Option 1 ................................................................................................................................................51 Option 2 ................................................................................................................................................55 Performance .........................................................................................................................................55

Appendix...................................................................................................................................................56 Detailed Component List................................................................................................................56

Option 1 ................................................................................................................................................56 Option 2 ................................................................................................................................................56

Component Protection Classes....................................................................................................57 Component Features.......................................................................................................................58

Contact......................................................................................................................................................62

Introduction This document is intended to provide a quick introduction to the described System.

It is not intended to replace any specific product documentation. On the contrary, it offers additional information to the product documentation, for installing, configuring and starting up the system. A detailed functional description or the specification for a specific user application is not part of this document. Nevertheless, the document outlines some typical applications where the system might be implemented.

Page 3: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

2

Abbreviations

Word / Expression Signification AC Alternating Current Advantys SE product name for a family of I/O modules Altivar (ATV) SE product name for a family of VSDs CANopen Name for a communications machine bus system CB Circuit Breaker CoDeSys Hardware-independent IEC 61131-3 programming software ConneXium SE product name for a Family of Transparent Factory devices DC Direct Current EDS Electronic Data Sheet E-OFF, E-STOP Emergency Off switch Harmony SE product name for a family of switches and indicators HMI Human Machine Interface I/O Input/Output IclA (ICLA) SE product name for a compact drive Lexium/Lexium05/LXM SE product name for a family of servo-drives Magelis SE product name for a family of HMI-Devices MB - SL SE name for a serial Modbus communications protocol Micro SE product name for a middle range family of PLCs NIM SE product name for a Network Interface Module Osiswitch SE product name for a family of position switches PC Personal Computer PDO Process Data Object (CANopen) Phaseo SE product name for a family of power supplies PLC Programmable Logic Computer Powersuite An SE software product for configuring drives Premium SE product name for a middle range family of PLCs Preventa SE product name for a family of safety devices PS1131 (CoDeSys) SE Product name for PLC programming software with CoDeSys PS Power Supply RPDO Receive Process Data Object (CANopen) SE Schneider Electric SDO Service Data Object Sycon SE product name of a Field bus programming software

Page 4: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

3

Word / Expression Signification

Telefast SE product name for a series of distributed I/O devices TeSys U SE product name for a decentralized I/O System TPDO Transmit Process Data Object (CANopen) Twido SE product name of a middle range family of PLCs TwidoSoft SE product name for a PLC programming software TwidoSuite SE product name for a PLC programming software Unity (Pro) SE product name for a PLC programming software Vijeo Designer An SE software product for programming Magelis HMI devices VSD Variable Speed Drive WxHxD Dimensions : Width, Height and Depth XBT-L1000 An SE software product for programming Magelis HMI devices Zelio SE product name for a low range PLC family ZelioSoft SE product name for a PLC programming software

Page 5: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

4

Application Source Code

Introduction Examples of the source code used to attain the system function as described in this

document can be downloaded from our website under this link. The example source code is in the form of configuration, application and import files. Use the appropriate software tool to either open or import the files.

Extension File Type Software Tool Required AIW Configuration file Advantys CNF Configuration File Sycon CO CANopen definitions file Sycon CSV Comma Separated Values, Spreadsheet Twidosoft CTX Unity DCF Device Configuration File Advantys DIB Device Independent Bitmap Sycon DOC Document file Microsoft Word DOP Project File Magelis XBTL EDS Electronic Data Sheet – Device Definition Industrial standard FEF Export file PL7 GSD EDS file (Geraete Stamm Datei) Profibus ISL Island file, project file Advantys PB Profibus definitions file Sycon PDF Portable Document Format - document Adobe Acrobat PRO Project file PS1131 - CoDeSys PS2 Export file Powersuite RTF Rich Text File - document Microsoft Word SPA Schneider Product Archive TwidoSuite STU Project file Unity Pro STX Project file PL7 TLX Project file Twinline control tool TWD Project file TwidoSoft VDZ Project file Vijeo Designer XEF Export file Unity Pro XPR Project file TwidoSuite ZM2 Project file Zeliosoft

Page 6: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

5

Typical Applications

Introduction Modicon developed the Modbus protocol in 1979 as a master/slave (client/server)

system. Due to its open bus structure, devices from different manufacturers can communicate directly with one another and exchange data. This has led it to become a global standard for industrial bus systems and (according to estimates) being used in conjunction with more than 10 million nodes. In 1980, the development of Ethernet using coaxial cables led to the establishment of yet another bus standard which was, at first, conceived for office use only. Modbus TCP was created by combining these two systems. This document provides a description of the Modbus RTU (Remote Terminal Unit) with 2-wire cabling; a bus system that is both inexpensive and easy to configure. For this reason, it is used in small and mid-scale systems, where high speeds and real-time functions are not the main concern. ( www.modbus.org ) Below is a list of the typical applications and the market segments where this system or subsystem can be applied: Industry Small machine or plant components that must be controlled and monitored. Decentralized automation systems Buildings/Services Conveyor belt with turntable Irrigation systems for greenhouses Infrastructure Water supplies Air-conditioning/ventilation for tunnel systems Food & Beverage/Pharmaceuticals Control of pumps and valves Modular bakery machines

Application Description Image Decentralized automation systems

Plant components such as cooling systems, washing filters, etc., are controlled by a PLC using a bus system and are checked for errors. This data is also read and archived by the production control technology.

Water supplies

This type of application frequently features several pump stations distributed around a site. A bus system is used so that the PLC can monitor these stations.

Air conditioning/ ventilation

This involves the ventilation of systems and working areas. Sensors, valves, fans and filters are connected to the PLC, which controls the process, via a bus system.

Page 7: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

6

System

Introduction The system chapter describes the architecture, the dimensions, the quantities and different

types of components used within this system.

Architecture

General The Modbus RTU is a serial communication bus that is based on the master/slave principle,

with one master and up to 31 slaves. Each slave can be assigned an address between 1 and 247. In terms of the bus design, both RS232 and RS485 versions are available. The RS485 version can be used to cover a distance of up to 1.2 km. To illustrate a few typical applications where Modbus RTU is used, we shall be considering a Compact Twido PLC, a Magelis XBT-R HMI operator terminal, an Altivar 31 variable speed drive and a TeSysU motor starter. An additional Lexium 05 servo is implemented in the case of Option 1, and an additional modular Twido PLC in that case of Option 2. The HMI acts as the master. Because of its two interfaces, the PLC therefore acts as both a slave on the HMI line and as a master for a second bus line that connects it to other nodes. The communication distributors take the form of Modbus hubs. This allows areas of the plant to be separated on the basis of functions and increases the level of fault tolerance. In the examples that follow, the default values (9,600 bauds; 8, E, 1) are used as communication parameters.

Page 8: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

7

Layout

Components Hardware:

Magelis XBT-R411 HMI panel (operator terminal acts as master) Twido PLC (compact design, acts as both master and slave) with TWD-NAC485T

(RS485 interface for Modbus) Twido (modular design, acts as slave) with TWD-NOZ485T (RS485 interface module for

Modbus) Altivar ATV31 variable speed drive with integrated Modbus interface Lexium 05 servo drive with integrated Modbus interface TeSys U LUCM1XBL motor circuit breaker with LULC031 Modbus interface TeSys LU9GC3 8-way Modbus hub Software: TwidoSoft (Version 3.2) (PLC programming) XBT-L1000 (Version 4.42) (HMI programming) PowerSuite (Version 2.3 build15) (VSD parameterization)

Quantities of Components

For a complete and detailed list of components, the quantities required and the order numbers, please refer to the components list at the rear of this document.

Degree of Protection

Not all the components in this configuration are designed to withstand the same environmental conditions. Some components may need additional protection, in the form of housings, depending on the environment in which you intend to use them. For environmental details of the individual components please refer to the list in the appendix of this document and the appropriate user manual.

Page 9: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

8

Mains voltage 240V AC Power requirement ~ 1 kW Drive power rating 0,18 kW Motor brake none Connection 3x 1,0mm² (L1, N, PE)

Technical Data

Safety Level Cat. 1, Cat 3 (optional)

Safety Notice The standard and level of safety you apply to your application is determined by your

system design and the overall extent to which your system may be a hazard to people and machinery. Whether or not the above safety category should be applied to your system should be ascertained with a proper risk analysis. This document is not comprehensive for any systems using the given architecture and does not absolve users of their duty to uphold the safety requirements with respect to the equipment used in their systems or of compliance with either national or international safety laws and regulations

Dimensions The dimensions of the individual devices used; PLC, Drive, Power supply, etc. require a

housing cabinet size of at least 800x600x300mm (WxHxD). The HMI display, illuminated indicators such as “SYSTEM ON”, “SYSTEM OFF” or “ACKNOWLEDGE EMERGENCY OFF” as well as the emergency off switch itself, can be built into the door of the housing.

Page 10: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

9

Installation

Introduction This chapter describes the steps necessary to set up the hardware and configure the

software required to fulfil the described function of the application.

Assembly Magelis XBT-R Phaseo Power Supply Vario Twido SPS modular und Compact TeSys LU9GC3 Modbus-Hub TeSys U Altivar ATV31 Lexium LXM05

This image shows a typical test setup, which can be used to test the communication between the devices at the configuration stage.

Page 11: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

10

Hardware

General Modbus hubs (distributors) are used in the following examples so that standard Modbus

cables with RJ45 connectors can be accommodated. This means that the differences in voltage between the various interfaces have no repercussions. According to the specifications, the bus must be terminated using terminating resistors. Short cables are a feature of the system layout so that testing can be carried out without resistors.

XBT-R 411

HMI

Modbus master to PLC

RS232/485 interface

Depending on how a project is configured

when it is created using the XBT-L1000

software, the terminal can be used as both a master and a slave.

TeSys LU9GC3

Modbus hub Passive

RS485 distributor for eight bus nodes

Only 1 master may be connected at any one

time

between the HMI and PLC

and between

the PLC and the devices

Twido Compact PLC

Modbus master to other slaves

COM1 – HMI slave +

programming interface

With optional COM2 RS485 interface Modbus master

Twido Modular PLC

Acts as a Modbus slave

(here, slave 5)

COM1 programming

With optional COM2

RS485 interface Modbus master

Page 12: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

11

TeSys U

motor starter

Power base LUB12

With LUCM1XBL display

LUL-C031(032) Modbus communication

module

The Modbus interface is

located on the underside of the Modbus module.

Altivar ATV31

variable speed drive

With Modbus interface

The Modbus interface is located behind the front

cover

Lexium 05

servo drive controller

With Modbus interface

The Modbus interface is located behind the front

cover

Phaseo power supply

unit

ABL7RE2403

Page 13: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

12

Software

General The TwidoSoft programming tool is used for programming the PLC.

The HMI application on the Magelis XBT-R411 operator terminal is configured using XBT-L1000 software. Although Altivar 31 variable speed drives and the Lexium 05 servo drive controller can be parameterized via the front panel, the PowerSuite software is a more user-friendly option. As well as providing a convenient means of setting drive parameters, this software also enables data to be saved and archived. These functions are extremely useful as they mean that parameters can be restored rapidly whenever service tasks need to be performed. The software can also help you to optimize the parameters online. One of the following versions of the Windows operating system must be installed on your PC: Windows 2000 or Windows XP

To use the software packages, your PC must have the appropriate Microsoft Windows operating system installed: TwidoSoft C:\Program Files\Schneider Electric\TwidoSoft XBT-L1000 C:\Program Files\Schneider Electric\XBT-L1000 PowerSuite C:\Program Files\Schneider Electric\PowerSuite

Manuals The manual below provides further details on Modbus and how to program communication.

Page 14: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

13

Communication

General A Modbus serial link is used for communication between individual devices.

Various pre-assembled cables should be used for programming or configuring the devices or the communication between them. Before you can start up the Modbus, both the node addresses (node numbers) and transmission parameters must be set. Depending on the device, this can be carried out using software or hardware. The following table provides an overview of the cable connections and Modbus function codes that should be used.

Usage Cable Type PLC programming

TSXPCX3030 (USB)

Modbus communication PLC <-> Modbus hub TWDX-CAR-J030 with RJ45

HMI programming

XBT-Z915

Modbus communication HMI <-> Modbus hub XBT-Z938 with RJ45

Altivar 31 parameterization

PowerSuite adapter W8 with RJ45 or USB-485040 adapter with Modbus cable with RJ45

Modbus communication Altivar 31 <-> Modbus hub

VW3A8306R10 Modbus cable with RJ45

Lexium 05 configuration

PowerSuite adapter W8 with RJ45 or USB-485040 adapter with RJ45 Modbus cable

Modbus communication Lexium 05 <-> Modbus hub

VW3A8306R10 Modbus cable with RJ45

TeSys U configuration

PowerSuite adapter W8 with RJ45 or USB-485040 adapter with Modbus cable with RJ45

Modbus communication TeSys U <-> Modbus hub

VW3A8306R10 Modbus cable with RJ45

8-way Modbus hub

Modbus distributor (passive)

Page 15: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

14

Modbus Specifying bus parameters

PLC programming The bus address (node number) for the Twido PLC is set using the port parameters in the TwidoSoft programming software and is written to the PLC (see relevant chapter).

HMI programming The bus address (node number) for the XBT-R411 operator terminal is set in the XBT-L1000 programming software and is written to the PLC (see relevant chapter).

Altivar 31 and Lexium 05 parameterization

The bus address (node number) for the variable speed drive and the servos is set via the front display. Alternatively, this can be carried out using the PowerSuite software (see relevant chapter).

TeSys U parameterization

The bus address (node number) for the TeSys U LUB12 motor starter is set using the DIP switches located on the underside of the LUL-C031 Modbus module (see relevant chapter).

Possible Modbus function codes

Read

Write

The following devices support the following codes:

Twido PLC

Code 1 Code 3 Code 5 Code 6 Code 15 Code 16

Magelis XBT-R411 HMI

Code 1 Code 3 Code 5 Code 6 Code 15 Code 16

TeSys U

Code 3 Code 6 Code 16

Altivar 31

Code 3 Code 6 Code 16

Lexium 05 Code 3 Code 16

No further information is provided in terms of detailed error analysis: only a group

error is given consideration.

Page 16: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

15

Implementation

Introduction The implementation chapter describes all the steps necessary to initialise, to configure, to

program and start-up the system to achieve the application functions as listed below.

Function

Instructions for switching on and functional description 1. Switch on all fuses and motor circuit breakers. 2. Acknowledge emergency off signals. 3. Switch on the master switch. 4. The data relating to the various bus nodes is shown on the HMI display. Data relating to the various devices such as the PLC, variable speed drive, servo drive and motor starter, should be displayed on the HMI. The devices communicate using a Modbus network. The Modbus RTU (Remote Terminal Unit) is a serial 2-wire bus (RS485) that is based on the master/slave principle, with one master and up to 31 slaves. In the system layout shown below, the HMI operator terminal is the master for communication with the first PLC. In turn, this PLC acts as a master for the devices that are connected via a second COM interface. These devices are all slaves. This layout has a number of advantages:

Should the HMI fail, communication with the devices on the network will continue as normal. Consequently, a production plant will not come to a standstill, since the automatic mode that is controlled by the master PLC can continue to run.

Should the PLC or one of the slaves fail, but there are no problems affecting the

HMI, then the relevant alarm messages can be displayed on the HMI. Where bus connections via the Modbus hub are concerned, differences in voltage between the various interfaces will not have any repercussions.

Page 17: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

16

Functional Layout

Page 18: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

17

Communication

Introduction This chapter describes the data passed via the communications bus (e.g. Modbus

Plus or TCP/IP) that is not bound directly with digital or analog hardware. The list contains:

The device links Direction of data flow symbolic name and Bus address of the device concerned.

Device Links The Modbus bus system is used in this application. This connects the various

devices (PLC, HMI, VSD, servo, motor starter) with one another and enables data exchange. Modbus hubs (distributors) are used in the following examples so that standard Modbus cables with RJ45 connectors can be accommodated. This means that differences in voltage between the various interfaces will not have any repercussions.

Modbus Topology

A number of different layouts are possible as far as the Modbus structure is concerned. As a basic principle, Modbus always takes the form of a master/slave system, i.e., there is only one master, which controls and monitors communication and requests data from/sends data to the slaves. There is no direct communication between the slaves. If data is to be transferred from one slave to another, it must first be read by the master and then sent to the other slave. With this kind of transfer, data can only be sent consecutively. The terminating resistors are responsible for guaranteeing a defined voltage level on the cables used for communication. If the test structure involves the use of short cables, testing can also be carried out without terminating resistors. In the system structure, testing can be carried out without terminating resistors.

Page 19: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

18

Example 1:

Example 2:

The LU9GC3 Modbus hub is a passive bus distributor, and should therefore be used as a bus line. Only one master is permitted on a Modbus hub at any one time.

Page 20: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

19

Each Twido COM interface can be both a master and a slave.

The optional COM2 interface in terminal or mini-DIN versions

Page 21: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

20

Various hardware addresses, as well as flags and memory words, are used within the PLC example program.

From the point of view of controlling communication, it is important to use a series of consecutive addresses, since the communication commands assign a specific sequence to the memory words (see PLC Programming).

To ensure clarity, absolute addresses (e.g., %MW2) are used in the PLC program.

Type Address Comment

memory words %MW0 to %MWx

In this program, only 16-bit words (2 bytes) are used as memory words.

Flags %M0 to %Mx

Flags are Boolean variables, which can only assume state 0 or 1.

Special memory words

%SW63

%SW64

Error codes are executed in this kind of flag word when communication errors occur on the Twido COM1/COM2 interface.

EXCHx

Exchange instruction

EXCH %MW0:30

Instruction to send/receive messages (data exchange), e.g., the next 30 bytes following %MW0 (= 15 memory words).

MSGx

Exchange control function block

%MSG1.D

%MSG2.D

Control bit for coordinating communication and monitoring communication errors for COM1 and COM2.

General Addressing and Commands

Page 22: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

21

PowerSuite Software

Introduction Multi-point Serial Modbus

PowerSuite software can be used to directly address and parameterize individual slaves connected via a Modbus hub. The advantage of this is that the cables between the slaves and the Modbus hub do not have to be disconnected; an additional communication cable running to the PC simply needs to be connected.

A typical layout: Within a single system, several devices are connected via a hub.

1 Connect USB 485040 (TSX C USB 485) cable adapter to the PC’s USB port. Connect the cable adapter to the Modbus hub using a Modbus cable with RJ45 connectors. The PC is now the Modbus master.

2 The Modbus master network (HMI or PLC) cable must be removed from the Modbus hub; otherwise, communication errors can occur.

3 Start PowerSuite software.

4 Expand Connections in the Project Browser.

Page 23: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

22

5 Double-click Serial multidrop:

6 Set the communication parameters and the slave address, and click Enter to confirm.

7 Right-click Serial multidrop and select Connect.

8 The search automatically accepts the connection to slave 2 and the parameters are read. These can also be changed online. Communication is established and available online.

Page 24: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

23

HMI

Introduction

This application features a Magelis XBT-R411 HMI, which communicates with the PLC via the Modbus RTU protocol. XBT-L 1000 software is used to program and configure the terminal. The HMI is defined as the Modbus master and is connected to the COM1 interface of the Twido Compact PLC via the Modbus hub. The steps to be taken in order to create and download a program are described on the following pages. The HMI is set up as follows:

Define master or slave Edit the application page Transfer project

Master or Slave

When creating a new project, you need to decide whether the terminal is to be a master or slave.

1 The terminal type is configured when a new project is created using the XBT-L1000 software. Commercial References: XBT-R411 Protocol:

Modbus => master Modbus Slave => slave

Then select Parameters...

Modbus Master Parameters

2 The following default parameters are set for all devices: Speed: 9,600 bauds Parity: Even Stop Bits: 1 Data Bits: 8 (fixed) Click OK to continue.

Page 25: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

24

3 In the application creation assistant: Use Brow se… to save the project in the relevant directory under any name, before clicking on Next>.

4 At least one slave must be specified in the List of current equipment. Click Modify the list… to open the Configure Equipment Symbols dialog box.

5 Here, you can modify names

and slave addresses.

Click OK to exit.

6 You can now configure the

language. Click Next> to finish creating the application.

7 Click Finish to open the first application page.

Page 26: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

25

Editing the Application Page

1 You can edit the application page.

2 Insert any text you like.

3 Edit – Insert field Read data from PLC Slave01

Double-click the location where the variable is to be inserted. - Click Modify… - Select the equipment - Variable type and address

to be read (%MW7). Then click OK.

4 The variable is inserted on the screen. During operation, the current value is displayed here.

5 The HMI start screen following the addition of more fields to the application page.

Page 27: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

26

Transfer Project to HMI or Export it

1

2

Unplug the XBT programming cable and connect the communication cable.

3 HMI display: Displayed opposite are the current values of the first six data registers (from %MW7 to %MW12) as read from the Twido PLC (only when the PLC has been programmed and communi-cation is active).

Page 28: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

27

PLC

Introduction This chapter describes how to initialize, parameterize and load the TwidoSoft

program to the Twido PLC in order to implement the functional description described above.

Preconditions Communication via the Modbus master requires parameterization and a PLC program that controls and monitors data transfer via the COM interfaces. For the slaves, it is only necessary to set the parameters. There is no need for communication programming here. Programming is displayed in both Ladder Language and Instruction List. Before carrying out the steps described below, you must ensure that: The TwidoSoft programming tool is installed on your PC The Modbus serial driver, Version 1.6 (Build 28) is installed on the PC. The Twido PLC is switched on and supplied with power The PLC and the PC are linked to one another via the PC <> Twido

programming cable (TSXPCX1031 or TSXPCX3030). Setting up the PLC is done as follows:

Create a new project Define interfaces Write programming in Ladder Language Alternatively, write programming in Instruction List

Communication between the Twido PLC (master) and the Twido PLC (slave)

Creating a New Project

1 To create a new project, select: File->New

Page 29: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

28

2 A window offering additional

settings opens. For the purpose of this application, the default settings will suffice. Confirm with OK.

Defining Interfaces

1 In the application navigator, right-click Hardware and select Add option…

2 Select the 2nd COM interface,

TWDNOZ485T, and click Add to confirm.

3 Right-click Port 1 and select:

Edit Controller Comm Setup… to call up the Controller Communications Setup dialog box.

Page 30: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

29

4 Select Modbus protocol. The parameters can now be edited. The COM interfaces can be either master or slave. The PLC program decides which is which. Address "1" is always selected. (This is not relevant for the master interface. For the slave interface, it is the slave address.) The PLC default values have been used in all of the examples: Baudrate: 9,600 Data Bits: 8 Parity: Even Stop Bits: 1 Click OK to confirm the values.

5 Do the same for Port 2.

PLC Program in LD Reading N Words From Slave (Code 03)

1 From the point of view of controlling communication, it is important to use a series of consecutive addresses, since a specific flag word sequence is required for the communication commands.

To ensure clarity, absolute addresses (e.g., %MW0, %MW100) are used in the PLC program.

Page 31: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

30

2 Bus initialization and reading data from slave 1 Here, the data %MW120 to %MW134 is read from slave 1, a Twido PLC. Data words %MW0 to %MW2 are used to initialize the slave concerned and to define which and how much data should be transmitted. %MW0 and %MW1 contain default values. Function Code 03 (Read) and 01 for the slave address are entered in %MW2. %MW3 contains the slave’s start address (the data will be read from this address onwards). The number of memory words to be read is specified in %MW4. Values from the receive table are read in %MW5 and %MW6. The data read from the slave is displayed in %MW7 onwards. Note: The data from the slave is displayed from the 7th memory word onwards (here, %MW7) + number (the “15” memory words in %MW4) = %MW21, and can then be transferred to the appropriate areas of the PLC program. In the example below, the data from addresses %MW120 to %MW134 (15 memory words) is read from the slave and written to the area of the master that ranges from %MW7 to %MW21.

Parameter Assignment Modbus Function 03 READ

3

4 Controlling communication. Communication with the slaves must be controlled in the master. This ensures that commands are not executed simultaneously, thereby preventing communication errors.

5 Checking the send bit.

The send commands are initialized by means of the EXCH2 function (for COM2). Following sending, bit %MSG2.D is set to 1 and the receive mode is triggered.

Page 32: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

31

6 Controlling the slaves In this example, bit %MSG2.D causes an incremental count to occur in a %MW999 data word. At the end of each send cycle, the value increases by 1. The value is compared so that other initial values can be transferred to the COM interface one by one, meaning that each of the slaves is scanned in turn. The sequence in which this is performed is arbit rary. Depending on the system, some slaves may be scanned several times, or hardly ever. Important: At least 2 send cycles are necessary per slave to guarantee secure communication.

7 Control with counter reset once all slaves have been scanned.

In the example below, the PLC master scans the data of 5 slaves (MW0, MW100, MW200, MW300, MW400), one after the other. This prevents different slaves from being scanned simultaneously – something that could cause communication errors.

Page 33: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

32

8 Example: Mapping the user data of slave 1

9 Monitoring the bus communication for errors Here, data word %SW64, which is responsible for identifying communication errors on COM2, is scanned and the number of errors counted.

To obtain a detailed error analysis, the error code in %SW64 must be evaluated. (where COM1 = %SW63)

Error Codes 10

Page 34: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

33

11 Under PLC and Connect in TwidoSoft, load the program into the PLC, select Start Program and connect the communication cables from the two Twido PLCs to the Modbus hub. The slave data is then visible in the master.

12 Connect cable and test:

PLC programming TSXPCX3030 or TSXPCX1031

Modbus communication PLC <-> Modbus hub

TWDX-CAR-J030 with RJ45

PLC Program in LD

1 Writing n words to slave, Modbus function (Code 16 (=10hex)) From the point of view of controlling communication, it is important to use a series of consecutive addresses, since a specific flag word sequence is required for the communication commands.

To ensure clarity, absolute addresses (e.g., %MW0, %MW5) are used in the PLC program.

Page 35: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

34

2 Bus initialization and writing data to slave 2. The data from %MW6 to %MW10 is to be written to a Twido PLC (slave 2) from a Twido PLC (Modbus master). Data words %MW0 to %MW5, are used to define the send request, i.e., the amount of data that is to be sent to which slave. %MW0 (16#01..) contains default values; (..12) is the send length = 8+2*(5) number of words to be sent %MW1 contains default values for sending %MW2 (16#02..) contains the slave address; (..10) is the default value for Code 16 %MW3, (..00) refers to %MW0 = the target address in the slave %MW4 contains the number of words to be written %MW5 (16#00..) contains default values; (..0A) = 10 decimal = 2*(5) number of bytes to be sent %MW6 onwards contain n number of data words to be sent to the slave. Note: In the example below, various factors cause an incremental count to occur in data words %MW6 to %MW10. This is only used for the purpose of an internal slave check.

Page 36: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

35

Parameter Assignment Writing Modbus Function 16

3

4 Controlling communication

Communication with the slaves must be controlled in the master: this ensures that commands are not executed simultaneously, thereby preventing communication errors.

5 Checking the send bit.

The send commands are initialized by means of the EXCH2 function (for COM2). Bit % MSG2.D is used to ensure that a send request is complete before the next one is sent. This is not the quickest method, but it is secure.

6 Monitoring send errors

Bit %MSG2.E is used to check whether any send errors are pending. The error code from COM2 is displayed in system word %SW64.

Page 37: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

36

Error Codes 7

8 Loading program Under PLC and Connect in TwidoSoft, load the program into the PLC, select Start Program and connect the communication cables from the two Twido PLCs to the Modbus hub. The slave data is then visible in the master.

9 Connect and test: PLC programming TSXPCX3030 or TSXPCX1031

Modbus communication PLC <-> Modbus hub TWDX-CAR-J030 with RJ45

Page 38: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

37

Communication between the Twido PLC (master) and the Twido PLC (slave) Program in IL

1 From the point of view of controlling communication in the master, it is important to use a series of consecutive addresses, since a specific flag word sequence is required for the communication commands.

To ensure clarity, absolute addresses (e.g., %MW0, %MW100) are used in the PLC program.

2 Bus initialization and reading data from slave 1 Here, the data %MW120 to %MW134 is read from slave 1, a Twido PLC. Data words %MW0 to %MW2 are used to initialize the slave in question, and to define which and how much data should be transmitted. %MW0 and %MW1 contain default values. Function Code 03 (Read) and 01 for the slave address are entered in %MW2. %MW3 contains the slave’s start address (the data will be read from this address onwards). The number of memory words to be read is specified in %MW4. Initial values from the receive table are read in %MW5 and %MW6. The data read from the slave is displayed in %MW7 onwards. Note: The data from the slave is displayed from the 7th flag word onwards (here, %MW7) + number (15 from %MW4) = %MW21, and can then be transferred to the appropriate areas of the PLC program. In the example below, the data from addresses %MW120 to %MW134 (15 memory words) is read from the slave and written into the area of the master ranging from %MW7 to %MW21.

Parameter Assignment Modbus Function 03 READ

3

Page 39: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

38

4 Controlling communication

Communication with the slaves must be controlled: this ensures that commands are not executed simultaneously, thereby preventing communication errors.

5 Checking the send bit.

The send commands are initialized by means of the EXCH2 function (for COM2). Following sending, bit %MSG2.D is set to 1 and the receive mode is triggered.

6 Controlling the slaves In this example, bit %MSG2.D causes an incremental count to occur in a %MW999 data word. At the end of each send cycle, the value increases by 1. The value is compared so that other initial values can be transferred to the COM interface one by one, meaning that each of the slaves is scanned in turn. The sequence in which this is performed is arbitrary. Depending on the system, some slaves may be scanned several times, or hardly ever. Important: At least 2 send cycles are necessary per slave to guarantee secure communication.

7 PLC In the example below, 5 slaves (MW0, MW100, MW200, MW300, MW400) are scanned for their data one after the other This prevents different slaves from being scanned simultaneously – something that could cause communication errors.

8 Resetting the counter once all slaves have been scanned.

Page 40: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

39

9 Example: Mapping the user data of slave 1

10 Monitoring the bus communication for errors Here, data word %SW64, which is responsible for identifying communication errors on COM2, is scanned and the number of errors counted.

To obtain a detailed error analysis, the error code in %SW64 must be evaluated. (where COM1 = %SW63)

Error Codes

11 Loading program Under PLC and Connect in TwidoSoft, load the program into the PLC, select Start Program and connect the communication cables from the two Twido PLCs to the Modbus hub. The slave data is then visible in the master.

12 Connect and test: PLC programming TSXPCX3030

Modbus communication PLC <-> Modbus hub TWDX-CAR-J030 with RJ45

Page 41: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

40

PLC Program in IL

1 Writing n words to slave, Modbus function (Code 16)

From the point of view of controlling communication, it is important to use a series of consecutive addresses, since a specific flag word sequence is required for the communication commands.

To ensure clarity, absolute addresses (e.g., %MW0, %MW5) are used in the PLC program.

2 Bus initialization and writing data to slave 2 The data from %MW6 to %MW10 is to be written to a Twido PLC (slave 2) from a Twido PLC (Modbus master). Data words %MW0 to %MW5, are used to define the send request, i.e., the amount of data that is to be sent to which slave. %MW0 (16#01..) contains default values; (..12) is the send length = 8+2*(5) number of words to be sent %MW1 contains default values for sending %MW2 (16#02..) contains the slave address; (..10) is the default value for Code 16 In %MW3, (..00) refers to %MW0 = the target address in the slave %MW4 contains the number of words to be written %MW5 (16#00..) contains default values; (..0A) = 10 decimal = 2*(5) number of bytes to be sent %MW6 onwards contain n number of data words to be sent to the slave. Note: In the example below, various factors cause an incremental count to occur in data words %MW6 to %MW10. This is only used for the purpose of an internal slave check.

Page 42: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

41

Parameter Assignment Writing Modbus Function 16 (=10hex)

3

4 Controlling communication

Communication with the slaves must be controlled in the master: this ensures that commands are not executed simultaneously, thereby preventing communication errors.

5 Checking the send bit

The send commands are initialized by means of the EXCH2 function (for COM2). Bit % MSG2.D is used to ensure that a send request is complete before the next one is sent. This is not the quickest method, but it is secure.

6 Monitoring send errors

Bit %MSG2.E is used to check whether any send errors are pending. The error code from COM2 is displayed in system word %SW64.

Page 43: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

42

Error Codes 7

8 Loading program Under PLC and Connect in TwidoSoft, load the program into the PLC, select Start Program and connect the communication cables from the two Twido PLCs to the Modbus hub. The slave data is then visible in the master.

9 Connect and test:

PLC programming TSXPCX3030 or TSXPCX1031

Modbus communication PLC <-> Modbus hub TWDX-CAR-J030 with RJ45

Page 44: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

43

Devices

Introduction This chapter describes the steps required to initialise and configure the devices

to attain the described system function.

General

In a large number of applications, other devices are connected to the Twido PLC via a Modbus network, such as Altivar 31 variable speed drives (ATV31), servo drives (Lexium 05) and motor starters (TeSys U). In the following examples, the Twido PLC, acting as the master, reads data from these slaves. The ATV31 and Lexium 05 parameters are entered or modified via the front panel. The PowerSuite software can also be used for configuration. This offers a number of advantages: You can save the data on your PC and copy it as you wish You can print out the documentation You can optimize parameters online. With the TeSys U motor starter, the slave address on the LUL-C032(031) Modbus communication modules must be set using the DIP switch. The module recognizes the communication parameters automatically.

Communication Between the PLC (Master) and Altivar 31 (Slave)

The master PLC is connected to the Modbus hub via the COM2 interface. From here, it is connected to the Altivar 31 (slave). The menu is structured as shown below.

Page 45: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

44

Setting the Altivar ATV31 Slave Address on the Display

1 To view this screen, you must select Modbus communication the first time the device is started up (see manual). Press ENT.

2 SET = Set

Press ENT.

3 Keep pressing the down

arrow until COn (Communication) appears. Press ENT.

4 Add = Address

5 Press ENT and set the slave address using the arrow keys. Modbus slave address = 9

Press ENT to confirm. The display flashes briefly.

Page 46: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

45

6 Press ESC and press the down arrow until tbr (baud rate) appears. Press ENT.

7 Use the arrow keys to set the baud rate. 9.6 for 9,600 bauds

Press ENT to confirm. The display flashes briefly.

8 Press ESC and press the down arrow until tF0 (Control Bits) appears. Press ENT.

9 Use the arrow keys to select 8E1. 8E1 stands for 8 data bits. Parity = even; 1 stop bit Press ENT to confirm. The display flashes briefly. Press ESC 3 times to return to the first screen.

Activating Parameters

10 To activate the communication parameters, the ATV31 must be switched off and back on again.

Page 47: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

46

Altivar 31 Addresses

11 The addresses can be found in the ATV31_Communication_Variables manual. In the example below, the drive rating and the drive voltage of the VSD are read.

PLC Program in LD

12 For scanning data from the Altivar 31 In this case, initialization begins with %MW400. Starting with ATV31 Modbus address 3011, two words are read out from slave 9. (Function 03) The user data is displayed from %MW407.

Page 48: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

47

13 Connect and test:

VSD programming

PowerSuite adapter W8 with RJ45 or USB-485040 adapter with Modbus cable with

RJ45 Modbus communication

Altivar 31 <-> Modbus hub VW3A8306R10 Modbus cable with RJ45

14 To see the values on the HMI, read out addresses %MW407 and %MW408 from slave 1 (PLC) on the HMI.

Page 49: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

48

Communication Between the PLC (Master) and TeSysU (Slave)

The master PLC is connected to the Modbus hub via the COM2 interface. From here, it is connected to the TeSys U (slave).

Setting the TeSys U Slave Address

1 First, remove the power supply to the device. Then dismantle it and pull out the Modbus LULC032 module.

2 Set the TeSys U slave address on the underside of Modbus module LULC032.

Page 50: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

49

DIP Settings

3 1 = 2^0 2 = 2^1 3 = 2^2 4 = 2^3 5 = 2^4

The decimal address is binary-coded. It can be easily converted using the Windows Calculator.

4 Binary conversion using the Windows Calculator:

5

Enter the decimal value and click Bin.

6

The module detects communication parameters, such as baud rate, data bits and stop bits automatically whenever the master submits a request. This means that it is only necessary to set the slave address.

7 The communication parameters are activated when the device is switched on.

Page 51: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

50

Reading Addresses From TeSys U

1 The addresses can be found in the LULCO31 (Modbus module) manual (DE_174323403a55.pdf ). In the example below, the switch setting is read.

2 PLC program component for scanning data from the TeSys U In this case, initialization begins with %MW300. Starting with TeSys U address 457, one word is read out from slave 2. The user data is displayed from %MW307.

3 Cabling:

4 Connect and test

5 To see the values on the HMI, read out address %MW307 from slave 1 (PLC) on the HMI.

Page 52: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

51

Option 1

Communication Between the Twido PLC (Master) and the Lexium 05 (Slave)

The master PLC is connected to the Modbus hub via the COM2 interface. From here, it is connected to the Lexium 05 (slave).

Menu Structure

Setting the Lexium 05 Slave Address on the Display

1 To view this screen, you must select Modbus communication the first time the device is started up (see manual).

Page 53: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

52

2 SET = Set Press ENT.

3 CoN = Communication

Press down arrow until..

4

Press ENT.

5 MbAd = Modbus address

Press down arrow until..

6 Example: Slave 11 Press ENT and set the slave address using the arrow keys. Press ENT to confirm. The display flashes briefly.

Page 54: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

53

7 Mbbd = Modbus baud rate Press ESC and press the down arrow until.. Press ENT.

8 9.6 = 9,600 bauds Use the arrow keys to select 9,600 bauds. Press ENT to confirm. The display flashes briefly.

9 MbFo = Parameters Press ESC and press the down arrow until.. Press ENT.

10 8E1 stands for 8 data bits. Parity = even; 1 stop bit Use the arrow keys to select 8E1. Press ENT to confirm. The display flashes briefly. Press ESC 3 times to return to the first screen.

Activating Parameters

11 To activate the communication parameters, the Lexium 05 must be

switched off and back on again.

Page 55: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

54

Lexium 05 Addresses

12 The addresses can be found in the manual: LXM05A_manual_V104_TE_DE.pdf In the example below, the motor type is read.

PLC Program Component For Scanning Data From the Lexium 05

13 In this case, initialization begins with %MW500. Starting with Lexium address 3332, two words are read out from slave 11. The user data is displayed from %MW507.

Cabling 14

Servo programming

PowerSuite adapter W8 with RJ45 or

USB-485040 adapter with Modbus cable with RJ45

Modbus communication Servo <-> Modbus hub VW3A8306R10 Modbus cable with RJ45

15 Connect and test

16 To see the values on the HMI, read out address %MW507 from slave 1 (PLC) on the HMI.

Page 56: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

55

Option 2

Communication Between the Twido PLC (Master) and the Twido PLC (Slave)

The Twido PLC (master) is connected to the Modbus hub via the COM2 interface. From here, it is connected to the Twido PLC (slave).

Parameterization As described in chapter PLC, but the communication parameters for the COM interface are set in the PLC project of the slave PLC.

Programming There is no need to program the communication in the slave PLC. It is important to ensure that the memory words that are to be read or written by the master are available in the slave program.

Performance

Scan and Cycle Time

Modbus (Modbus RTU) is a serial bus used in automation technology for communication between (up to 31) different devices. This bus system requires a master, which initializes the control of the communication protocols, and slaves, which wait for the master to scan (read) or send (write) data. Data cannot be exchanged directly between the slaves. Instead, this must always be carried out via the master (which reads the data from slave x and writes it to slave y). The length of time taken to transmit data depends on the bus load (amount of data), the number of slaves connected, the baud rate and the cycle time of the Modbus master PLC. Most devices support baud rates 4,800, 9,600 and 19,200. Baud rates 600, 1,200, 2,400 and 38,400 are only supported by some devices. This must be taken into consideration during configuration. It is therefore advisable to group flags into memory words, to avoid an unnecessarily large number of individual instructions. In the same way, consecutive addresses should be used where there are several memory words. These will then be written or read in blocks (max. 120 MW per instruction). The speed of data transmission, and therefore response times, may slow down depending on the amount of data and the system layout. The times may increase from <1 s (only 1 slave) to 5 – 10 seconds (more than 5 – 10 slaves). Behavior during errors: If one of the slaves fails (due to a cable break, power failure, etc.), the master repeatedly attempts to establish communication with the slave in accordance with how it has been configured. During this time, no data is exchanged with the other slaves, resulting in a delay. Comprehensive details can be found in the relevant reference manuals or on the Internet at www.modbus.org.

Page 57: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

56

Appendix

Detailed Component List

Pos. Amt. Description Part Number Rev./ Vers.

Hardware Components

1.1 1 Vario master switch VCF02GE 1.2 1 Harmony emergency off switch

housing XALK178G

1.3 1 Phaseo 230 V AC/24 V DC power supply unit

ABL7 RP2403

1.4 1 Magelis XBT-R411 HMI XBT-R411 1.5 1 Modbus TeSys hub LU9GC3 1.6 1 Twido Compact PLC TWDLCAA-24DRF 1.7 1 RS485 communication adapter TWDNAC485D 1.8 1 Altivar 31 variable speed drive ATV31H018M2 1.9 1 TeSys U motor starter LUCM1XBL LUCM1XBL

Pos. Amt. Description Part Number Rev./ Vers.

Software Components

2.1 1 TwidoSoft TWDSPU1002 V3.2 2.2 1 XBT-L1000 XBTL1003M V4.42 2.3 1 PowerSuite VW3 A8 104 V2.3

Option 1

Pos. Amt. Description Part Number Rev./ Vers.

Hardware Components

3.0 1 Lexium 05 servo drive controller LXM05AD10M2

Option 2

Pos. Amt. Description Part Number Rev./ Vers.

Hardware-Bauteile

4.0 1 Twido Modular PLC TWDLMDA20RT

Page 58: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

57

Component Protection Classes

Positioning Cabinet Component In Feld, On Site Front Inside Protection class

IP54 IP65 IP67 IP55 IP65 IP20

Vario master and maintenance switch X

Harmony emergency off switch housing X

Phaseo 230 V AC/24 V DC power supply unit X

Magelis XBT-R411 HMI X Modbus TeSys hub LU9GC3 X Twido PLC X Altivar 31 variable speed drive X Lexium 05 servo drive controller X TeSys U motor starter LUCM1XBL X

Page 59: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

58

Component Features

Components Vario master switch VCF02GE

690 V AC – 12 A 3-pin 2 auxiliary contacts possible Strong housing

Harmony emergency off switch XAL K178G 2 N/C contacts, 1 N/O contact 240 V AC – 3 A 2 safety-oriented switching contacts 1 signal contact Trigger action

Phaseo power supply unit: ABL7RP2403 100 – 240 V AC/24 V DC

3A secondary Slimline design Parallel connection possible Short-circuit protected

Page 60: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

59

Components Magelis XBT-R411 operator terminal Can be programmed using XBT-L1000 software Modbus master or slave, RS232/RS485 interface Display color: Green, orange or red 12 freely configurable function keys 200 application pages 250 alarm pages 4 x 20 display (72 x 20 mm) Keys can be custom-labeled

TeSys Modbus hub LU9GC3 8 RJ45 Modbus distributors for RS485 connections Input and output socket Passive: no power supply RJ45 bus terminating resistors (optional)

Twido PLC Compact or modular design Compact: 6 I + 4 O up to 24 I + 16 O Modular: 12 I + 8 O up to 248 I + 240 O 24 V DC/240 V AC Can be programmed in IL and LD Modbus: master/slave Optional: CANopen bus/AS interface/Profibus

Page 61: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

60

Components Altivar 31 variable speed drive Single-phase and 3-phase 240 V AC single-phase: 0.18 – 2.2 kW 400 V AC 3-phase: 0.37 – 15 kW 600 V AC 3-phase: 0.75 – 15 kW Built-in class B EMC filter Temperature range: - 10 to +50 °C

Speed range from 1 to 20 (0 to 200 Hz)

Speed control with flow vector check Modbus/RS485 CANopen interface Parameterization of inputs/outputs possible

Protection of drive and motor Compact design, side-by-side installation also possible on a

top-hat rail using bracket VW3A11852 VW3A11851 for 230 V devices 1~

Lexium 05 servo Servo amplifier for a single axis 115 V AC , 0.4 kW to 1.4 kW 240 V AC , 0.75 kW to 3.2 kW 400 V AC, 1.4 kW to 6.0 kW 4 kHz/8 kHz frequencies Built-in line filter Temperature during operation: 0 – + 50°C Modbus, RS485 CANopen

Page 62: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Tw ido_Modbus_EN.doc

Schneider Electric

61

Components TeSys U motor starter Single-phase and 3-phase starter 440 V AC, 0.15 – 32 A 1 and 2 directions of rotation (reversing mode) For motors from 0.09 to 15 kW Safety-oriented switching contacts Modular system Modbus RS485 (optional with communication module)

Page 63: Twido Modbus with Magelis, Altivar, Lexium, TeSysU … SYSTEMOW AUTOMATYKI... · CB Circuit Breaker ... Magelis XBT-R411 HMI panel ... This image shows a typical test setup, which

Schneider Electric GmbH Steinheimer Strasse 117 D - 63500 Seligenstadt Germany Twido_Modbus_EN.doc

As standards, specifications and designs change from time to time, please ask for confirmation of the information given in this publication. 62

Contact

Author Telephone E-Mail

Schneider Electric GmbH Machines and Process Architectures

+49 6182 81 2555 [email protected]