Abstract: This paper summarizes the contents of communication protocols using a tabular method to address practical problems in industrial control systems. It discusses abnormal situations caused by blocking and interference and their handling methods, and provides the basic specifications and vertical description table of communication protocols for industrial control systems.
Keywords: Industrial control, communication protocol, description table
0. Introduction
Communication protocols are very important in industrial control systems [1]. Generally speaking, network protocols have 7 layers. The first part is implemented by hardware and is called the physical layer. The second part is implemented by the operating system and includes the link layer, network layer, and transport layer. The third part includes the session layer, presentation layer, and application layer, which are generally implemented in application software [2]. The so-called communication protocols in industrial control systems all refer to session protocols.
A well-designed communication protocol can significantly improve hardware operating efficiency, while accurate descriptions can enhance collaboration among programmers. The ability to design efficient communication protocols and describe them precisely is essential for every system analyst and software designer.
Based on years of experience designing industrial control systems, this article presents some descriptive methods for communication protocols in industrial control systems. It is hoped that these methods will be helpful to colleagues designing industrial control systems.
1. Basic Model of Industrial Control Systems
Figure 1. Signal transmission process of industrial control system
Generally speaking, industrial control systems involve four main parts: host computer, control cabinet, sensors and controllers. As shown in Figure 1, the host computer mainly refers to the computer, where the control system is installed. The control cabinet is the device that connects the computer, PLC (programmable controller), sensors and controllers, with the PLC being the main component. In fact, the PLC is also a computer. During measurement, its function is to convert the current or voltage signal sent by the sensor into a digital signal, called A/D conversion, and send these digital signals to the computer. During control, its function is to convert the digital signal sent by the computer into a current or voltage signal, called D/A conversion, and send these digital signals to the controller. Generally speaking, the PLC is the bridge between the computer and the sensors and controllers. The functions of the PLC are constantly being improved, and modern PLCs can completely replace computers. In most cases, people still need to run the control system on the computer, which requires communication between the PLC and the computer. The communication protocol we are talking about mainly refers to the communication protocol between the computer and the PLC [3] [4].
2. Client and Server
Network communication is always conducted in a client and server manner. The so-called server is always in a passive state, waiting for the client's inquiry and responsible for answering. The client is always in an active position. When starting up, the client always sends a communication signal to the server first and then waits for the server's reply. When designing a program, who is the client and who is the server depends on the specific situation. Generally speaking, the host computer is the client and the PLC is the server, providing various measurement data to the host computer and being responsible for transmitting control signals to the controller[5].
Industrial control data can be categorized into target values, setpoints, measured values, operating status, and valve positions, based on the vertical control interface. If categorized by network transmission method, it can be divided into: general operating data, parameters, commands, error messages, and messages, as shown in Table 1.
Table 1. Classification of Industrial Control Data Communication Read/Write Table
3. Data from network communication
Generally, network communication protocols primarily describe how clients interact with servers, so the following descriptions are always presented from the client's perspective. For the client, these include: ① requesting data, ② requesting parameters, ③ writing parameters, and ④ writing commands. Upon the server's response, the corresponding actions are: ⑤ reading data, ⑥ reading parameters, ⑦ reading error messages, and ⑧ reading messages. Please refer to Table 2 for the correspondence between these operations and their specific meanings.
The data transmission process must be completed jointly by the sender and the receiver. The sender collects the data, packages it, and then sends it. The receiver, upon receiving the data, unpacks it according to the protocol and distributes it to the appropriate locations.
A protocol is essentially a set of specifications. First and foremost, the receiving party must clearly understand which data stream it is, whether it's for reading or writing, and what its specific content is. To ensure accurate reception, the specific circumstances of industrial control systems, such as congestion and interference, must also be considered.
Table 2. Explanation of Read/Write Relationships for Industrial Control Data Communication
4. Blockage and Interference
Data transmission generally uses two formats: binary mode or text character mode. The methods for writing protocols differ significantly between these two drastically different formats. In binary mode, the space occupied by integers and floating-point numbers is independent of the value's magnitude. However, in text character mode, the range of values and the decimal point's position must be carefully considered. Generally, binary mode is much more efficient for data transmission, while text character mode offers stronger error correction capabilities and the obtained data can be directly displayed. In industrial control environments, text character mode is more commonly used due to the ease of implementing error correction methods.
Without considering blocking, the data block received by the receiver is exactly the same as the data block sent by the sender, and the start and end symbols are irrelevant. However, in industrial control environments, continuous and large-volume data transmission inevitably leads to blocking, and situations like the one shown in Figure 2 often occur. The receiver may not read the entire sequence sent by the sender at a particular time, but rather the latter half of the (n-1)th data block and the first half of the nth data block. Simply interpreting this sequentially will inevitably cause misunderstanding. The start and end symbols in Table 3 are used to overcome the offset of the starting bit value of the received data under blocking conditions. It should be noted that characters used in the start symbol should not be used elsewhere.
Figure 2. Data reception under blocked conditions
Furthermore, in industrial settings, the high-speed operation of numerous metal devices and electric motors inevitably leads to strong electromagnetic interference. Network data that transmits normally in a laboratory may malfunction in an industrial environment. Normal data can become unreliable. It is essential to eliminate data that has become unusable due to interference. The solution to this is to discard the data. Therefore, identifying erroneous data becomes crucial.
The purpose of a checksum is to let the receiver know whether the data it receives has been interfered with. A checksum consists of several characters placed at fixed positions within a data block, as shown in Table 3. These characters can be fixed characters, summations, or XOR operations. Fixed characters are easy to implement, but it's difficult to determine whether data in other positions has been interfered with. Summations or XOR operations are commonly used checksum methods. These methods typically convert the summation result into two hexadecimal text character codes, and these two hexadecimal values represent one byte of data.
5. Protocol Description Method
Table 3 shows the description method I commonly use when designing network session communication protocols, known as the vertical description method. The advantage of this method is that it allows for a detailed description of each field to be transmitted. Here, each field to be described is divided into five items: starting position, name, number of bytes, data type, and data content.
Table 3 Format of Industrial Control Data Communication Protocol
This is clearly a protocol suitable for text character descriptions, and binary protocols can also follow this approach. Since any position in a binary protocol can take any value, there are no start and end characters in a binary protocol.
6. Conclusion
The description in Table 3 above is mainly for serial communication, but it is also possible in an Ethernet environment. Generally speaking, error correction is performed at the transport layer. However, in an Ethernet environment, the transport layer protocol is handled by the operating system, such as the TCP protocol [3], and the error correction function is naturally included. Therefore, the checksum in Table 3 can be disregarded.
In serial communication mode, the operating system (Windows) only establishes a buffer for serial communication. Most of the transport layer functions need to be completed by the programmer, so the checksum in Table 3 is absolutely indispensable.
The above communication protocol design method has been widely used in papermaking process control systems in many places, such as Linqing in Shandong, Lipu in Guangxi, and Hetao in Inner Mongolia, with good results.
References
[1] Ji Yubo. Computer control system for papermaking system [J]. Microcomputer Information, 2000, 16(2): 26-27, 70.
[2] Lu Shiwen, ed. Computer Network Principles and Network Technology [M], Machinery Industry Press, 1996. 2-6, 296-316
[3] Wang Zhijian, Chen Songqiao, Cai Zixing, Peng Shiduo, Zhou Hao, Design of ABB Industrial Control System and External Computer Communication Software [J], Microcomputer Information, 1998, 14(2): 54-57
[4] Yang Wu, Tian Wei, Research on Communication Methods between Programmable Logic Controllers and Industrial Control Computers [J], Packaging Engineering, 1999, 20(4), 44-45
[5] Wang Cun, Constructing a Small Distributed Industrial Control System Using Serial Communication [J], Journal of Inner Mongolia University (Natural Science Edition), 2000, 31(4), 385-387
[6] Wang Siming, Communication between S5-115U PLC and Industrial Control Computer [J], Journal of Lanzhou Railway Institute, 1998, 17(4), 92-97