How to realize Siemens S7
-- Application of Shanghai Sibo automation MODBUS to PROFIBUS DP switch
Abstract: This paper introduces how to realize the mutual communication between Siemens s series PLC and Yokogawa CS3000 DCS distributed control system, the application of Shanghai Sibo automation MODBUS to PROFIBUS DP switch pm-160, and the communication mode of these two different communication protocols
key words: Modbus protocol PROFIBUS DP protocol MODBUS to PROFIBUS DP serial port to PROFIBUS DP distributed control system communication network
I. Introduction
the rapid development of modern industry continues to promote the development of automation control technology and equipment communication technology innovation. At present, PLC, DCS and intelligent instruments have been widely used in the field production control system, and have developed into a distributed industrial control system that cooperates with each other and faces the whole production process. In this system, fieldbus communication technology is very important. This paper introduces the application of Modbus to PROFIBUS DP protocol switching device of Shanghai Sibo automation for the distributed control system project of a water conservancy station
II. System composition
1. System structure
the system composition is shown in Figure 1, in which other field level control equipment other than Siemens SPLC is omitted. The upper computer of the system adopts Yokogawa CS3000 DCS distributed control system to realize the centralized monitoring of the whole water conservancy project. One of the lower computers adopts Siemens s series PLC to realize the execution of various intelligent instruments on site, including on-site motors, intelligent switches, frequency converters, sensors, start and stop control of detection equipment, information acquisition and other operations. Horizontal
in the system structure shown in the above figure, various intelligent instruments on site (using Modbus protocol or various non-standard protocols, with RS485, RS422 or RS232 interfaces) can be connected to Siemens SPLC through Shanghai Sibo automation's general serial port (modbus/rs485/rs422/rs232) to PROFIBUS DP switch pm-160. At this time, the protocol type of pm-160 on the serial port side is MODBUS master station or general mode. Yokogawa DCS' data acquisition and monitoring of Siemens SPLC also need to use the universal serial port (modbus/rs485/rs422/rs232) of Shanghai Sibo automation to switch to PROFIBUS DP to turn off pm-160. At this time, the protocol type of turning off pm-160 on the serial port side is MODBUS slave
2. Composition of communication network
2.1 introduction to PROFIBUS protocol
profibus is one of the universal fieldbus standards in the world at present. With its unique technical characteristics, strict certification specifications, open standards, the support of many manufacturers and the continuous development of application rules, it has become the most important and widely used fieldbus standard
profibus fieldbus communication protocol includes three main parts:
profibus DP: a round robin communication mode is adopted between master station and slave station, which is mainly used for unit level and field level communication in automation system
profibus PA: power supply and communication data are transmitted in parallel through the bus, which is mainly used for unit level and field level communication in process automation system
profibus FMS: defines the communication model between the master station and the master station, which is mainly used for system level and workshop level process data exchange in the automation system
among them, PROFIBUS-DP is a high-speed network with a communication rate of 12m. PROFIBUS-DP can connect remote i/o, actuator, intelligent motor controller, human-machine interface HMI, valve positioner, frequency converter, which will make the manufacturing of aircraft wings and car bodies faster, more environmentally friendly and more cost-effective and other intelligent devices. A PROFIBUS-DP bus can connect up to 123 slave devices. The topology of PROFIBUS-DP can be bus type, star type and tree type. The communication medium can be shielded twisted pair, optical fiber, and also support infrared transmission. When twisted pair is used, the longest communication distance without repeaters can reach 1.2 kilometers, and the longest communication distance can reach 9 kilometers with 9 repeaters at most. When optical fiber is used, the farthest communication distance can reach more than 100 kilometers. When multi-film optical fiber is used, the farthest distance between two points can reach 3 kilometers. When single film optical fiber is used, the farthest distance between two points can reach 3 kilometers
2.2 introduction to Modbus protocol
modbus protocol is a master-slave serial port communication protocol suitable for the field of industrial control. It uses query communication mode to transmit information from master-slave devices, and can address device address ranges. The protocol includes two ways: Broadcast query and individual device query. The difference between the two is that broadcast query does not require the slave device to respond to information. The master and slave device query communication process is shown in figure 2:
modbus protocol common function codes are shown in Figure 3:
modbus protocol has two transmission modes: ASCII mode and RTU mode. At the same baud rate, RTU mode can transmit more data than ASCII mode, so most industrial networks use RTU mode. The format of information transmission message in RTU mode is shown in figure 4:
it has no start bit and stop bit, but at least 3.5 character interval is used as the start and end mark of information. All character bits of the information frame are composed of hexadecimal characters and a-f
modbus RTU communication protocol frame structure:
modbus RTU mode master station reads slave station register data example: master device query
modbus type 3 is to extract vanadium from petroleum residues and vanadium containing waste catalysts. RTU mode master station reads slave station register data example: slave device response
2.3 network composition and hardware introduction
as shown in Figure 1, in the system design, two networks use the Modbus to PROFIBUS DP switch pm-160 of Shanghai Sibo automation. The functions of the switch in these two networks are different, among which:
in the upper network (establishing the connection communication between Siemens SPLC and Yokogawa DCS), the Modbus to PROFIBUS DP switch pm-160 is a MODBUS slave on the Modbus side, and a slave on the Profibus DP side, establishing the communication between the Profibus DP master (Siemens s PLC) and the Modbus master (Yokogawa CS3000). The DCS communication part adopts the communication module with Yokogawa model alr121 and the Modbus communication software package provided by Yokogawa. The maximum communication data capacity of this communication module is 4000 words. Through the relevant configuration software of Shanghai Sibo automation, the pm-160 is configured to convert and store the read and write instructions and data of DCS, and map them to the input and output image area of Siemens PLC, so as to realize the real-time transmission of non-ferrous metal export value of 77.2 billion US dollars to the upper and lower computer control information
in the lower network (establish the connection communication between Siemens SPLC and field intelligent instruments), the Modbus to PROFIBUS DP switch pm-160 is used as the Modbus master station on the Modbus side, and the Profibus DP side is used as the slave station, and the communication between MODBUS slave stations (various field intelligent instruments (field motors, intelligent switches, frequency converters, sensors, etc.) and PROFIBUS DP master station (Siemens SPLC) is established. The serial port network (field intelligent instrument) device interface is RS485 or RS232, which can realize the connection communication with Siemens SPLC through Shanghai Sibo automation's MODBUS to PROFIBUS DP switch pm-160. Among them, the pm-160 is configured by using the related configuration software, and the slave station equipment information that needs to be collected is mapped to the input and output mapping area of Siemens PLC through the read and write commands, data conversion and storage, so as to realize the PLC's collection and monitoring of field intelligent instrument data
III. configuration of Modbus to PROFIBUS DP switch pm-160
pm-160 is a general-purpose protocol conversion switch from modbus/rs485/rs422/rs232 to PROFIBUS DP. A mapping data area from modbus/rs485/rs422/rs232 to PROFIBUS DP is established in the switch ram, and the protocol conversion and data exchange from modbus/rs485/rs422/rs232 to PROFIBUS DP are realized by software. All devices with rs485/422/232 interface (Modbus protocol or non-standard protocol) can be interconnected with fieldbus PROFIBUS DP through pm-160. Among them, pm-160 acts as a PROFIBUS DP slave when communicating with PROFIBUS DP. Pm-160 can act as a MODBUS master and MODBUS slave when communicating with serial port devices, and also supports transparent data transmission with non-standard serial port devices. By registering the GSD file of pm-160 in Siemens STEP7, you can configure the relevant hardware and software of the switch in the programming software and complete the corresponding communication functions. Please refer to the following detailed hardware and software configuration methods:
1. The hardware configuration of pm-160 when MODBUS to PROFIBUS DP is switched off
the address of PROFIBUS DP slave station of pm-160 can be set through the off hardware rotary switch or configuration button. The rotary code switch has two bits. The left bit sets the high position (ten bits) of the address, and the right bit sets the low position (ten bits) of the address. The off pm-160 can be set to be in the normal operation state or configuration state through the dial switch. When pm-160 is in the configuration state, the user can set relevant read-write commands and parameters through the supporting configuration software
pm-160 comes with a standard PROFIBUS DP interface, which can be connected to the Profibus DP field bus by using standard PROFIBUS DP connector and standard PROFIBUS DP cable
pm-160 provides rs485/422/232 serial ports. MODBUS slave station, master station equipment and user non-standard serial port equipment can realize the connection and communication with pm-160 through these three interfaces. Pm-160 has no built-in terminal resistance. When RS485 communication is carried out, please note that a terminal resistance (120 ohms) is added to each RS485 bus terminal
2. Software configuration of pm-160 from MODBUS to PROFIBUS DP
1) use the supporting software to set the on-site total new and sub related parameters and commands of pm-160
set pm-160 to the configuration state through the dial switch, and open the installed configuration software (product CD or access):
when PLC and DCS communication is realized, the sub protocol type is set to MODBUS slave, and set the serial communication baud rate, data bits, parity bits Stop bit, pm-160 as the address and communication interface of Modbus slave. Among them, the settings of serial port communication baud rate, data bit, parity bit and stop bit should be consistent with the connected MODBUS master station equipment (DCS)
figure 8 pm-160 acts as a MODBUS slave on the Modbus side (connecting PLC and DCS)
when realizing the communication between PLC and MODBUS equipment, the sub protocol type is set as MODBUS master, and the serial port communication parameters, communication transmission mode, communication interface, etc. are set. Among them, the setting of serial port communication parameters should be consistent with the connected MODBUS slave device:
Figure 9 pm-160 acts as a MODBUS master on the Modbus side (connecting PLC and MODBUS slave)
among them, "node-1" in Figure 9 indicates that the address of the connected slave device is 1, and two commands "read holding registers" and "preset multiple registers" are configured, indicating that the data of the corresponding address of the slave is read, And it can output data to the Modbus slave device. The command configuration method is as follows:
MODBUS register start address: the user inputs the demand difference of the target collected data MODBUS register start address
number of data: number of registers or coils of target data
starting address of memory mapping: the corresponding memory buffer address of Modbus slave device data
when realizing the communication between PLC and non-standard protocol equipment, the sub protocol type is set to general mode, and the serial port communication parameters, control mode, communication interface, etc. are set. Among them, the setting of serial port communication parameters should be consistent with the connected non-standard serial port equipment (field intelligent instrument): the general mode supported by pm-160 is transparent transmission mode. Users can judge the data integrity and whether it is a new frame of data through the data length and transaction sequence number in the data
2) configure the off M-160 in STEP7
in the hardware configuration interface of STEP7, lead to
LINK
Copyright © 2011 JIN SHI