Sie sind auf Seite 1von 42

Communication with TeSys U ModBus Over Serial Line

This Document prepared by

Page 1 of 42

Jan 2008

Table of contents

1.Basic function of the Communication Module...(Page.3) 2. Description of the Module and hardware installation......(Page.3) 3. How to address the Module..(Page.4) 4. RJ45 Connector Pin out.(Page.5) 5. MODBUS TESTER...(Page.6) 6. Configuration & communication with MODBUS TESTER.....................(Page.5) 7. Electrical connection..(Page.11) 8. Configuration during commissioning(Page.13) 9. Communication configuration(Page.14) 10. Starting up the Module via the Registers...........................(Page.16) 11. .CSV file installation...(Page.17) 12. Example for Modbus command.(Page.17) 13. Communication between Wonderware and Schneider component using OPC...(Page.18) 14. Communication with PLC..(Page.34) 15. How to READ and WRITE through PLC.(Page.35) 16. Communication from another PC using ETHERNET.(Page.39)

Page 2 of 42

Jan 2008

1-The communication module enables you to:

x x x x x Read the motor-starter states Control the motor-starter (reversing or non-reversing) Adjust the protection functions Read the data processed in the advanced and multifunction control units Read the state of the I/O (controller base)

2-Description of the Module and Installation Diagram of the Module:

Connectors and indicator lights (LEDs) on the LULC032-033 Modbus Communication module

1 Green "COMM" Modbus communication status LED. 2 Red "ERR" Modbus communication module fault indication LED. 3 Green "24V" LED indicating voltage presence at outputs OA1, OA3, LO1. 4 RJ45 connector for the Modbus RS485 link. 5 Connection of the module power supply. 6 Connection of the 24 V power supply for outputs OA1, OA3, and LO1. 7 Discrete input 2. 8 Discrete input 1. 9 Discrete output 1, assignable depending on the configuration register (685 LSB). 10 24 V prewired coil connector for the power base. x The assignment of OA1 depends on the configuration register (686 LSB). x The assignment of OA3 depends on the configuration register (686 MSB). 11 Connector for communication with the advanced or multifunction control unit Page 3 of 42 Jan 2008

3-Addressing Using Switches

The Modbus communication module address is defined by switches located on the Underside of the module. Simply turn the module over to access them:

The range of accepted values is between 1 and 31. The address coding is in binary format. This address which enable the device to accept the request (0) address is used for broadcast request which send the message to all the devices This is the device address from 1 to 31

Page 4 of 42

Jan 2008

RJ45 Connector Pin out:

The communication module is connected to the Modbus network with an RJ45 connector in compliance with the following wiring:

Communication (Modbus Port)

The technical characteristics of the LULC032-033 Modbus communication module Modbus port is as follows

Page 5 of 42

Jan 2008

MODBUS TESTER First we can check the communication with TeSys U by Modbus Tester as follow:
1-First opens Modbus Tester

2- Determine the drive type from 3 installed drivers

Page 6 of 42

Jan 2008

3- Configure the Modbus serial Driver Configure the Com. Port no. & baud rate& parity & stop bits and data bits mode From [1] configuration

Page 7 of 42

Jan 2008

4-then go to the modbus Test and determine the link parameter (Protocol type) and if the type of protocol is TCP/IP we must put the IP address

Page 8 of 42

Jan 2008

And if the protocol type is Modbus Serial we must determine the slave NO.

After configure all the above parameter we press Connect putton

Page 9 of 42

Jan 2008

Then press Start if the communication status is good the state will be connected and request will start count

If the communication status is bad it will be Invalid Response

Page 10 of 42

Jan 2008

Electrical Connection:

24VAUX Connection of the module power supply. 24V Connection of the 24 V power supply for outputs OA1, OA3, and LO1 COM common for supply

LI1& LI2 Programmable discrete input

LO1 programmable discrete output Jan 2008

Page 11 of 42

@  97 8

i (

' i

d b `ca

t "q p s r

( "F

' "F

( '


@ # 97 8 )( 0( 5 64 0' ' ' )( 0( )' Y `X 3 1 2 0 ( BBF E H G )( p 5 R QP 5 $ % & ( BI

vu wu y x   # ! "     #       h gQe f a "i ( ' "i

A @ 8 D C  B6# 97 D C  A @  97 8

V " " B " " V 6B y x yzx

{ u st v s tw v

jk i h g l e d jk i h g f e d p o nm p o n


~  }

OLR1: N.C of the overload protection S1: Selector Switch for (Manual/Auto/Off) Mode S1.1: Start Motor Manual S1.2: Stop Motor Manual K1: The coil of the contactor (TeSys U) RUN LAMP: Indication for Motor running TRIP: Indication for the Motor is tripped

6 " V6B

" V Q 9 r B


Page 12 of 42

Electrical power connection

Jan 2008

Configuration during commissioning

Press the ENT key to start the configuration Press DOWN up to reach to the 5_CommSetup Then press ENT then you can config. The communication parameters according to the bus

Page 13 of 42

Jan 2008

1-Communication Configuration

The address is selected using switches:

Speed and Parity the recognized values are as follows

Page 14 of 42

Jan 2008

Pin assignment configuration

The way of communication with TeSys U is depending on the controller if we used controller supporting Modbus we connect it directly. If we want to communicate with PC we need 485/232 converter. In our test we used UNTILWAY converter but it isnt recommended. We used PIN no.1 & 2 in the converter chip and used it as D0&D1 so the pin Connection is:


1(D1) 2(D0)

4 5

Page 15 of 42

Jan 2008

4-Starting up the Module via the Registers

Access to Parameters:
The module I/O parameters are set by one of the following three methods: x x x The Modbus RJ45 port, via the application PLC The LUCM multifunction control units terminal port Locally, via the LUCM multifunction control units keypad

Data-Exchange Format

Modbus Format: Communication is based on the slave Modbus RTU protocol. The data format is as follows:

Page 16 of 42

Jan 2008

5-Modbus Requests and Programming Examples over OFS server

First we prepare the file of needed Register for reading or write and this file is .CSV (Comma separated variable) Example: Register 704 is used for Run\Stop Command In the .CSV file we used the function code of the modbus protocol for write in this protocol like, {0400705, Control of the control system (Motor)} {04 =function code to write in register 00705= (register no. +1), the register name}

After this example we able to make any command for any register by the same way {Function Code + (Register No+1), register name} in .csv file And according to the register function we put a value in this register In the previous example if we need to make motor Start we must put 1 in the Bit (0) so we send a value of 1to the register

Page 17 of 42

Jan 2008

Communication between Wonderware and Schneider component using OPC

After installing Wonderware & OFS (OPC for Schneider).Now we have to adjust communication. Opening OFS files as the picture below:

You can find; x OFS Configuration Tool. x OFS Testing Clients > OFS client. x OPC Factory Server. x OPC Factory Server simulator.

Page 18 of 42

Jan 2008

Opening Wonderware files as the picture below:

You can find; x InTouch. x IO Servers > OPCLink. Do these steps to adjust communication. Step 1: Adjust OFS configuration: Open OFS Configuration Tool window.

Click Create a new alias. In name field write your selected alias name (EX: Write Test). Double click Symbols table file field. Select your file which written by UnityPro, PL7 or by yourself as in (PAGE.16). Double click <Driver> :< PLC Address> field. Recognize communication way. In PLC field select the method of writing symbols table file.

Page 19 of 42

Jan 2008

Click Apply. Close OFS Configuration Tool window. Step 2: Adjust OPCLink configuration: Open OPCLink window. Click file < new.

Page 20 of 42

Jan 2008

Click configure < Topic Definition. Fill Topic Name (EX: write Test). If OFS server and OPCLink in the same computer. Dont fill Node Name. If not write node name of computer contain OFS server. Select OPC Server Name by browsing or writing (Schneider-Aut.OFS). Click browse button and select your alias (In our example Test). Confirm by clicking OK. Save your file with (CFG extension)

Click configure < OPC Servers. You should see (Schneider-Aut.OFS). If you dont find it. Restart OPCLink.

Click configure < OPCLink settings.

Page 21 of 42

Jan 2008

You have to uncheck (NetDDE being used). Step 3: Create TAG Name: Open INTouch Window Maker. In Application Explorer window open OPC<Tag Creator. If tag creator asks you to create Access Name, Click ignores.

Page 22 of 42

Jan 2008

Click Configure. Do these steps respectively 1. In OPC Server select (Schneider-Aut.OFS). 2. Select OPC Server Node in your network. 3. Select OPCLink Node. 4. Select your Configuration file (In our example test). 5. Click OK. 6. Now, tag creator asks you to create Access Name with your specification. 7. Click Create. 8. Now, you can see your entire variables and you can select any one to create tag name. 9. Create tag name and click done. 10. Use tag names in your project. Note: While creation of tag names OPC Tag Creator write tagname as Follow: <Type><Name>_<Access name> Ex: iRun_Test Its advisable to delete access name to be: <Type><Name> Ex: iRun

Step 4: I want OPCLink to recognize (Scheider-aut.OFS) server path. x Finding the Server path: To find the OPC server path, you have to make right click the server icon and select properties.

Page 23 of 42

Jan 2008

Window like that will appear:

Page 24 of 42

Jan 2008

In target field. You will find the OPC server path between quotation marks.

Putting Server path in system Environment: We can do that by right click My Computer and select properties (System Properties window will pop up). By selecting Advanced, Environment Variables. In Environment Variables window. You should double click Path in System variables table.

Page 25 of 42

Jan 2008

In Variable value field. At the end I will add semicolon and OPC server path and semicolon. Click on OK. Restart Windows. Now you can communicate between Wonderware and Schneider component using OPC.

If you want InTouch read another InTouch in another node. Create access name with the following specification.

Page 26 of 42

Jan 2008

Write access name in Access field. Write computer node name in Node name field. Write VIEW in Application Name. Write TAG Name in Topic Name. Select Suite Link as Protocol. Click OK. Create tag names as I/O type with new access name and fill Item field with tagname of InTouch where I want communicate. Make windows Firewall off in PC you want read from it. Open control panel<Firewall. Select Off. Click OK.

Page 27 of 42

Jan 2008

Now, when Window Viewer opens in both computer. Tag names can be read. If InTouch in first node has a problem & I want second InTouch read direct from server. Do this steps. Adjust OFS configuration (See Page 21). Adjust OPCLink configuration (See Page 22). Check Enable Secondary Source and fill extended window as follow. In Node Name write the server node name. In Application Name write OPCLink. In Topic Name write OPCLink Topic Definition. Page 28 of 42 Jan 2008

Open WindowViewer in both PCs. You can see that InTouch read from another and when you close WindowViewer or PC has any problem. The second read direct from the server.

Example: we have (TeSys U) contactor and I want InTouch to read and write in its registers. First I select register I want and save it in file (with extension CSV) as follow. Address, Name (EX:_ 0400704,RUNMotor) ETC. Save file as Test.CSV.

Open OFS Configuration Tool window.

Page 29 of 42

Jan 2008

Create New Alias with name TeSys-U Double click in address field.

Page 30 of 42

Jan 2008

Select Communication way In PLCs field select CONCEPT. Click OK Select Test. CSV in Symbols table file. Click Apply. Close OFS Configuration Tool window. If I want INTouch in a PC read from OFS server in another PC (Named Ebrahim) Open OPCLink.Click New Add new Topic Definition. Adjust settings as in the following picture.

Page 31 of 42

Jan 2008

Dont forget to uncheck (NetDDE being used) in OPCLink settings. Save your file as tesy_s.CFG. Close OPCLink. Open InTouch Window Maker. Open Tag Creator. Click Configure x x x x x In OPC Server select (Schneider-Aut.OFS). In OPC Server Node select Ebrahim. Let OPCLink Node blank. Select Tesy_s as Configuration file. Click OK.

Create your tags and make windows to animate them. You can do like that:

Page 32 of 42

Jan 2008

Page 33 of 42

Jan 2008

Communication with PLC

Now we are going to connect the TeSys U with Modicon M340 on Modbus port

Page 34 of 42

Jan 2008

Hardware connection
Hardware connection between the PLC and TeSys U by using ETHERNET cable & RJ45 The connection will be point-to-point

Software Configuration
From the configuration of serial port we can determine the type of PLC (MASTER / SLAVE) and if we choose slave type we must put the slave no. in our application we used the PLC as MASTER Transmission speed according to the bus speed we used 19200 in our application and select the physical line (232/485) in our application we used RS485 and also define the parity (even/odd/none) we used none And Data (ASCII/RTU) we used RTU in our application finally stop bit (1/2) we used 1bit

Select the Type MASTER or SLAVE

Slave number :This zone enables you to enter the processors slave number:


Frame configuration Select the physical line

Page 35 of 42

Jan 2008

Now we are able to connect to PLC via Modbus with TeSys U

First we determine the device slave NO. =1 and from PLC functions READ_VAR &WRITE_VAR We can read and write in any register from the below figure by using ADDM to convert the slave address from String to Array because the function of READ & WRITE need address in this form Then we put in the (OBJ) %MW and in the (NUM) we put the REGISTER NO (450) but with communication with PLC we will put the register as in manual not adding 1 as in control from the server (REF.PAGE.6).In (NB) we put the needed REGITERS to READ or WRITE (40) in our example and the received data is stored in (RECP) .and the other fig. show the READ values from the PLC in case of connection
To convert physical address* to an array of 6 integers


Program to read data


Table containing the read objects: %MW10 to %MW19

Type of objects to read: %MW

Table to read in slave (TeSys U): %MW(REG.100) to %MW(REG.109)


Exchange management table: %MW50 to %MW53

%MW 450 40 %MW50:4


And we can read the change in values from animation tables

Page 36 of 42

Jan 2008

To convert physical address to an array of 6 integers

Program to write data

.2 ADDM 1



Destination table in slave (TeSys U) %MW(REG.120) to %MW(REG.139) Table to write : %MW20 to %MW39

%MW 700 10 %MW110:10 %MW100:4

2 WRITE_VAR Type of objects to write : %MW ADR OBJ NUM NB EMIS %MW100:4 GEST GEST

Also we can write the change values in animation table

Page 37 of 42

Jan 2008

After press Modification In our project we use to give RUN command to the contactor (TeSys U) By write (1) in Register 704

Page 38 of 42

Jan 2008

Software configuration for communication via ETHERNET from other PC

We make a new network

And put the name of the network in (List of available Networks)

Page 39 of 42

Jan 2008

Then we go to the ETHERNET port and change the function type to ETH TCP IP

And put the network name in Link net (workgroup)

Page 40 of 42

Jan 2008

Now we are able to communicate with TeSys U over ETHERNET over PLC

And you can see all the above configuration and program which has been recorded with the attached CD

Page 41 of 42

Jan 2008

The document reference

x x x x x x

LULC032033ModbusCommunicationModule (Users Manual) Practical Industrial Data Networks (Design & Installation) TeSys U Communication Variables User Manual OFS documentation OPCLink users Guide Technical information from SYSTECH_EGYPT team


Tel: + (20) 2 22 606010

Page 42 of 42

Jan 2008