1. Introduction

Intelligent control instrument is one of the most commonly used controllers in industrial control, which mainly aims at a specific parameter (such as pressure, temperature, flow, etc.) and adopts advanced control algorithm (such as PID, adaptive PID, fuzzy logic, etc.) to achieve the purpose of precise control of controlled parameters. It has the characteristics of strong professionalism, high intelligence, advanced control algorithm, easy to use, etc. Programmable logic controller (PLC) is widely used in industrial control because of its reliable operation, high integration and strong expansibility. Nowadays, with the great development of fieldbus technology, the fieldbus produced by the major PLC manufacturers in the world are also different. At present, there are more than 10 popular fieldbus protocols in the world; However, because these instruments only support serial communication protocol, it is difficult to transfer the data of intelligent control instruments into PLC through fieldbus. For this reason, German heyouxun company launched the nettap series general gateway, which supports the conversion of various fieldbus protocols from station to serial port. Next we use PROFIBUS-DP from the station to the ASCII protocol conversion to illustrate.

2. The structure and implementation of communication system

2.1 system configuration

The 315-2 DP CPU of Siemens company is a DP master, and the bus address is set to 2; Nettap gateway of Hilscher company is used as PROFIBUS-DP slave station, and the bus address is set to 3; We use 2416 instruments (4 pieces) of EUROTHERM company which are widely used at present. The system configuration diagram is as follows:

The conversion of fieldbus protocol from station to serial port is realized by using nettap series general gateway

Figure 1: system configuration diagram

2.2 parameter setting of nettap gateway

There is a kind of nt30-dps gateway supporting PROFIBUS-DP slave station to Modbus RTU or ASCII or 3964R protocol conversion in nettap series gateway. As long as different firmware is loaded, the conversion between PROFIBUS-DP and corresponding protocol can be realized. Here we choose PROFIBUS-DP slave to ASCII protocol. After selection, download the firmware to the gateway.

The gateway should be configured as follows:

2.2.1 ASCII (other parameters are set by default)

The conversion of fieldbus protocol from station to serial port is realized by using nettap series general gateway

Table 1: setting of ASCII related parameters

2.2.2 modules

The conversion of fieldbus protocol from station to serial port is realized by using nettap series general gateway

Table 2: setting of parameters related to modules

After the parameter configuration is completed, the configuration information is also downloaded to the gateway.

2.3 communication parameter setting of 2416 instrument

Refer to the communication Manual of euro2000 series instruments to set the communication parameters.

2416 instrument supports two communication protocols: Modbus protocol and ei-bisynch protocol. We choose Modbus protocol for communication. According to the configuration information already configured in the gateway, the communication parameters of the four instruments are set as follows: the addresses are 1-4 in turn; Baud rate is 9600; 8 data bits; 1 stop bit; Even check; Other parameters use default values( Please refer to the instrument operation manual for relevant operation.)

2.4 configuration and programming in DP master station

Open step 7 programming software, install the GSD file of nt3-dps into step, and then configure nt30-dps through GSD file, as shown in Figure 2.

The conversion of fieldbus protocol from station to serial port is realized by using nettap series general gateway

Figure 2: configuration of gateway in master station

After configuration, compile and save.

Next, we will write the code, because we need to use CRC test, so we need to write a CRC test program; Please refer to the communication Manual of 2000 series instruments for specific code writing. In the program, we write a function FC and a data block db3 for storing data. In db3, we build an array with element type byte and length 32.

When reading instrument data, we adopt the method of reading n words. The command format is shown in Figure 3

The conversion of fieldbus protocol from station to serial port is realized by using nettap series general gateway

Figure 3: command format for reading n words

The format of the returned response information is shown in Figure 4

The conversion of fieldbus protocol from station to serial port is realized by using nettap series general gateway

Figure 4: response information format of read n-word command

The data we need to read are PV value, Op value and SP value of the instrument. According to the communication manual, their MODBUS parameter addresses are 1, 3 and 2 respectively. Therefore, the command to read these three values should be (for example, the instrument with MODBUS address 1): 01030001003crc. In the returned data, we can get the values of PV, SP and Op.

In the input and output image area of PROFIBUS, the first byte (pqb256 and pib256 in this example) is used to control and monitor the communication status

The following is part of the step code:

The conversion of fieldbus protocol from station to serial port is realized by using nettap series general gateway

Set mb20 to 1; Read the data of the instrument with MODBUS address 1. According to the above reply format, we know that piw261 is the PV value of the instrument in the returned data; Piw263 is the SP value of the instrument; Piw265 is the op value of the instrument. In the variable table for monitoring and comparison with the instrument, we found that the value is correct.

To communicate with multiple instruments, we only need to change the value of mb20 through the program, so we can send the station address of the corresponding instrument to mb20 every 100ms. After the data returns, we can send the station address of the next instrument to mb20 until the last one, and then start from the first instrument again. Because the returned data contains the station address information, we only need to send the data to the corresponding storage area according to the station address. Of course, we can also write to the instrument. We need to pay attention to the control of read-write conversion.

3. Concluding remarks

We will face the reality of multiple network protocols coexisting for quite some time in the future, so the network components used for protocol conversion function will play an important role in the future automation system. With a variety of network interface automation equipment is bound to have a stronger market competitiveness. As a general protocol gateway, nettap supports the conversion of multiple protocols. It has been applied in many occasions and will have a broad market prospect in the future.

Editor in charge: GT

Leave a Reply

Your email address will not be published. Required fields are marked *