Abstract: This system uses a programmable logic controller (PLC) to achieve automatic control and remote monitoring of a gas-fired boiler. The boiler has a heating area of over 6,000 square meters and weighs over 20,000 tons. This paper studies the local system within a remote boiler monitoring system. An analog acquisition module (RM416) is used to collect field data, which is then converted and input to the PLC. The PLC is connected to a personal computer, and the programmed control program is input into the PLC using STEP 7-MICRO/WIN32, thus realizing remote monitoring of the gas-fired boiler. Keywords: Programmable Logic Controller (PLC); Analog Acquisition Module; Remote Boiler Monitoring System 1 Introduction A PLC is a general-purpose industrial control device with a computer (microprocessor) as its core, and it is currently widely used in various fields of industrial production. The overall design scheme of the boiler room remote monitoring system uses a PLC to realize field data acquisition, communication, control, and fault alarm of the gas-fired boiler. To realize the control and communication functions of the PLC, the system uses a Siemens S7-200 PLC and a color LCD screen to achieve the goal of remote control. 2. PLC Working Process After a PLC is put into operation, its working process generally consists of three stages: input sampling, user program execution, and output refresh. Completion of these three stages is called one scan cycle. Throughout the entire operation, the PLC's central processing unit repeatedly executes these three stages at a certain scanning speed. As shown in Figure 1 [align=center] Figure 1 PLC Working Process[/align] 2.1 Input Sampling Stage In the input sampling stage, the PLC sequentially reads all input states and data in a scanning manner and stores them in the corresponding units in the input/output image area. After input sampling is completed, it proceeds to user program execution and output refresh. In these two stages, even if the input states and data change, the states and data of the corresponding units in the input/output image area will not change. Therefore, if the input is a pulse signal, the width of the pulse signal must be greater than one scan cycle to ensure that the input can be read under any circumstances. 2.2 User Execution Stage In the user execution stage, the PLC's central processing unit always scans the user program (ladder diagram) sequentially from top to bottom. When scanning each ladder diagram, the control circuit consisting of contacts on the left side of the ladder diagram is always scanned first. Logical operations are performed on the control circuit consisting of contacts in a left-to-right, top-to-bottom order. Based on the result of the logical operation, the corresponding state of the logic coil in the system RAM storage area is refreshed, or the corresponding state of the output coil in the output image area is refreshed; or it is decided whether to execute the special function instruction specified by the ladder diagram. 2.3 Output Refresh Stage After the user program scan is completed, the PLC enters the output refresh stage. During this period, the central processing unit refreshes all output latch circuits according to the corresponding states and data in the input and output image areas, and then drives the corresponding peripherals through the output circuits. Only then does the PLC truly output. Generally speaking, the PLC scan cycle includes three stages: input sampling, user program execution, and output refresh. Strictly speaking, the scan cycle should also include self-diagnosis, communication, etc., as shown in Figure 2. One scan cycle equals the sum of all times for self-diagnosis, communication, input sampling, user program execution, and output refresh. [align=center]Figure 2 PLC Scan Cycle[/align] 3 Remote Boiler Monitoring System The remote monitoring system mainly consists of an industrial control computer and configuration software. It is used to receive acquisition signals, parameter settings, and data display sent by the local system. The DPN dedicated line communication baud rate is 9600, supporting the V24 communication protocol. A DPN dedicated line modem is used for device communication. The local system consists of a PLC variable program controller and an analog quantity acquisition module. The entire system structure is shown in Figure 3. [align=center]Figure 3 Remote Boiler Monitoring System[/align] 3.1 Field Data Acquisition Field data includes analog quantities and input/output switch quantities. The main analog quantities are boiler outlet water temperature, boiler flue gas temperature, boiler outlet water pressure, system outlet water pressure, system outlet water temperature, system return water temperature, system return water pressure, system outlet water heat and flow rate, system outlet water flow rate, and steam flow rate. The input switch quantities in the field data include the operating status of the No. 1 system circulating pump, the No. 2 system circulating pump, the No. 1 system makeup water pump, the No. 2 system makeup water pump, the burner operating status, the burner alarm, the softened water tank high level, the softened water tank low level, the expansion tank low level, the expansion tank high level, and the gas alarm. The output switch quantities include the operating status of the No. 1 system circulating pump, the No. 2 system circulating pump, the No. 1 system makeup water pump, the No. 2 system makeup water pump, the burner start, and the system alarm. The system alarm conditions include circulating pump failure, makeup water pump failure, burner failure, and gas leakage. The LCD touchscreen display has a baud rate of 9600, 8-bit unchecked, and an RS232 communication port. Parameters set on the LCD screen can be actively sent to the PLC programmable controller, and the LCD screen can also receive collected data transmitted by the PLC. The data sent by the LCD touchscreen to the PLC programmable controller mainly includes the ESC (ASCII code) introductory character, boiler number, date and time, upper and lower limits of boiler outlet water temperature, upper and lower limits of boiler outlet water pressure, upper and lower limits of boiler return water pressure, timer switch, and rest day selection. The data received by the LCD touchscreen from the PLC programmable controller includes boiler outlet water temperature, boiler flue gas temperature, boiler outlet water pressure, boiler return water temperature, system return water temperature, system return water pressure, system outlet water heat and flow rate, system makeup water flow rate, gas flow rate, outdoor temperature, and pump operating status. The local system's analog and digital inputs and outputs are also included. 3.2 Control Program This program aims to achieve certain control requirements, with communication being the main challenge. The basic idea is that when the rising edge of a one-second pulse arrives, the PLC sends a read command to the analog acquisition module RM416, then receives the data transmitted from RM416 and processes it. When the falling edge arrives, the PLC sends data to the touchscreen. After receiving the information, if the touchscreen makes any changes, it sends the modified data stream back to the PLC. During data processing, analog signals are converted to digital signals in the range of 0-0FFFF (0-4095), corresponding to 0-20mA, but the actual requirement is 4-20mA, so a conversion of the corresponding values is necessary. Because multiplication and division operations are required, and these can only be performed using double integers, number system conversion is also necessary. During communication, data is sent to the touchscreen when a falling edge arrives, and the touchscreen then returns the information. Since the touchscreen sends information randomly, the PLC will wait indefinitely if it doesn't receive data. However, if communication between the PLC and RM416 occurs when a rising edge arrives, and the PLC sends data to the touchscreen whenever a falling edge arrives, this causes a communication conflict, so the receiving function must be terminated in a timely manner. This system uses an information timer to avoid communication conflicts. In the control of the water pump and motor via the PLC output terminals, the PLC monitors the operating status of each part of the boiler in real time based on the status of each input switch quantity and the magnitude of the converted digital value of the input analog signal. 4. Summary This project uses a PLC to control boiler operation and communicate with a touch screen. During the programming process, to achieve optimal boiler control, multiple debugging and improvements were made. Under the premise of meeting the design task indicators, the program runs normally and achieves the predetermined control requirements. Communication conflicts were also encountered during this process, which were satisfactorily resolved through repeated modifications, debugging, and the use of an information timer. A significant finding during program development and operation was that the same set of ladder diagrams, arranged in different orders, yields different execution results. This should be considered when programming. Furthermore, the results of scanning the user program differ from the results of parallel operation of the hard logic of the relay control device. This should be noted in practical applications. If the scanning cycle time is negligible for the overall operation, then there is no difference between the two. The innovation of this paper is: using a PLC to realize remote control of the boiler room and its successful application in practice. References: 1. Programmable Logic Controller Principles, Applications, and Networks, China Science and Technology Press; 2. Gao Junling. Implementation of a PLC-based Interlocking Alarm Control System for Nitric Acid Production [J]. Microcomputer Information, 2003, 5