Share this

Design of a gas metering and calibration system based on PLC and KingSCADA

2026-04-06 06:57:56 · · #1
Abstract: This paper introduces a device based on a standard device, adding a transmission device, a bidirectional encoder, and a microcomputer to form an automatic metering and verification bell-type gas metering and verification device. The microcomputer processes the data collected by the bidirectional encoder and PLC, monitors the site in real time, measures the volume of gas entering and leaving the bell, automatically calculates and compares the test results, and automatically prints out the verification results. Keywords : PLC, KingSCADA software, bell-type gas metering and verification Keywords: PLC Kingview Software Clock cover Calculate Examine 1 Introduction The bell-type gas meter is a standard device for calibrating gas flow meters. It uses the effective volume inside the bell as the standard volume. When the bell descends, the gas discharged from the bell passes through the test pipe to the meter under test. The volume of gas discharged from the bell is compared with the volume of gas indicated by the meter under test to determine the accuracy of the meter. The bell-type gas metering verification system has three main working modes: (1) manual detection, direct reading; (2) semi-automatic detection (equipped with a flow totalizer); (3) fully automatic detection (computer control) to complete the automatic control of the entire detection process. The implementation method of the fully automatic process is described in detail. It uses computer and PLC technology for detection. The pulse data acquisition uses a high-precision and high-reliability photoelectric bidirectional encoder to realize the automatic measurement, recording and verification of gas flow meters using a gas meter. 2 System Composition and Working Principle 2.1 System Composition The automatic control system of the bell-type gas metering device consists of: standard device, computer, PLC programmable controller, silent air compressor, photoelectric bidirectional encoder, solenoid valve, etc. 2.2 System Working Principle This system utilizes a bell-type gas meter to provide a stable standard volume gas source. It employs a photoelectric bidirectional encoder as the position sensing element of the bell-type measuring cylinder and a solenoid valve as the control element. Through program setting, it achieves quantitative exhaust and completes the automatic control of the detection process, making it an automatic standard device for calibrating gas instruments. 2.3 Implementation Method (1) Input the theoretical instrument coefficients according to Table 1 below. Table 1 (2) Measure the number of lifting pulses according to the standard volume value corresponding to the actual height of the bell-type gas meter calibration certificate. (3) Measure the actual instrument coefficient K Instrument coefficient K = ((H12-H11) * Q1) / ((H2-H1) * |F1-F2| (unit: liters/pulse)) (H1, H2, H11, H12, F1, F2—first and second rising and falling heights and corresponding frequencies. Q1—nominal volume of the bell.) Repeat the above process to calculate 10 instrument coefficients and take the average value, which is the actual instrument coefficient K. Finally, the required standard volume is obtained according to the formula: Q=K*f (Q—standard volume; K—actual instrument coefficient; f—number of pulses corresponding to the standard volume). The system principle block diagram is shown in Figure 1. [align=center] Figure 1 System principle block diagram[/align] 3 Hardware configuration 3.1 Photoelectric bidirectional encoder The photoelectric bidirectional encoder is a sensor that converts the mechanical geometric displacement on the output shaft into an electrical pulse signal through photoelectric conversion. Its principle block diagram is shown in Figure 2. To determine the rotation direction, the code disk can also provide two pulse signals and a zero-position signal with a phase difference of 90º. Three channels output signals A, B, and Z. When rotating clockwise, the waveform of channel A leads the waveform of channel B by 90°; when rotating counterclockwise, the waveform of channel A lags the waveform of channel B by 90°; the photoelectric bidirectional encoder outputs a reference pulse for each rotation, and the center of the reference pulse waveform is aligned with the waveform output by channel A. [align=center]Figure 2 Schematic diagram of photoelectric bidirectional encoder[/align] 3.2 The lower-level PLC programmable controller uses the Omron CJ1M-CPU22 series from Japan. This series uses unit connectors and consists of a power supply module, CPU module, and storage unit. The CJIM-CPU22 has a maximum of 320 I/O points, can connect up to 10 units, has a program capacity of 10K steps, a data memory capacity of 32K words, an LD instruction processing speed of 100ns, and built-in I/O: 10 inputs and 6 outputs. Inputs: 4 interrupt inputs (pulse capture); 2 high-speed counter inputs (differential phase: 50KHz; single phase 100KHz). 3.2.1 Input and output allocation of the built-in CPU unit: Bits 03, 06, and 08 of the CIO2960 are connected to Z, A, and B of the high-speed counter 0. Bits 00 and 01 of the CIO2961 are connected to the up and down start switches of the bell. 4. PLC Communication with Host Computer The host computer uses an industrial computer and KingSCADA software, which addresses the communication issue between the PLC and the KingSCADA software. 4.1 PLC Connection with RS232 Interface: Communication settings are as follows: Baud rate: 9600; Data bit length: 7; Stop bit length: 2; Parity bit: Even. OMRON provides the SYSMAC WAY (BCD data) network communication type, and the data transmission format is based on BCD code. The HOSTLINK protocol is based on this network type. When configuring the PLC network, the main link unit number must match the device address defined in KingSCADA. The PLC address range in KingSCADA is 0-31. 5. Software Design The software design consists of two parts: the host computer is programmed using KingSCADA software, and its main functions are: monitoring data from the slave computer, managing real-time and historical data, real-time display, and printing calibration certificates; the slave computer is programmed using a PLC programmable controller. It mainly implements data acquisition, calculation, and automatic control. 5.1 PLC Programmable Controller Programming The CJ1M-CPU22 programmable controller collects pulse signals from the photoelectric bidirectional encoder, calculates cumulative flow and instantaneous flow, and automatically controls each calibration point. The basic calculation formula is as follows: (1) Q=K*f Where: Q——cumulative flow, unit: liter; K——instrument coefficient, unit: liter/pulse; f——number of pulses, unit: Hz. (2) Q1 =Q/t Where: Q1——-instantaneous flow, unit: m3/h; Q——-cumulative flow, unit: liter; t——-time, unit: hour. 5.1.1 Storage Unit Allocation Storage unit allocation is shown in Table 4 Table 4 5.1.2 PLC Programmable Controller Program Flowchart The program flowchart is shown in Figure 5 [align=center] Figure 5 Program Flowchart[/align] 6.1 Program Listing (omitted) 6.2 Upper Computer KingSCADA Software Programming Its main functions are: monitoring the real-time production process and data from the lower computer, managing real-time and historical data, real-time screen, and printing calibration certificates. 6.2.1 Define I/O variables in the KingSCADA data dictionary to correspond the memory units in the PLC programmable controller with the I/O variables in KingSCADA, thereby establishing a communication link between the two. All variables are of type: I/O integer; the connected device is: CJ1M; the read/write attribute is: read/write; the acquisition frequency is: 1ms. 6.2.2 Simulate the working process, realize data recording, and print calibration certificates. Based on the above working principle, create a working screen in KingSCADA, perform animation connections, and manage data. Here, all "buttons" and "indicator lights" are implemented using Bit functions, BitSet functions, and pop-up and fill attributes. All "digits" use analog value input and output connections to achieve the required functions. 6.2.2.1 Implement data recording and querying. This mainly involves data recording and querying, that is, recording the data calibrated by the bell-type gas meter and querying the data as needed. 1. In SQL Server, the database report format is as shown in Table 5. Table 5 2. Use the database creation, disconnection, and query functions in KingSCADA to implement the functions of Table 5. (1) Connect KingSCADA and the database function: SQLConnect(DeviceID,”dsn=;uid=;pwd="") (2) Disconnect from the database: SQLDisconnect(DeviceID) (3) Use the comprehensive condition query method to query the required data. The program is as follows: String where=”date='“+date query+"'and a=”+StrFromInt(b,10);//define query conditions SQLSelect(DeviceID,“data”,“query data”,where,“")//get a specific selection set record number=SQLNumRows(DeviceID);//specify how many rows are included in the selection set 6.2.2.2 Implement the printing of the verification certificate First, draw the format of the verification certificate according to the requirements of the table being inspected, and then use the following function to print it. (1) Function: PrintWindow() — Print the specified window (2) Format: PrintWindow(“Window”,xScale,yScale,option,xStart,yStarte) 7. Conclusion The innovation of this paper is: ① The calculation relationship between flow rate, instrument coefficient and frequency is realized by using PLC programmable controller, ② Real-time monitoring data management is realized by using KingSCADA software. Through its use in actual industrial verification, the verification accuracy and precision have been effectively improved, laying a solid foundation for enterprise information integration. References [1] OMRON CJ series built-in I/O CJIM CPU22/CPU23 unit operation manual, 2002.11. [2] OMRON SYSMACCS/CJ series programmable controller instruction manual, 2002.11. [3] Guo Zongren. Programmable controller and its communication network technology. Beijing: People's Posts and Telecommunications Press, 1999. [4] KINGVIEW version 6.5 User Manual Beijing: Beijing Yacon Technology Development Co., Ltd. 2004 [5] KINGVIEW version 6.5 Command Language Function Quick Reference Manual Beijing: Beijing Yacon Technology Development Co., Ltd. 2004. [6] Xu Yuehua, Wang Renhuang, Application of KingSCADA in Elevator Monitoring System. Microcomputer Information 2003(10): 27 [7] Zhao Yongsheng, Wang Siyuan, Zhu Jiling et al. Distributed Boiler Microcomputer Control System Based on Soft PLC. Microcomputer Information 2003(7): 9
Read next

CATDOLL 133CM Kiki Shota Doll

Height: 133cm Male Weight: 28kg Shoulder Width: 31cm Bust/Waist/Hip: 64/59/73cm Oral Depth: 3-5cm Vaginal Depth: N/A An...

Articles 2026-02-22