Share this

Optimization and Implementation of Data Filtering Algorithms in WinCC

2026-04-06 03:48:59 · · #1
Abstract: In an automation control system composed of WinCC, a programmable logic controller (PLC), and corresponding sensors, the data collected on-site can be optimized and implemented using a host computer. This paper introduces several implementation schemes for embedding data processing methods into the WinCC environment. Keywords: WinCC, PLC, HMI, Filtering Algorithm for Data 1 Introduction With the increasing level of industrial automation, Human Machine Interface (HMI) technology is becoming increasingly popular in industrial production. The emergence of configuration software allows for more efficient processing of on-site data using computers, thereby achieving optimized control of the industrial site. Among them, Windows Control Center (WinCC) from Siemens, Germany, is renowned for its excellent operability and powerful functions and has been widely used in the industrial field. [align=center]Figure 1 System Overall Structure[/align] The blast furnace dust removal control system of a steel plant adopts Siemens' WinCC, PLC, and network technology to replace the traditional control circuit composed of relays and contactors. This control system not only improves the working quality of the blast furnace dust removal system, extends the effective operating cycle of electrical equipment, and reduces the failure rate, but also greatly shortens the fault repair time, reduces production costs and the labor intensity of operators, and optimizes the entire production management process. In order to make full use of the powerful processing capabilities of the computer and improve the efficiency of the PLC, a large amount of data processing is placed in the IPC in the software design of the control system. Various optimization calculations of filtering algorithms are implemented in WinCC, which improves equipment utilization and system operating speed. 2 System Composition The overall design block diagram of the system is shown in Figure 1. A Siemens S7-300 PLC is used to construct the field control level controller, realizing the acquisition of all field analog and digital signals, and controlling the operation of field electrical equipment to ensure the stability and control accuracy of field equipment operation. The upper and lower computers communicate through the Profibus-DP bus. WinCC is installed on the IPC and connects to the Profibus-DP bus via the communication card CP5611 to acquire data and perform calculations. Operators can intuitively understand the operating status of the equipment, grasp the real-time and historical data of important parameters, and the parameters of all alarm points through the graphical interface of the configuration software. At the same time, WinCC can realize real-time detection and online intervention of system operating parameters. 3 Optimization of typical data filtering processing in WinCC 3.1 WinCC C script The working environment of steel plants is harsh and there are many sources of interference. In addition to anti-interference issues in the hardware system configuration, it is necessary to perform necessary filtering processing on various types of data acquired. Due to the complexity of the blast furnace dust removal system and the large amount of data, if field-level data filtering algorithms are performed in the field and inside the controller PLC, it will greatly increase the burden on the PLC. To reduce the burden on the field control PLC and fully utilize the high-speed computing advantages of computers, the filtering processing of various process value data, including all analog quantities, is largely performed in WinCC in this system design. WinCC integrates C script functionality, and its 6.0 version further introduces VBS script functionality. The C script adheres to the standard C language specification and provides system functions based on the C script specification, supporting configuration engineers to perform fully open and free programming and in-depth secondary development. This provides a basic editing platform for introducing various filtering algorithms that meet practical needs in WinCC. WinCC's global script editor (Globe Script) provides configuration engineers with a C script development environment. It divides functions into three types: project functions, standard functions, and internal functions. Project functions are functions developed by the configuration engineer that conform to the C language specification. Compiled project functions allow users to use them freely throughout the project, just like calling internal C language functions. Standard functions are several commonly used configuration functions developed based on the C language and included in the WinCC system, which configuration engineers can modify. Internal functions are system functions included in the C language and cannot be edited or modified by configuration engineers. Configuration engineers can use functions in the configuration screen to dynamically manage various components. Therefore, editing corresponding project functions is a primary approach and technical means to achieve independent functions for different user systems. This section uses the acquisition and processing of shaft temperature in a fan system as an example to illustrate how to implement data filtering using scripts in WinCC. The control system requires real-time online monitoring of the high-pressure fan bearing temperature, upper and lower limit alarms, data archiving, and report printing. To obtain the correct bearing temperature, WinCC must filter the temperature values ​​acquired by the PLC before linearly calibrating the collected data to remove interfering data. To achieve this, a filtering algorithm function was written in the system program, and filtering was implemented using both dynamic configuration on the screen and action scripts, as described below. In the system hardware configuration, the field temperature sensor sends the electrical signal corresponding to the bearing temperature to the PLC via the analog input module (AI), while the host computer obtains the corresponding signal value of the bearing temperature through the PLC network address and the AI ​​port address. To acquire field data, a data channel corresponding to the external device needs to be established in WinCC. This channel connection is achieved in WinCC by defining an external variable. Here, an external variable `gyfj_plc` is defined, and its address is assigned to connect it to the AI ​​port of the PLC that acquires the signal from the high-pressure blower bearing temperature sensor. In addition, a corresponding internal variable `gyfj_inner` is defined in WinCC to store the final processed result after filtering. 3.2 Creation of Project Function A new project function, the filtering function `lb()`, was created using the Globe Script editor provided by WinCC. The filtering function flow is shown in Figure 2. To save space, a smoothing filtering algorithm is used here, and the average of 6 real-time signals is taken as the correct signal. Create a new project function in Globe Script and save it as lb.fct. Enter the following script inside the function: void lb( char*ID_InName,char*ID_SavetempName) { double result,temp; static double tmp[7]; static int count=0; int i; char * name; count=count+1; if (count<=6 ) {tmp[count]=GetTagDouble(ID_InName); printf("tmp[%d]=%f\n",count,tmp[count]); } else { temp=0; for (i=1;i<=6;i++) {temp=temp+tmp[i]; } temp=temp/6; SetTagDouble(ID_SavetempName,temp); count=0; } } [align=center][b] Figure 2 Processing method flowchart[/b][/align] To make the filtering more universal, two char type parameters are introduced in the function name definition to pass the names of the variables to be processed. The first parameter, ID_InName, is the name of the process variable before filtering, and the second parameter is the label name of the stored signal after filtering. Through this function, the interfered signal is filtered and stored in a new variable. 3.3 Dynamic Screen Configuration [align=center] Figure 3 Dynamic Filtering Implementation in I/O Domain [/align] When configuring the screen, the project function lb() can be called periodically or non-periodically to filter the data channel to be filtered, ensuring that the internal variable gyfj_inner stores the correct process signal value. Here, an I/O domain is used to periodically call this function. It is only necessary to make the "Output Value" attribute of the I/O domain dynamic by C-Action, and correctly call the filtering project function lb() created above in the pop-up "Edit Action" window, as shown in Figure 3. In the call, the name of the process value variable containing interference, gyfj_plc, and the name of the process value storage variable after filtering interference, gyfj_inner, are passed in sequence. To achieve periodic automatic filtering, simply set the trigger condition of C-Action to a period that meets the actual needs. While the method shown in 3.3 can achieve the filtering requirements, the optimized WinCC action script in section 3.4 only executes the filtering function when the screen containing the lb() function is the current screen. If the screen is switched to another screen without lb(), the data filtering for the corresponding channel will stop. This is obviously a significant drawback in the display and acquisition of rapidly changing analog quantities and must be optimized. In addition to functions, the WinCC script editor also allows users to write a type of script called "actions." In "action" scripts, configuration engineers can call any function or write new processing functions as needed. Unlike functions, which require calls within the configuration screen to function, actions can specify triggering conditions (i.e., script execution) at the initial definition. As long as the WinCC project is active, the action will continuously check if the specified trigger is met. If it is, the action script will execute the content described. Configuration engineers can specify triggering conditions in the form of time (period) or variables. Action scripts provide the possibility for ensuring that data processing for predetermined channels can run independently of the screen. This method requires creating a new global action, defined in the following format: #include "apdefap.h" int gscAction( void ) { lb("gyfj_plc","gyfj_inner"); } Select the time period or the corresponding external variable of the preprocessing channel as the trigger. Once the system is activated, the program within the function body will periodically execute the action or execute it whenever the data from the PLC changes. Therefore, this method no longer relies on dynamic screen processing for data processing. For data requiring real-time processing, action scripts will achieve better results. Using the methods described above, various complex processing techniques, including filtering, can be applied to field data at the IPC terminal according to user needs to obtain reasonable and accurate data, providing a reliable data source for other applications. 4. Conclusion In the 21st century, industrial automation levels have been rising, and human-machine interface (HMI) technology has gained increasing recognition in domestic and international industrial production and automation control fields. Configuration software, in particular, has received widespread attention in the industry due to its short development cycle and powerful functions. This paper briefly describes the basic ideas and optimization methods for data processing using the configuration software WinCC through a practical project, indicating how to utilize WinCC's powerful background scripting capabilities to implement various data processing algorithms. Practice has proven that this method not only effectively saves system resources but also enables real-time display and tracking of data changes, meeting the requirements of field use. The author's innovations include: introducing a human-machine interface into the automatic control system, achieving excellent human-machine interaction; and utilizing the high speed and large capacity of computers to perform various complex data processing tasks, including data filtering, within WinCC, improving equipment utilization, accelerating response speed, and reducing PLC data processing overhead. References [1] Wang Shuohe, Wan Jianru. Matrix circuit to expand PLC output port [J] Electrical Application, 2005 (6): 51-53 [2] Wang Shuohe. Design of computer control system for bag dust collector [J] Microcomputer Information, 2005 (9): 77-79 [3] Siemens (China) Co., Ltd. Automation and Drives Group. SIMATIC WinCC V5 Basic Manual [M]. 1997 [4] Siemens (China) Co., Ltd. Automation and Drives Group. SIMATIC WinCC V5 Communication Manual [M]. 1997 [5] Siemens (China) Co., Ltd. Automation and Drives Group. SIMATIC WinCC V5 Global Script Manual [M]. 1997
Read next

CATDOLL Q 92CM Body with TPE Material

Height: 92cm Weight: 13kg Shoulder Width: 25cm Bust/Waist/Hip: 47/47/56cm Oral Depth: 3-5cm Vaginal Depth: 3-13cm Anal ...

Articles 2026-02-22
CATDOLL 123CM Momoko TPE

CATDOLL 123CM Momoko TPE

Articles
2026-02-22
CATDOLL 146CM Christina TPE

CATDOLL 146CM Christina TPE

Articles
2026-02-22