communication with tesys u modbus

42
Page 1 of 42 Jan 2008 www.systech-egypt.com Communication with TeSys U ModBus Over Serial Line This Document prepared by

Upload: mohamed-lotfi

Post on 24-Oct-2014

355 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Communication With Tesys u Modbus

Page 1 of 42 Jan 2008 www.systech-egypt.com

Communication with TeSys U ModBus Over Serial Line��

This Document prepared by

������������

��

Page 2: Communication With Tesys u Modbus

Page 2 of 42 Jan 2008 www.systech-egypt.com

��

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 3: Communication With Tesys u Modbus

Page 3 of 42 Jan 2008 www.systech-egypt.com

1-The communication module enables you to: x Read the motor-starter states x Control the motor-starter (reversing or non-reversing) x Adjust the protection functions x Read the data processed in the advanced and multifunction control units x 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 4: Communication With Tesys u Modbus

Page 4 of 42 Jan 2008 www.systech-egypt.com

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 5: Communication With Tesys u Modbus

Page 5 of 42 Jan 2008 www.systech-egypt.com

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 6: Communication With Tesys u Modbus

Page 6 of 42 Jan 2008 www.systech-egypt.com

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 7: Communication With Tesys u Modbus

Page 7 of 42 Jan 2008 www.systech-egypt.com

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

Page 8: Communication With Tesys u Modbus

Page 8 of 42 Jan 2008 www.systech-egypt.com

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 9: Communication With Tesys u Modbus

Page 9 of 42 Jan 2008 www.systech-egypt.com

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 10: Communication With Tesys u Modbus

Page 10 of 42 Jan 2008 www.systech-egypt.com

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 11: Communication With Tesys u Modbus

Page 11 of 42 Jan 2008 www.systech-egypt.com

Electrical Connection:

���

���������� � � � ��������

�������

��

���

� �

� �

� �

� �� �!"$#

%'& �$(*) � + ,

%'& � ( ) � + ,

� �

� �- .*/*0

� �

� �1*�

� �23# 4 #

� �

1 5 68723# 4 9

:<;

.��

.��

=?><@A3=CB D

7 6 < 6 �8

E��

E��

E��

E��

F G�H�I J

K L

K MN O P Q

%'& ��(

%'& � (F R

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

Page 12: Communication With Tesys u Modbus

Page 12 of 42 Jan 2008 www.systech-egypt.com

Electrical power connection

S�T

U

V

W

X

Y

Z

[

\]^_

`bac

d e f g h i j kd e l g h i j km n o p

VVq VV r

WW

st uv

st wv

xzy yx

{|

}

~

}

� � �

~

�� � � � � � � ��� ��� � � � � � �*� ��� � � � � � � ��� � � �   ¡ �£¢ � ¤ ���   ¥ �¦�   ¡ � § �   ¤ �

¨ © ª « ¬ � ­8® ª ¯b§ � � � ¡[[[

° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °± ± ±

± ± ± ° ° ° ² ³ ´

µ ¶ n o p

·�¸

¹*º$»½¼�¾À¿8Á�¹�¹� Ã Ä$Ź

Æ8ÇÀź�È�º¾

É Ê*Ë?Ì Í

Î Ï

Î Ð

¹*º$»½¼�¾¿8Á�¹�¹� Ã

Ñ ÒÑ ÒÓÑ Ò

Ô Õ Ö × Ø ÙÔ ×Ú Û

Ü'Ý ]3TÞ ß Ö × Ø àÞ àá�â ã*Û

X

Y

Z

[ä å å æV Z rç è V é é ç

V

Wê X

ê XV XV Y

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

Page 13: Communication With Tesys u Modbus

Page 13 of 42 Jan 2008 www.systech-egypt.com

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 14: Communication With Tesys u Modbus

Page 14 of 42 Jan 2008 www.systech-egypt.com

1-Communication Configuration

The address is selected using switches:

Speed and Parity the recognized values are as follows

Page 15: Communication With Tesys u Modbus

Page 15 of 42 Jan 2008 www.systech-egypt.com

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 isn’t recommended.

We used PIN no.1 & 2 in the converter chip and used it as D0&D1 so the pin Connection is:

MODBUS (TeSysU)

RJ45

Chip. Pins��

(UNITELWAY)

4 1(D1)

5 2(D0)

Page 16: Communication With Tesys u Modbus

Page 16 of 42 Jan 2008 www.systech-egypt.com

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 �The Modbus RJ45 port, via the application PLC x �The LUCM multifunction control unit’s terminal port x �Locally, via the LUCM multifunction control unit’s keypad

Data-Exchange Format Modbus Format: Communication is based on the slave Modbus RTU protocol.

The data format is as follows:

Page 17: Communication With Tesys u Modbus

Page 17 of 42 Jan 2008 www.systech-egypt.com

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 18: Communication With Tesys u Modbus

Page 18 of 42 Jan 2008 www.systech-egypt.com

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 19: Communication With Tesys u Modbus

Page 19 of 42 Jan 2008 www.systech-egypt.com

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 20: Communication With Tesys u Modbus

Page 20 of 42 Jan 2008 www.systech-egypt.com

Click Apply.

Close OFS Configuration Tool window.

Step 2:

Adjust OPCLink configuration: Open OPCLink window.

� Click file < new.

Page 21: Communication With Tesys u Modbus

Page 21 of 42 Jan 2008 www.systech-egypt.com

� Click configure < Topic Definition.

Fill Topic Name (EX: write Test).

If OFS server and OPCLink in the same computer. Don’t 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 don’t find it. Restart OPCLink.

� Click configure < OPCLink settings.

Page 22: Communication With Tesys u Modbus

Page 22 of 42 Jan 2008 www.systech-egypt.com

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 23: Communication With Tesys u Modbus

Page 23 of 42 Jan 2008 www.systech-egypt.com

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

It’s 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 24: Communication With Tesys u Modbus

Page 24 of 42 Jan 2008 www.systech-egypt.com

Window like that will appear:

Page 25: Communication With Tesys u Modbus

Page 25 of 42 Jan 2008 www.systech-egypt.com

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

x 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 26: Communication With Tesys u Modbus

Page 26 of 42 Jan 2008 www.systech-egypt.com

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 27: Communication With Tesys u Modbus

Page 27 of 42 Jan 2008 www.systech-egypt.com

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 28: Communication With Tesys u Modbus

Page 28 of 42 Jan 2008 www.systech-egypt.com

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 29: Communication With Tesys u Modbus

Page 29 of 42 Jan 2008 www.systech-egypt.com

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 30: Communication With Tesys u Modbus

Page 30 of 42 Jan 2008 www.systech-egypt.com

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

Page 31: Communication With Tesys u Modbus

Page 31 of 42 Jan 2008 www.systech-egypt.com

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 32: Communication With Tesys u Modbus

Page 32 of 42 Jan 2008 www.systech-egypt.com

Don’t 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 In OPC Server select (Schneider-Aut.OFS).

x In OPC Server Node select Ebrahim.

x Let OPCLink Node blank.

x Select Tesy_s as Configuration file.

x Click OK.

Create your tags and make windows to animate them.

You can do like that:

Page 33: Communication With Tesys u Modbus

Page 33 of 42 Jan 2008 www.systech-egypt.com

Page 34: Communication With Tesys u Modbus

Page 34 of 42 Jan 2008 www.systech-egypt.com

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

Page 35: Communication With Tesys u Modbus

Page 35 of 42 Jan 2008 www.systech-egypt.com

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

��

Slave

�Slave number :This zone enables you to enter the

processor’s slave number:

Select the Type MASTER or SLAVE

Frame configuration

Select the physical line

Page 36: Communication With Tesys u Modbus

Page 36 of 42 Jan 2008 www.systech-egypt.com

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

Program to read data

NUM450NB40

ADROBJ’%MW’

GEST%MW50:4

RECP %MW10:40

GEST %MW50:4

.1

READ_VAR2

IN’0.0.0.1’ OUT

.2

ADDM1

�� And we can read the change in values from animation tables

Exchange management

table: %MW50 to %MW53

To convert physical address*

to an array of 6 integers

Table to read in slave (TeSys U):

%MW(REG.100) to %MW(REG.109)

Type of objects to read: %MW

Table containing the read objects:

%MW10 to %MW19

Page 37: Communication With Tesys u Modbus

Page 37 of 42 Jan 2008 www.systech-egypt.com

Program to write data

GEST%MW100:4

NUM700NB10

ADROBJ’%MW’

EMIS%MW110:10GEST %MW100:4

.1

WRITE_VAR2

IN’0.0.0.1’ OUT

.2

ADDM1

Also we can write the change values in animation table

To convert physical address to an array of 6

integers

Destination table in slave (TeSys U)

%MW(REG.120) to %MW(REG.139)

Table to write : %MW20 to %MW39

Type of objects to write : %MW

Page 38: Communication With Tesys u Modbus

Page 38 of 42 Jan 2008 www.systech-egypt.com

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

Page 39: Communication With Tesys u Modbus

Page 39 of 42 Jan 2008 www.systech-egypt.com

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 40: Communication With Tesys u Modbus

Page 40 of 42 Jan 2008 www.systech-egypt.com

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 41: Communication With Tesys u Modbus

Page 41 of 42 Jan 2008 www.systech-egypt.com

Now we are able to communicate with TeSys U over ETHERNET over PLC Note: And you can see all the above configuration and program which has been recorded with the attached CD

Page 42: Communication With Tesys u Modbus

Page 42 of 42 Jan 2008 www.systech-egypt.com

The document reference

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

Contact: [email protected] [email protected] [email protected] Tel: + (20) 2 22 606010