Modbus/-DP Gateway PM-120

User Manual

REV2.0

Shanghai Sibotech Co.,Ltd

Hotline: +86- 21- 5102- 8348 E-mail:[email protected]

Catalog

1. FOREWORD...... 3

1.1 ABOUT INSTRUCTION...... 3 1.2 COPYRIGHT INFORMATION ...... 3 1.3 RELATED PRODUCT...... 3 1.4 TERMINOLOGY ...... 3 2. PRODUCT OVERVIEW...... 3

2.1 PRODUCT FUNCTION ...... 3 2.2 PRODUCT FEATURE...... 3 2.3 TECHNICAL SPECIFICATION...... 4 2.4 EMC PERFORMANCE...... 5 2.4.1 High-frequency interference test( GB/T15153.1 classⅢ )...... 5 2.4.2 Fast Transient Pulse Group Test(GB/T17626.4 classⅢ )...... 5 2.4.3 Electrostatic Discharge Interference(GB/T 17626.2 classⅢ )...... 5 2.4.4 Radiation EMF(GB/T 17626.3 classⅢ )...... 6

3. PRODUCT APPEARANCE ...... 6

3.1 PRODUCT APPEARANCE...... 6 3.2 LED...... 6 3.3 CONFIGURATION SWITCH...... 7 3.4 COMMUNICATION PORT ...... 7 3.4.1RS-485 Port...... 7 3.4.2 PROFIBUS-DP Port ...... 9 4. HOW TO USE...... 9

4.1 QUICK APPLICATION GUIDE...... 9 4.2 HARDWARE WIRE ...... 9 4.3 SOFTWARE CONFIGURATION...... 10 4.4 RUN ...... 10 4.4.1. SETTING WINDOWS HYPERTERMINAL...... 11 4.4.2. MAIN MENU...... 11 4.4.3. MODBUS PARAMETERS CONFIGURATION...... 12 4.4.4. MODBUS COMMAND LIST CONFIGURATION ...... 13 4.4.5. DISPLAY MODBUS COMMAND LIST...... 17 4.5.6. EXIT THE CONFIGURATION...... 18 5. INSTALLATION...... 18

5.1 MECHANICAL SIZE ...... 18 5.2 INSTALLATION...... 18 6. OPERATION MAINTENANCE AND ATTENTION ...... 19

www.sibotech.net 1

APPENDIX A:USE STEP 7 TO SET PROFIBUS-DP ...... 20

APPENDIX B: MODBUS COMMUNICATION ...... 28

INTRODUCTION ...... 28 MODBUS RTU ...... 28 MODBUS COMMANDS...... 28

www.sibotech.net 2

1. Foreword

1.1 About Instruction

This instruction describes the gateway’s parameters, special use and notes, which make it easy to use for engineering. Please read the instruction carefully before you begin to use the gateway. 1.2 Copyright Information

The data and case in the instruction can not be copied without authorization. Sibotech Company has the right to modify the version of products in development process. is the registered trademark of Shanghai Sibotech Automation Co.,Ltd. The product has a lot of application, the users must certain all steps and results meet the corresponding occasions security, including of legal aspects, regulations, codes and standards. 1.3 Related Product

Other related products in our company: PM120S,PM-122,PM-120T and so on. If you want to gain above several products’ instructions, please visit our web station www.sibotech.net, or call to support hotline: +86-21-5102-8348 1.4 Terminology

PROFIBUS-DP:PROFIBUS-DP Protocol RS485:One kind of serial hardware standard PM120:Serial/PROFIBUS-DP converter RS-25:RS232/RS485 converter 2. Product Overview

2.1 Product Function

PM-120 achieves the data communication between serial and PROFIBUS-DP. It can connect several devices with RS485/Modbus interfaces to PROFIBUS-DP. The gateway can link RS485/Modbus to PROFIBUS-DP. 2.2 Product Feature

▼Widely used: Any field devices with RS485 interface and instruments equipped with interface of

www.sibotech.net 3

can be interlinked with PROFIBUS via this product, for example: frequency converter, motor controller, power measurement devices, transformers, intelligent field measurement instruments and devices etc. ▼Easy implementation: Refer to the manual and the examples provided; Users can connect to PROFIBUS DP quickly. ▼Transparent communication:User can accord the concern between PROFIBUS communication data area and Modbus communication data area, to achieve the transparent communication between PROFIBUS and Modbus.

2.3 Technical Specification

[1]PM-120 has PROFIBUS-DP slave station interface function; Interface achieve the transparent data communication by the data mapping between PROFIBUS data communications district and Modbus data communication district. [2] PM-120 has the Modbus master station interface function. It supports several function codes. These codes include of 01H、02H、03H、04H、05H、06H、0FH、10H;The max command number is 48;

[3] PROFIBUS-DP/V0 protocol; JB/T 10308.3-2001: The chapter 3 of measurement and control of digital data communications Industrial Control System:PROFIBUS standard;

[4] PROFIBUS-DP slave station, self-adaptive baud rate. Baud rate up to max. 12M; [5] PROFIBUS Input/Output bytes can be configured variously, the max input/output: ①Max Input Bytes ≤112 Bytes ②Max Output Bytes ≤112 Bytes

[6] Modbus protocol interface is RS-485 interface, half duplex;Baudrate:2400、4800、9600、19.2K、 38.4K、57.6Kbps;Parity mode: none, even, odd, mark, space.

[7] Power supply:24VDC(11V-30V),140mA

[8] Temperature of working environment:55℃, humidity<95% [9] Peripheral measurement:(width)42.5mm×(height)91mm×110mm(depth) [10] Installation:35mm rail [11] Protection Level: IP20

www.sibotech.net 4

2.4 EMC Performance

2.4.1 High-frequency interference test( GB/T15153.1 classⅢ )

Power input circuit –For GND

Between Power input Impose places circuit

AC input circuit –For GND The high value of first wave 2.5~3kV Oscillation frequency 1.0~1.5MHz 1/2 Decay Time Waveform imposed Repetition frequency ≥6μs

Test Equipment Output >50 times/s impedance 150~200Ω

2.4.2 Fast Transient Pulse Group Test(GB/T17626.4 classⅢ )

Power input and exchange join to the circuit:2kV Peak voltage Weak circuit:1kV

Repetition frequency 5 kHz

2.4.3 Electrostatic Discharge Interference(GB/T 17626.2 classⅢ )

Impose places When used usually, the part of touch by operator

6kV Contact discharge,the first peak current Voltage, current Of discharge is 22.5A Times >10 times every 1s

Polarity Positive

www.sibotech.net 5

2.4.4 Radiation EMF(GB/T 17626.3 classⅢ )

Radio frequency 150MHz, 400MHz, 900MHz

Test Magnetic Field 10 V/m Strength Make the front of antenna to touch the device, or Radiation Way close terminal, intermittent radiation waves 3. Product Appearance

3.1 Product Appearance PROFIBUS-DP Port

PROFIBUS address configuration and run/configure switch RS-485 Port and Power Supply

Figure 1 Product Appearance

3.2 LED

LED Status Meaning PROFIBUS-DP field Green LED Flash has data STA communication No data Green LED Light On communication Failure Red LED Light On PROFIBUS-DP PBF communication Normal data Red LED Light Off communication

www.sibotech.net 6

Serial is receiving Red LED Flash data RX Serial is not Red LED Light On receiving data Green LED Flash Serial is sending data TX Serial is not sending Green LED Light Off data

3.3 Configuration Switch

PROFIBUS-DP address code switch:

On

Off 1 2 3 4 5 6 7 8

Figure 2 Dial code Switch

1-7 bit PROFIBUS address code is the binary encoding from low to high(On is 1,Off is 0) Notes: The 7th bit is the highest bit of PROFIBUS address, the first bit is the lowest bit of PROFIBUS address. The high address to low address is arrayed from right to left. The 8th bit is the configuration switch, 1 means the configuration status, 0 means the running status.

3.4 Communication Port 3.4.1RS-485 Port

PM120’s RS485 interface is the standard RS-485 interface, the following content is the features:

⑴RS-485 Communication Technology Basic Feature

① Network Topology: Linear Bus, both of the ports have the active bus terminal resistance; ② Communication baud rate: 1200 bit/s~115.2Kbit/s; ③ Media: Shielded twisted pair cable,also can cancel shield, it is decided by condition (EMC); ④ Station Number: 32 stations in every bus (no-extender), the max is 127 stations (with extender);

www.sibotech.net 7

⑤ Connect:5 pin pluggable terminal

⑵ RS-485 Communication Device Installation Key

① All devices should connect with RS-485 Bus; ② The max station number in every field bus is 32; ③ Both of the field bus terminal has one bus terminal resistor, 120Ω 1/2W .They can ensure the bus run reliable. Serial interface use opening 5 pin pluggable port, user can wire according to the instruction in the panel.

V+

B-

Shield

A+

GND

Pin Function 1 GND 2 A+,RS485 3 Shield 4 B-,RS485 5 V+

www.sibotech.net 8

3.4.2 PROFIBUS-DP Port

DB9 PROFI-A

6 9

15

PROFI-B GND

Pin Function 3 PROFI_B,Positive 5 GND 8 PROFI_A,Negative

4. How to use

4.1 Quick Application Guide

Use the following steps to apply your PM120: 1.Link the MODBUS port (RS485)of PM120 to PC’s COM port, because the COM port in PC is RS232 port, so you to use RS232/485 converter(such as RS-25).

2.Set the 8th code switch to ON, make the module into configuration mode, user can use Windows Hyperterminal to configure Modbus scan list and MODBUS/PROFIBUS data mapping. More detail can be gained from Chapter 4.

3.Configure the code switch in side of the module, you can set the PROFIBUS address.

4.Input the GSD file to the PROFIBUS configuration software.

5.Cofigure your PM-120 in the PROFIBUS configuration software, map the PM120’s I/O data to the memory of PLC or other devices.

Notes : You need to use an RS232/485 converter when you begin to configure the PM120(Because PC’s port is RS232 standard, Modbus port is RS485 standard).

4.2 Hardware Wire

1. According to the instruction about RS485 port in the third chapter, connect every pin of the 5 pin terminal, pay attention not to power it on at this time. www.sibotech.net 9

2. According to the instruction about PROFIBUS-DP port in the third chapter, connect at least three pins include of 3, 5, 8. 3. Check the wire whether it is the same as the reference content in the instruction. 4. Power on the module, if the eighth bit of the code switch is 0,it will go into run status, if the dial switch is 1,it will go into configuration status.

4.3 Software Configuration

User can link the gateway to PC by RS232/485 converter. By using GT-1-2-3, user can configure the gateway. Dial the 8th bit to ON, restart the gateway to make it go into configuration mode. More detail can be got from software configuration instruction. 4.4 Run

Working Principle: The data converter between Modbus and PROFIBUS can be made by “mapping”. There are two data buffers in gateway, one is PROFIBUS Network Input Buffer, the other is PROFIBUS Network output buffer. Modbus read command writes data which has been read from devices into Network Input Buffer. These data will be read by PROFIBUS Network. Modbus write command reads data which has been written from Network Output Buffer. These data will be output by write command.

Input Buffer Output Buffer

Modbus Modbus Device 5 Device 3

Modbus Modbus Device 4 Device 6

Figure 2 User can configure 48 commands, each command can use one Modbus command to read a serial of continuous Modbus register. User can configure the mapping concern in configuration mode by themselves.RS232/485 interface can used to connect the gateway and PC. By using the Hyper-Terminal software of Windows, the gateway can be configured. Dial the eighth switch to ON, restart the gateway, then it will go into configuration mode immediately.

www.sibotech.net 10

4.4.1. Setting Windows HyperTerminal

You can find the Hyper-Terminal in “Windows—Start—All programs—Accessories— Communications—Hyper-Terminal.” The configuration tool uses 19200-8-N-1 Mode.

4.4.2. Modbus Main Menu

After setting the Hyper-Terminal, make the module power on, the main menu will display. As the following picture shows:

Figure 3 Main Menu Item(1)and(2) can be used to configure Modbus parameters: (1) Configure Modbus parameters. (2) Configure Modbus scan command list. Item(3)and(4) can be used to configure Modbus communication: www.sibotech.net 11

(3) Display Modbus parameters. (4) Display Modbus scan command list.

4.4.3. Modbus Parameters Configuration

Input”1” in the main menu, display the content as the figure 4:

Figure 4 configure Modbus parameters Item(1) Change master station address. can set Modbus master station address, the range is 0-247. Item(2) Change communication baudrate. can modify Modbus communication baud rate, user can set it from the following items:(0) 1200 (1) 2400 (2) 4800 (3) 9600 (4) 19200 (5) 38400 (6) 57600. Item(3) Change parity mode. can set the parity mode. Item(4) Change command list number. can set the number of being used commands. Item(5) Select ASCII mode or RTU mode. can choose communication mode. Item(6) Change response timeout. can set response timeout.

www.sibotech.net 12

Item(7) Enable/Disable Output Polling. Can enable or disable polling* *Note: If you choose disable Output Polling, the system will use the Variable Output mode Variable Output means when the data which the PROFIBUS master station output has changed, the gateway’s Modbus port will output reference write command. If the gateway has received the right response, it will stop output this write command. If the gateway has not received the right response, it will output the command by polling mode until the right response has been received. When the variable output mode is used, the data buffers corresponding to Modbus write commands can not overlap. For example: Example 1:If the first Modbus write command corresponds to the bit 0 of the byte 1,then other write command can not correspond to the bit 0 of the byte 1,at the moment you can choose the bit1 of the byte1. Example 2:If Modbus write command correspond to byte 5 to byte 12,then other writer commands can not correspond to byte 5 to byte 12. User can input “3” in the main menu, and see the Modbus parameters have been set.

4.4.4. Modbus Command List Configuration

Talking with which Modbus device, using which command, reading/writing which registers are defined here. How Modbus I/O map to DeviceNet I/O is defined in each commands. If you are not familiar to Modbus, please refer to Modbus specification. Input”2” in the main menu, display the content as Figure 5:

www.sibotech.net 13

Figure 5 configure Modbus command

**************************************************** Configuration Modbus scan command list

MultiCom ****************************************************

(1) Add a new command. (2) Delete a command. (3) Verify configuration conflict of memory map. (4) Return to main menu.

Please input your selection: Select “1” to add a new command: You will see: www.sibotech.net 14

Maxim configurable command number is 48. New command No. is: 1

There are at most 48 commands that you can use. Each command can be defined to use one Modbus command to read/write a couple of registers of one device.

For example, you can define a command to read 10 register from 6 to 15 of Modbus node 5 as this way:

Please enter slave address (0-247): 5 Your enter is: 5

Press “3” then “Enter” mean read Modbus node address 3, you will see:

Please enter Function code (support FC is: 01;02;03;04;05;06;15;16): 3 Your enter is: 3

Select “3” means Modbus command with functional code 3, then you need to input start address of the registers:

Please enter Starting Address: 6 Your enter is: 6

Please enter Number of Regs (1-32): 10 Your enter is: 10

After that, you set the starting address of 6. And you will be asked to input number of register to read in this command immediately.

Select the number, here you input 10, Please enter data mapping address(1-159): Notes: Don't Map byte 0. It's for Modbus Status (1-159) Sugguest to Use[1] 2

Then is the data mapping to DeviceNet input. Modbus command 03 is an input command, so the data will be mapped to DeviceNet input. The maxim DeviceNet input bytes number is 128. You can choose the location 1-127. Please do NOT use the byte order zero. It is used to express the Modbus status, if 0, The Modbus is Ok, and otherwise, the Modbus data is meaningless. There is communication error occurred or even no Modbus device ongoing there. Usually your control system needs to know that. Now is the last parameter to set.

Please select scan cycle: (0) 50ms (1) 200ms (2) 1000ms Please enter your selection:0

www.sibotech.net 15

That means how much millisecond the gateway will send this read command once. Choose it in the range as indicated such as 50 (milliseconds).

You will see:

Create success! Press any key to continue...

Example 2: In the following we will give another example. In this example we will set a Modbus “BIT” operation command 15-Write Multiple Coils

Select: (1) Add a new command.

Then follow the wizard: (support FC is: 01;02;03;04;05;06;15;16): 15 Your enter is: 15

Please enter Coil Address: 25 Your enter is: 25

Please enter Quantity of Coils: 10 Your enter is: 10

Please enter source address:(0-111) 10 Your enter is: 10

Here you will see the difference with the register based Modbus function code: You gateway support bit mapping. You can only map the input or output coils to bits of the memory bytes.

Please enter bit offset (0-7): 2 Your enter is: 2

Please select scan cycle: (0) 50ms (1) 200ms (2) 1000ms

Please enter your selection:

www.sibotech.net 16

4.4.5. Display Modbus Command List

Now, if you want to know whether or not the right parameters are set, you can select

(4). Display Modbus scan command list.

In main menu, select 4, Then you will see:

Figure 6 Please input your selection

Then select 1:

Please input your selection: 1

The following information will be shown:

No. SlaA FC StarA No.P Bytes DA/SA Bits SC(ms) 1 5 3 6 10 2 200 2 50 15 25 10 2 10 2 1000

www.sibotech.net 17

Display end! Press any key to continue...

Every page can display 8 commands, press any key to display the next page, press ”Q” to exit.

4.5.6. Exit the configuration

Press”5” in the main menu, the module can exit the program immediately. User need to restart gateway,and make all configuration effective. 5. Installation

5.1 Mechanical Size

Size:42.5mm(wide)×91mm(high)×110mm(depth)

5.2 Installation

35mm DIN installation guide

www.sibotech.net 18

6. Operation Maintenance and Attention

— Module need prevent pressure to avoid the panel damage. — Module need prevent impact to avoid the internal devices damage. — Power voltage should be controlled in the suitable range referenced to the instruction to avoid the module burning damage. — Module need prevent water to avoid it work abnormal. — Please check the wire before power the module on, judge if it exist wrong wire or short circuit.

www.sibotech.net 19

Appendix A:Use STEP 7 to set PROFIBUS-DP

The following content explains how to use STEP7 to set PM120 First, copy *.gsd file to the following path:Step7\S7data\gsd\

1. Open SIMATIC Manager ;As the figure 1:

Figure 1

2. File->New, create a new file, as the figure 2:

Figure 2

www.sibotech.net 20

3. Insert->Station->SIMATIC 300 Station.,as the figure 3:

Figure 3

4. Open S7 PLC hardware configuration SIMATIC 300(1)->Hardware, double click; as the figure 4

图 5

www.sibotech.net 21

Figure 4 5. Choose Option→Update Catalog in the menu, refresh GSD in Device catalog

Figure 5

www.sibotech.net 22

6. You can find the devices registered, in right window/PROFIBUS-DP/Additional Field Devices/Converter/PD100S/,as the following picture:

Figure 6

www.sibotech.net 23

7. For setting PLC rack, double click “Hardware Catalog\SIMATIC 300\RACK-300\Rail”,as the figure 7 shows:

Figure 7

8. For setting CPU module, choose the corresponding device types and the slots occupied;

www.sibotech.net 24

9. Create PROFIBUS-DP network, set PROFIBUS-DP: New->Network settings, choose DP, choose a kind of baudrate as 187.5Kbps, then click “OK”. Double click it; as the figure 8

Figure 8

www.sibotech.net 25

10. Choose PROFIBUS Master station address, as figure 9:

Figure 9

www.sibotech.net 26

11. Configure PM120 to PROFIBUS Network, and map the I/O module to S7-300 or other controller’s memory. As the figure 10:

Move the data to the left and down table.

Figure 10

Use two steps, then first step is to move PM120 to the left and up area, network configuration, move to PROFIBUS-DP bus, the mouse will change sharp, it means you can move it in. The second step is to move data to left and down data mapping table, map to PLC memory.

Notes:PM-120 is configured by RS485 side, if user configure it to 48 bytes I/O, then move”48 Byte In, 48 Byte Out” to data mapping table. If the data area is not suitable to gateway, PROFIBUS-DP will not connect to the gateway. If there is not default bytes number configuration, the max pre-configuration is”112 Byte In, 112 Byte Out”.

Notes:Slave station’s address should set to the same number as module’s dial switch!

12. Compiler and download to PLC.

www.sibotech.net 27

Appendix B: Modbus Communication

Introduction

When configured for Modbus protocols, the Modbus/DeviceNet gateway supports Modbus RTU Mode. Some basic knowledge is very helpful, as to understand how to use the gateway for configuration of the Modbus network. The Modbus standard was developed by Modicon for communication between controllers and other devices. The transactions on the Modbus network are of master/slave type, and are named “query” and “response”. One single master sends the queries. All transactions on the network have got a frame structure where one part is common for both Modbus RTU and Modbus ASCII.

Modbus RTU

Each byte in the Modbus RTU message represents a hexadecimal value between 0 and 255. The frame looks exactly like the one mentioned earlier and there is always an interval of 3.5 silent characters between the frames. CRC (Cyclical Redundancy Check) is used for error checking. Multiple Modbus transactions would appear on the physical interface like this:

Modbus RTU Mode Transactions

Modbus commands

The following tables list all Modbus commands that are supported by the AB-C. For each command there is an explanation about what actions you as user need to take on the query and response. Code Name 01 Read Coil Status 02 Read Input Status 03 Read Holding Registers 04 Read Input Registers 05 Force Single Coil 06 Preset Single Register 07 Read Exception Status 11 Fetch Comm. Event Ctr 12 Fetch Comm. Event Log 15 Force Multiple Coils www.sibotech.net 28

16 Preset Multiple Registers 17 Report Slave ID 20 Read General Reference 21 Write General Reference 22 Mask Write 4X Register 23 Read/Write 4X Register 24 Read FIFO Queue

Table 1: Modbus Commands The Modbus bus Commands in Bold are used in our gateway.

Read Holding Registers [03] Query Starting Address 2 byte value where you enter the first address of the requested registers. No. of Points 2 byte value where you enter the number of registers to read. Response Byte Count 1 byte value where you enter the number of expected data bytes. Data Data object where you enter the length of the received data and the destination address.

Table 2: Read Holding Registers

Preset Single register [06] Query Data Data object with 4 bytes. The field bus master should enter Register Address and Preset Data in these four bytes. Response Data Data object with 4 bytes. The slave returns Register Address and Preset Data in these 4 bytes.

Table 3: Preset Single register

www.sibotech.net 29