Digital simulation method and system of programmable controller

Through digital simulation methods in the field of industrial automation, server units and data acquisition units are built to realize the simulation of PLC and HMI, which solves the problems of high costs and insufficient reliability of simulation results in the development and debugging of PLC user programs, and reduces the development Cost and time improve the accuracy of simulation results and the difficulty of system integration.

CN119148553APending Publication Date: 2024-12-17SHENZHEN INSTITUTE OF INFORMATION TECHNOLOGY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411292045.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In the field of industrial automation, there are problems such as high cost, difficult learning and complex equipment maintenance in the development and debugging of PLC user programs. There are differences between digital software programming and actual production environment, resulting in the reliability of simulation results and system integration of the system Inadequate difficulty.

Method used

Design a digital simulation method for programmable controllers. By building server units for simulation, it realizes simulation of programmable controllers and human-machine interfaces, combines data acquisition and driver simulation, uses Modbus TCP protocol for communication, and establishes a data model library and digital simulation interface to realize offline development and initial debugging.

Benefits of technology

It reduces development costs and time, improves the accuracy of simulation results and system development efficiency, simplifies system integration, reduces on-site debugging time, enhances the stability of actual project control, and realizes virtuous cycle system operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119148553A_ABST
    Figure CN119148553A_ABST
Patent Text Reader

Abstract

The invention provides a digital simulation method and system for a programmable controller, and the method comprises the following steps: building a server unit, compiling and executing a program, collecting and modeling data, driving simulation, debugging and monitoring a system, and communicating with a plurality of simulated programmable controllers through a Modbus TCP protocol in a peripheral communication unit. And communication with an I / O board card, a driving board card and an upper computer in reality is carried out, and project debugging and teaching application are carried out. According to the method, the difference between digital software programming and an actual production environment is solved, the accuracy of a digital simulation result is improved, the difficulty of a digital simulation system is reduced, the development cost and time are reduced, and the efficiency and effect of system development and actual application are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of digital simulation technology, and in particular to a digital simulation method and system for a programmable controller. Background Art

[0002] Traditional programmable controllers are widely used in the field of industrial automation, but there are certain difficulties in developing and debugging controller programs because they need to be tested on actual equipment, which may bring safety risks and increase costs. Therefore, digital simulation technology has become one of the effective ways to solve this problem.

[0003] With the continuous development of PLC (Programmable Logic Controller) in various application fields, PLC and HMI are widely used in industrial control systems, and industrial automation control technology has also made significant progress. The capacity and complexity of PLC user programs have continued to increase, and it is difficult for users to complete all program operations at one time, such as checking the correctness of program writing, the reliability of operation, and the compliance of logical relationships. Traditional PLC and HMI systems require a large number of hardware devices for debugging and testing, resulting in high costs, difficulty in learning, and complex equipment maintenance. Although the simulation system of the existing technology has partially solved these problems, it still has deficiencies in communication protocol compatibility and system integration.

[0004] During the use of PLC, due to changes in the environment or requirements, it is often necessary to change the user program while maintaining the continuity of operation. This requires program adjustment without stopping the PLC. In order to improve the usability and debuggability of PLC, there is a broad prospect in data simulation and data twins.

[0005] PLC is widely used in industrial control and has become a compulsory course for mechanical and electrical related majors in technical schools. However, due to the high price of PLC and its supporting equipment, the number of PLC equipment in many schools is limited, and teaching and programming exercises can usually only be carried out through pure software simulation. The numerical simulation system can replace the actual production data into the simulation system to achieve the combination of virtual and real.

[0006] In the existing intelligent manufacturing field, there are often significant differences between digital software programming and the actual production environment. This difference leads to many technical difficulties in the development and debugging of production systems, including:

[0007] 1. Existing systems usually rely on physical devices for debugging, which increases development costs and time;

[0008] 2. Real-time data in the actual production environment is difficult to accurately simulate in the digital simulation process, which affects the reliability of the simulation results;

[0009] 3. Lack of effective system debugging and monitoring mechanism, making it difficult to discover and solve problems in a timely manner;

[0010] 4. The diversity and complexity of communication protocols increase the difficulty of system integration. Summary of the invention

[0011] The main purpose of the present invention is to provide a digital simulation method and system for a programmable controller, aiming to resolve the difference between digital software programming and the actual production environment, improve the accuracy of digital simulation results, reduce the difficulty of the digital simulation system, reduce development costs and time, and improve the efficiency and effectiveness of system development and practical applications.

[0012] In order to achieve the above object, the present invention provides a digital simulation method of a programmable controller, the method comprising the following steps:

[0013] Step S10, building a server unit, wherein the server unit is used to simulate the programmable controller and to simulate the programmable controller and the human-machine interface through the internal communication unit;

[0014] Step S20, program compilation and execution: write a program and download the program to a program compilation and execution unit through a data interface, and compile the user program, perform data collection and analysis through the program compilation and execution unit;

[0015] Step S30, data collection and modeling: collect the actual environmental data of the IoT devices through the data acquisition unit, and establish a data model library and a digital simulation interface;

[0016] Step S40, drive simulation: drive simulation is performed by a drive simulation execution unit, including at least I / O simulation, drive simulation and peripheral simulation;

[0017] Step S50, system debugging and monitoring: comparing the execution results through the monitoring and proofreading unit, outputting an abnormality report, and realizing differentiated display and control;

[0018] Step S60, communicating with multiple simulated programmable controllers through the Modbus TCP protocol in the peripheral communication unit, and communicating with the actual I / O board, driver board and host computer;

[0019] Step S70, project debugging and teaching application: by writing a program and obtaining real-time data in production through the server unit, simulating the digital simulation environment of actual production, and realizing offline development and initial debugging.

[0020] A further technical solution of the present invention is that before step S20, the following steps are further included:

[0021] Determine whether the system is normal;

[0022] If normal, proceed to step S20.

[0023] A further technical solution of the present invention is that step S10 comprises:

[0024] Install and configure the operating system: Install and configure the operating system on the server, select a suitable Linux distribution, and ensure that the server can run stably and connect to the network seamlessly;

[0025] Configure network parameters: configure the network parameters of the server to ensure that the server can stably connect to the local area network and the Internet. The network parameters of the server include at least IP address, subnet mask, gateway and DNS;

[0026] Install and configure Nginx server software: Make sure Nginx can handle external requests by editing the Nginx configuration file, setting up server blocks and virtual hosts;

[0027] Configure firewall rules: Use appropriate commands to allow Nginx services and ensure the security of the server by configuring firewall rules;

[0028] Perform intranet penetration: Use tools to set up tunnel services, map server local services to the external network, and ensure that devices on the same network segment can directly access the server;

[0029] Select and configure server nodes: Build a multi-node distributed architecture to ensure high availability and load balancing of the system;

[0030] Install the programmable controller and HMI programming software: first select the appropriate development environment and ensure that the software is compatible with the server unit system.

[0031] A further technical solution of the present invention is that step S20 comprises:

[0032] Write programmable controller control programs: define equipment control logic and processes, including input and output control, logical operations and timing control, and ensure that the program logic is correct and the structure is clear;

[0033] Write HMI programs: design the user interface to display system status, real-time data and control options, and ensure the interface is intuitive and user-friendly;

[0034] Import program compilation execution unit;

[0035] The step of importing the program compiling execution unit comprises:

[0036] Import the PLC program and compile and test: Import the PLC program into the program compilation execution unit, compile and test it to ensure that the program is correct and can run normally in the simulation environment;

[0037] Import HMI program and compile and test: Import the HMI program into the compilation execution unit, compile and test it to ensure that the interface interacts correctly with the programmable controller program, and that data is displayed in real time and control instructions are accurately transmitted;

[0038] Download the program to the server unit: Download the compiled PLC and HMI program to the PLC and HMI simulator of the server unit to ensure that the program can run normally in the simulation environment and is consistent with the actual device.

[0039] A further technical solution of the present invention is that step S30 comprises:

[0040] Configure data acquisition unit: Configure the data acquisition unit, which includes A / D simulation module, IO status data acquisition module, axis operation data acquisition module and product formula data acquisition module to ensure accurate and real-time data acquisition and provide necessary input data for the simulation system.

[0041] Install sensors and data acquisition modules: Ensure that the temperature and pressure sensors of the field equipment are installed so that the environmental parameters can be accurately collected in the data acquisition unit. The sensor signals are transmitted to the data acquisition unit through the A / D converter for use by the simulation program;

[0042] Connect IO module: Connect the IO module of the data acquisition unit to ensure normal signal transmission, collect various digital signals in the system, and transmit them to the programmable controller for processing;

[0043] Install the shaft operation data acquisition module: Install and configure the shaft operation data acquisition module in the on-site equipment to collect the shaft's torque, speed, acceleration and deceleration operation data to ensure that the data is real-time and accurate, and provide basic data for the dynamic simulation of the simulation system;

[0044] Configure product formula data collection module: Configure the product formula data collection module to collect and manage various formula data used in the production process, ensure the accuracy and completeness of the formula data, and provide necessary parameters for the simulation system.

[0045] A further technical solution of the present invention is that step S40 comprises:

[0046] Install drive simulation equipment: Install drive simulation equipment, including motors, cylinders and other actuators, and configure the control modules of these devices to ensure timely response and precise control.

[0047] Analog output control: The analog drive execution unit simulates the output control, including controlling the motor start and cylinder action, to ensure that the equipment runs according to the predetermined program;

[0048] Simulate the axis running status: simulate the axis running status in the drive simulation execution unit, including load and torque, axis positioning, to ensure that the simulated operation is consistent with the actual operation, providing a basis for subsequent monitoring and calibration;

[0049] Simulate cylinder action: Simulate the action of the cylinder in the drive simulation execution unit, including push and retract operations, to ensure that the simulation process is consistent with the actual production operation.

[0050] A further technical solution of the present invention is that step S50 comprises:

[0051] Real-time monitoring of system operation status: Real-time monitoring of system operation status in the monitoring and proofreading unit, recording various operation data, and timely discovery and resolution of problems through monitoring system operation status;

[0052] Proofreading simulation execution unit operations: Proofreading the operation of the driving simulation execution unit in the monitoring proofreading unit to ensure that each operation is accurate, output the proofreading results, and provide data support for abnormal reports;

[0053] Output exception report: Output exception report in the monitoring and proofreading unit to record abnormal situations that occur during operation, ensure that the exception report is accurate and detailed, and provide a basis for subsequent adjustments and optimizations.

[0054] Confirm abnormal reports: Confirm the abnormal reports output by the monitoring and proofreading unit to ensure that the reports are correct and provide reliable data support for subsequent peripheral communications and actual control.

[0055] A further technical solution of the present invention is that step S60 comprises:

[0056] Configure motion board: Configure the motion board in the peripheral communication unit to ensure accurate transmission of motion control signals and achieve precise control of the equipment;

[0057] Configure IO control card: Configure the IO control card in the peripheral communication unit to ensure accurate input and output control of digital signals and achieve real-time control and monitoring of the equipment;

[0058] Configure 485 module: Configure the 485 module in the peripheral communication unit to ensure stable communication and achieve reliable data transmission between multiple devices;

[0059] Configure 232 communication module: Configure the 232 communication module in the peripheral communication unit to ensure stable data communication and achieve seamless connection with external devices;

[0060] Activate the peripheral communication unit: After confirming that the abnormal report is correct, activate the peripheral communication unit to control the equipment and ensure that all types of communication modules are working properly.

[0061] A further technical solution of the present invention is that step S70 comprises:

[0062] Conduct comprehensive testing: Conduct comprehensive testing of the entire system to ensure that each module is working properly, adjust system parameters, and optimize overall performance;

[0063] Optimize communication data return flow: By optimizing the communication data return flow process, efficient communication between HMI and programmable controller can be achieved, ensuring the stable operation of the system comprehensive display program;

[0064] Analyze data model: Analyze the data model collected by the data acquisition unit and transmit it to the corresponding API interface of the digital simulation system to ensure that the data model is accurate and timely and provide basic data for the simulation system;

[0065] Execution results: The programmable controller simulator in the server unit obtains data, performs program analysis and judgment, and outputs it to the drive simulation execution unit to execute the corresponding operation results;

[0066] Closed-loop monitoring: Closed-loop monitoring is performed through the data acquisition unit and the monitoring and proofreading unit, the drive simulation operation module is proofread, and abnormal reports are output to achieve stable control.

[0067] To achieve the above object, the present invention also provides a digital simulation system of a programmable controller, the system comprising a server unit, a program compilation execution unit, a data acquisition unit, a drive simulation execution unit, a monitoring and proofreading unit and a peripheral communication unit;

[0068] The server unit is used to simulate the programmable controller and realize the simulation of the programmable controller and the human-machine interface through the internal communication unit;

[0069] The program compiling and executing unit is used to write a program and download the program to the program compiling and executing unit through a data interface, and the program compiling and executing unit compiles the user program and performs data collection and analysis;

[0070] The data acquisition unit is used to collect the actual environmental data of IoT devices and establish a data model library and digital simulation interface;

[0071] The drive simulation execution unit is used to perform drive simulation, including at least I / O simulation, drive simulation and peripheral simulation;

[0072] The monitoring and proofreading unit is used to compare the execution results, output abnormal reports, and achieve differentiated display and control;

[0073] The peripheral communication unit is used to communicate with multiple simulated programmable controllers through the Modbus TCP protocol, and to communicate with the real I / O boards, driver boards and host computers;

[0074] The server is also used to obtain real-time data in production, simulate the digital simulation environment of actual production, and realize offline development and initial debugging.

[0075] The beneficial effects of the digital simulation method and system of the programmable controller of the present invention are:

[0076] The present invention can not only save the debugging time of actual production through the design of the digital simulation system, but also solve the problem of disconnection between vocational education and application projects to a certain extent, and achieve a smooth transition. The process of the present invention is simple and effective, and it is economical and practical. Especially in the process of learning and research, more real scenarios can be rehearsed by combining different data models to solve the problems encountered in actual projects, greatly increasing the control stability of actual projects, while reducing the time occupied by on-site debugging, reducing the cycle time from development to delivery, and thus achieving a virtuous cycle, ensuring the safe and reliable operation of the entire system. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] Figure 1 It is a flow chart of a preferred embodiment of the digital simulation method of a programmable controller of the present invention;

[0078] Figure 2 It is a schematic diagram of an example project of an intelligent traffic light in a preferred embodiment of a digital simulation method of a programmable controller of the present invention;

[0079] Figure 3 It is a framework diagram of the digital simulation system of the programmable controller of the present invention.

[0080] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. DETAILED DESCRIPTION

[0081] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0082] The present invention proposes a digital simulation method for a programmable controller. The technical solution adopted by the present invention is mainly to simulate a programmable controller (PLC) through a server unit, and to simulate the PLC and a human-machine interface (HMI) through an internal communication unit, thereby constructing a digital simulation system that does not rely on physical objects and reducing development costs and time.

[0083] Specifically, Figure 1As shown, a preferred embodiment of the digital simulation method of a programmable controller of the present invention comprises the following steps:

[0084] Step S10, building a server unit, the server unit is used to simulate the programmable controller, and to simulate the programmable controller and the human-machine interface through the internal communication unit.

[0085] The digital simulation method of the programmable controller in this embodiment is applied to the digital simulation system of the programmable controller. The system simulates the PLC through a server unit and simulates the PLC and human-machine interface (HMI) through an internal communication unit, thereby building a digital simulation system that does not rely on physical objects and reducing development costs and time.

[0086] Step S20, program compilation and execution: write a program and download the program to a program compilation and execution unit through a data interface, and use the program compilation and execution unit to compile the user program and perform data collection and analysis.

[0087] Users can write programs and download them to the program compilation and execution unit through the data interface. The program compilation and execution unit can compile user programs, collect and analyze data, and finally execute these programs to ensure a high degree of consistency between the simulation environment and the actual production environment.

[0088] Step S30, data collection and modeling: collect the actual environmental data of the IoT devices through the data acquisition unit, and establish a data model library and a digital simulation interface.

[0089] The data acquisition unit is responsible for collecting the actual environmental data of each IoT device and establishing a data model library and digital simulation interface. These data and models are used to process a variety of production process data and complex production acquisition data to improve the accuracy and reliability of simulation results.

[0090] Step S40, drive simulation: drive simulation is performed by a drive simulation execution unit, including at least I / O simulation, drive simulation and peripheral simulation.

[0091] The system first performs driver simulation on the driver simulation execution unit, including I / O simulation, driver simulation, and peripheral simulation, etc. By debugging the simulation effect, the digital simulation system is optimized, and the system verification and optimization are effectively performed.

[0092] Step S50, system debugging and monitoring: compare the execution results through the monitoring and proofreading unit, output an abnormality report, and achieve differentiated display and control.

[0093] During system debugging, the monitoring and proofreading unit compares the execution results, outputs abnormal reports, and realizes differentiated display and control. This mechanism can detect and solve problems in a timely manner, improving system stability and reliability.

[0094] Step S60, through the Modbus TCP protocol in the peripheral communication unit, communicate with multiple simulated programmable controllers, and communicate with the real I / O board, driver board and host computer, thereby simplifying the system integration process and enhancing the compatibility and scalability of the system.

[0095] Step S70, project debugging and teaching application: by writing a program and obtaining real-time data in production through the server unit, the digital simulation environment of actual production is simulated to achieve offline development and initial debugging. This can provide better teaching tools, allowing students to gain project experience that fits actual production. After debugging, it can be directly used for production operations, and the function is convenient to use.

[0096] Through the above-mentioned technical solution, this embodiment solves the difference between digital software programming and the actual production environment, improves the accuracy of digital simulation results, reduces the difficulty of the digital simulation system, reduces development cost and time, and improves the efficiency and effect of system development and practical application. It is suitable for application in production processes and teaching.

[0097] Furthermore, in this embodiment, before step S20, the following steps are also included:

[0098] Determine whether the system is normal;

[0099] If normal, proceed to step S20.

[0100] In this embodiment, step S10 includes:

[0101] Install and configure the operating system: Install and configure the operating system on the server, select a suitable Linux distribution, such as Ubuntu or CentOS, and ensure that the server can run stably and connect to the network seamlessly;

[0102] Configure network parameters: Configure the server's network parameters to ensure that the server can stably connect to the LAN and the Internet. The server's network parameters include at least IP address, subnet mask, gateway, and DNS.

[0103] Install and configure Nginx server software: Make sure Nginx can handle external requests by editing the Nginx configuration file, setting up server blocks and virtual hosts;

[0104] Configure firewall rules: Use appropriate commands to allow Nginx services and ensure the security of the server by configuring firewall rules;

[0105] Perform intranet penetration: Use tools such as Ngrok or Frp to set up tunnel services, map local server services to the external network, and ensure that devices on the same network segment can directly access the server;

[0106] Select and configure server nodes: Build a multi-node distributed architecture to ensure high availability and load balancing of the system;

[0107] Install the programmable controller and HMI programming software: first select the appropriate development environment and ensure that the software is compatible with the server unit system.

[0108] In this embodiment, step S20 includes:

[0109] Write programmable controller control programs: define equipment control logic and processes, including input and output control, logical operations and timing control, and ensure that the program logic is correct and the structure is clear;

[0110] Write HMI program: design the user interface to display system status, real-time data and control options, and ensure the interface is intuitive and user-friendly, and easy to operate;

[0111] Import program compilation execution unit;

[0112] The steps of importing the program compilation execution unit specifically include:

[0113] Import the PLC program and compile and test: Import the PLC program into the program compilation execution unit, compile and test it to ensure that the program is correct and can run normally in the simulation environment;

[0114] Import HMI program and compile and test: Import the HMI program into the compilation execution unit, compile and test it to ensure that the interface interacts correctly with the programmable controller program, and that data is displayed in real time and control instructions are accurately transmitted;

[0115] Download the program to the server unit: Download the compiled PLC and HMI program to the PLC and HMI simulator of the server unit to ensure that the program can run normally in the simulation environment and is consistent with the actual device.

[0116] In this embodiment, step S30 includes:

[0117] Configure data acquisition unit: Configure the data acquisition unit, which includes A / D simulation module, IO status data acquisition module, axis operation data acquisition module and product formula data acquisition module to ensure accurate and real-time data acquisition and provide necessary input data for the simulation system;

[0118] Install sensors and data acquisition modules: Ensure that the temperature, pressure and other sensors of the field equipment are installed to ensure accurate collection of environmental parameters in the data acquisition unit. The sensor signals are transmitted to the data acquisition unit through the A / D converter for use by the simulation program;

[0119] Connect IO module: Connect the IO module of the data acquisition unit to ensure normal signal transmission, collect various digital signals in the system, and transmit them to the programmable controller for processing;

[0120] Install the shaft operation data acquisition module: Install and configure the shaft operation data acquisition module in the on-site equipment to collect the shaft torque, speed, acceleration and deceleration operation data to ensure that the data is real-time and accurate, and provide basic data for the dynamic simulation of the simulation system;

[0121] Configure product formula data collection module: Configure the product formula data collection module to collect and manage various formula data used in the production process, ensure the accuracy and completeness of the formula data, and provide necessary parameters for the simulation system.

[0122] In this embodiment, step S40 includes:

[0123] Install drive simulation equipment: Install drive simulation equipment, including motors, cylinders and other actuators, and configure the control modules of these devices to ensure timely response and precise control;

[0124] Analog output control: The analog drive execution unit simulates the output control, including controlling the motor start and cylinder action, to ensure that the equipment runs according to the predetermined program;

[0125] Simulate the axis running status: simulate the axis running status in the drive simulation execution unit, including load and torque, axis positioning, to ensure that the simulated operation is consistent with the actual operation, providing a basis for subsequent monitoring and calibration;

[0126] Simulate cylinder action: Simulate the action of the cylinder in the drive simulation execution unit, including push and retract operations, to ensure that the simulation process is consistent with the actual production operation.

[0127] In this embodiment, step S50 includes:

[0128] Real-time monitoring of system operation status: Real-time monitoring of system operation status in the monitoring and proofreading unit, recording various operation data, and timely discovery and resolution of problems through monitoring system operation status;

[0129] Proofreading simulation execution unit operations: Proofreading the operation of the driving simulation execution unit in the monitoring proofreading unit to ensure that each operation is accurate, output the proofreading results, and provide data support for abnormal reports;

[0130] Output exception report: Output exception report in the monitoring and proofreading unit to record abnormal situations that occur during operation, ensure that the exception report is accurate and detailed, and provide a basis for subsequent adjustments and optimizations.

[0131] Confirm abnormal reports: Confirm the abnormal reports output by the monitoring and proofreading unit to ensure that the reports are correct and provide reliable data support for subsequent peripheral communications and actual control.

[0132] This embodiment enters the actual peripheral communication unit for control after confirmation. Specifically, step S60 includes:

[0133] Configure motion board: Configure the motion board in the peripheral communication unit to ensure accurate transmission of motion control signals and achieve precise control of the equipment;

[0134] Configure IO control card: Configure the IO control card in the peripheral communication unit to ensure accurate input and output control of digital signals and achieve real-time control and monitoring of the equipment;

[0135] Configure 485 module: Configure the 485 module in the peripheral communication unit to ensure stable communication and achieve reliable data transmission between multiple devices;

[0136] Configure 232 communication module: Configure the 232 communication module in the peripheral communication unit to ensure stable data communication and achieve seamless connection with external devices;

[0137] Activate the peripheral communication unit: After confirming that the abnormal report is correct, activate the peripheral communication unit to control the equipment and ensure that various communication modules (such as motion board, IO control card, 485 module, 232 communication module) work normally.

[0138] In this embodiment, after controlling the actual peripheral communication unit, the whole system is tightly integrated tested and optimized. Specifically, step S70 includes:

[0139] Conduct comprehensive testing: Conduct comprehensive testing of the entire system to ensure that each module is working properly, adjust system parameters, and optimize overall performance;

[0140] Optimize communication data return flow: By optimizing the communication data return flow process, efficient communication between HMI and programmable controller can be achieved, ensuring the stable operation of the system comprehensive display program;

[0141] Analyze data model: Analyze the data model collected by the data acquisition unit and transmit it to the corresponding API interface of the digital simulation system to ensure that the data model is accurate and timely and provide basic data for the simulation system;

[0142] Execution results: The programmable controller simulator in the server unit obtains data, performs program analysis and judgment, and outputs it to the drive simulation execution unit to execute the corresponding operation results;

[0143] Closed-loop monitoring: Closed-loop monitoring is performed through the data acquisition unit and the monitoring and proofreading unit, the drive simulation operation module is proofread, and abnormal reports are output to achieve stable control.

[0144] like Figure 3 As shown, the example verification process of this embodiment is as follows:

[0145] Install the smart traffic light example project:

[0146] By acquiring the data model of the actual intersection, such as road width, actual operating speed and number of vehicles, the digital simulation system can be automatically operated;

[0147] Analyze and process project data:

[0148] Analyze and process data from the smart traffic light example project to ensure the accuracy of the model data, and transmit it to the simulation system for processing and feedback;

[0149] Testing and Optimization:

[0150] Implement multiple tests and optimizations on the smart traffic light example project to ensure accuracy and reliability in actual applications;

[0151] Record and organize test data:

[0152] Record and organize the test data and operation results of the intelligent traffic light example project to provide data support for subsequent optimization and improvement, and ensure continuous improvement and optimization of the system.

[0153] The digital simulation method of the programmable controller of the present invention can not only save the debugging time of actual production through the design of the digital simulation system, but also solve the problem of disconnection between vocational education and application projects to a certain extent, and achieve a smooth transition. The process of the present invention is simple and effective, and it is economical and practical. Especially in the process of learning and research, more real scenarios can be rehearsed by combining different data models to solve the problems encountered in actual projects, greatly increasing the control stability of actual projects, while reducing the time occupied by on-site debugging, reducing the cycle time from development to delivery, thereby achieving a virtuous cycle and ensuring the safe and reliable operation of the entire system.

[0154] To achieve the above object, the present invention also proposes a digital simulation system of a programmable controller, such as Figure 2 As shown, the system includes a server unit, a program compiling and executing unit, a data acquisition unit, a driving simulation executing unit, a monitoring and proofreading unit and a peripheral communication unit.

[0155] The server unit is used to simulate the programmable controller and realize the simulation of the programmable controller and the human-machine interface through the internal communication unit.

[0156] The server unit is the core coordination unit of the entire system, responsible for managing and scheduling all other units. Through the server unit, users can centrally manage various tasks of the system and achieve efficient resource allocation and task scheduling.

[0157] After building the server unit and confirming that the system is normal, you can start the connection and coordination work of each module of the system.

[0158] The program compiling and executing unit is used to write programs and download the programs to the program compiling and executing unit through the data interface. The program compiling and executing unit compiles user programs and performs data collection and analysis.

[0159] The main function of the program compilation and execution unit is to write, import and execute PLC programs and HMI programs, and realize the compilation and execution of user programs. The unit supports multiple programming languages ​​and development environments to ensure that users can easily write and debug programs.

[0160] The user writes the execution program and HMI program and imports them into the program compilation and execution unit. The program compilation and execution unit compiles the user program and pre-executes it in a virtual environment to detect the correctness and logic of the program.

[0161] The data acquisition unit is used to collect the actual environmental data of IoT devices and establish a data model library and digital simulation interface.

[0162] The main function of the data acquisition unit is to collect various data from the actual production environment, including analog quantities (such as temperature, size, air pressure, etc.), I / O status data, axis operation data (such as torque, speed, acceleration and deceleration, etc.) and product formulas. Through real-time data acquisition, accurate simulation of the production environment can be achieved.

[0163] The data acquisition unit collects data from various sensors and devices and transmits the data to the server unit for processing and storage. Ensuring the accuracy and timeliness of the data is the key to the success of the simulation system.

[0164] The server unit is also used to perform drive simulation on the drive simulation execution unit, including at least I / O simulation, drive simulation and peripheral simulation.

[0165] The main functions of the drive simulation execution unit are to perform I / O simulation, drive simulation and peripheral simulation, simulate input and output modules, axis operation status (load and torque, axis positioning) and cylinder action. Through simulation execution, users can verify and adjust control logic in a virtual environment.

[0166] The driver simulation execution unit uses the collected data to perform I / O simulation, driver simulation, and peripheral simulation. This unit can accurately simulate the operation of the actual device, helping users to find potential problems and optimize them.

[0167] The monitoring and proofreading unit is used to compare the execution results, output abnormality reports, and achieve differentiated display and control.

[0168] The main function of the monitoring and proofreading unit is to compare and monitor the system execution results, output abnormal reports, and achieve differentiated display and control. Through real-time monitoring and proofreading, it ensures that the system simulation results are consistent with the actual production situation.

[0169] The monitoring and proofreading unit monitors and compares the simulation results of the drive simulation execution unit in real time, generates detailed exception reports, and provides visual difference displays to help users quickly identify and solve problems.

[0170] The peripheral communication unit is used to communicate with multiple simulated programmable controllers through the Modbus TCP protocol, and to communicate with real I / O boards, driver boards and host computers.

[0171] The peripheral communication unit includes motion boards, I / O control cards, 485 modules, 232 communication modules, etc. It communicates with multiple simulated PLCs and real I / O boards, drive boards and host computers through the ModbusTCP protocol, achieving seamless connection with actual production equipment.

[0172] The peripheral communication unit communicates with multiple simulated PLCs and real I / O boards, driver boards and host computers through the Modbus TCP protocol to ensure two-way data transmission and real-time performance.

[0173] The server is also used to obtain real-time data in production, simulate the digital simulation environment of actual production, and realize offline development and initial debugging.

[0174] The digital simulation system of the programmable controller of the present invention can not only save the debugging time of actual production, but also solve the problem of disconnection between vocational education and application projects to a certain extent, and achieve a smooth transition. The process of the present invention is simple and effective, and it is economical and practical. Especially in the process of learning and research, more real scenarios can be rehearsed by combining different data models to solve the problems encountered in actual projects, greatly increasing the control stability of actual projects, while reducing the time occupied by on-site debugging, reducing the cycle time from development to delivery, and thus achieving a virtuous cycle, ensuring the safe and reliable operation of the entire system.

[0175] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A digital simulation method for a programmable controller, characterized in that: The method comprises the following steps: Step S10, building a server unit, wherein the server unit is used to simulate the programmable controller and to simulate the programmable controller and the human-machine interface through the internal communication unit; Step S20, program compilation and execution: write a program and download the program to a program compilation and execution unit through a data interface, and compile the user program, perform data collection and analysis through the program compilation and execution unit; Step S30, data collection and modeling: collect the actual environmental data of the IoT devices through the data acquisition unit, and establish a data model library and a digital simulation interface; Step S40, drive simulation: drive simulation is performed by a drive simulation execution unit, including at least I / O simulation, drive simulation and peripheral simulation; Step S50, system debugging and monitoring: comparing the execution results through the monitoring and proofreading unit, outputting an abnormality report, and realizing differentiated display and control; Step S60, communicating with multiple simulated programmable controllers through the Modbus TCP protocol in the peripheral communication unit, and communicating with the actual I / O board, driver board and host computer; Step S70, project debugging and teaching application: by writing a program and obtaining real-time data in production through the server unit, simulating the digital simulation environment of actual production, and realizing offline development and initial debugging.

2. The digital simulation method of a programmable controller according to claim 1, characterized in that: Before step S20, the following steps are also included: Determine whether the system is normal; If normal, proceed to step S20.

3. The digital simulation method of a programmable controller according to claim 1, characterized in that: The step S10 comprises: Install and configure the operating system: Install and configure the operating system on the server, select a suitable Linux distribution, and ensure that the server can run stably and connect to the network seamlessly; Configure network parameters: configure the network parameters of the server to ensure that the server can stably connect to the local area network and the Internet. The network parameters of the server include at least IP address, subnet mask, gateway and DNS; Install and configure Nginx server software: Make sure Nginx can handle external requests by editing the Nginx configuration file, setting up server blocks and virtual hosts; Configure firewall rules: Use appropriate commands to allow Nginx services and ensure the security of the server by configuring firewall rules; Perform intranet penetration: Use tools to set up tunnel services, map server local services to the external network, and ensure that devices on the same network segment can directly access the server; Select and configure server nodes: Build a multi-node distributed architecture to ensure high availability and load balancing of the system; Install the programmable controller and HMI programming software: first select the appropriate development environment and ensure that the software is compatible with the server unit system.

4. The digital simulation method of a programmable controller according to claim 1, characterized in that: The step S20 comprises: Write programmable controller control programs: define equipment control logic and processes, including input and output control, logical operations and timing control, and ensure that the program logic is correct and the structure is clear; Write HMI programs: design the user interface to display system status, real-time data and control options, and ensure the interface is intuitive and user-friendly; Import program compilation execution unit; The step of importing the program compiling execution unit comprises: Import the PLC program and compile and test: Import the PLC program into the program compilation execution unit, compile and test it to ensure that the program is correct and can run normally in the simulation environment; Import HMI program and compile and test: Import the HMI program into the compilation execution unit, compile and test it to ensure that the interface interacts correctly with the programmable controller program, and that data is displayed in real time and control instructions are accurately transmitted; Download the program to the server unit: Download the compiled PLC and HMI program to the PLC and HMI simulator of the server unit to ensure that the program can run normally in the simulation environment and is consistent with the actual device.

5. The digital simulation method of a programmable controller according to claim 1, characterized in that: The step S30 comprises: Configure data acquisition unit: Configure the data acquisition unit, which includes A / D simulation module, I0 status data acquisition module, axis operation data acquisition module and product formula data acquisition module to ensure accurate and real-time data acquisition and provide necessary input data for the simulation system. Install sensors and data acquisition modules: Ensure that the temperature and pressure sensors of the field equipment are installed so that the environmental parameters can be accurately collected in the data acquisition unit. The sensor signals are transmitted to the data acquisition unit through the A / D converter for use by the simulation program; Connect IO module: Connect the IO module of the data acquisition unit to ensure normal signal transmission, collect various digital signals in the system, and transmit them to the programmable controller for processing; Install the shaft operation data acquisition module: Install and configure the shaft operation data acquisition module in the on-site equipment to collect the shaft's torque, speed, acceleration and deceleration operation data to ensure that the data is real-time and accurate, and provide basic data for the dynamic simulation of the simulation system; Configure product formula data collection module: Configure the product formula data collection module to collect and manage various formula data used in the production process, ensure the accuracy and completeness of the formula data, and provide necessary parameters for the simulation system.

6. The digital simulation method of a programmable controller according to claim 1, characterized in that: The step S40 comprises: Install drive simulation equipment: Install drive simulation equipment, including motors, cylinders and other actuators, and configure the control modules of these devices to ensure timely response and precise control. Analog output control: The analog drive execution unit simulates the output control, including controlling the motor start and cylinder action, to ensure that the equipment runs according to the predetermined program; Simulate the axis running status: simulate the axis running status in the drive simulation execution unit, including load and torque, axis positioning, to ensure that the simulated operation is consistent with the actual operation, providing a basis for subsequent monitoring and calibration; Simulate cylinder action: Simulate the action of the cylinder in the drive simulation execution unit, including push and retract operations, to ensure that the simulation process is consistent with the actual production operation.

7. The digital simulation method of a programmable controller according to claim 1, characterized in that: The step S50 comprises: Real-time monitoring of system operation status: real-time monitoring of system operation status in the monitoring and proofreading unit, recording various operation data, and timely discovery and resolution of problems through monitoring system operation status; Proofreading simulation execution unit operations: Proofreading the operation of the driving simulation execution unit in the monitoring proofreading unit to ensure that each operation is accurate, output the proofreading results, and provide data support for abnormal reports; Output exception report: Output exception report in the monitoring and proofreading unit to record abnormal situations that occur during operation, ensure that the exception report is accurate and detailed, and provide a basis for subsequent adjustments and optimizations. Confirm abnormal reports: Confirm the abnormal reports output by the monitoring and proofreading unit to ensure that the reports are correct and provide reliable data support for subsequent peripheral communications and actual control.

8. The digital simulation method of a programmable controller according to claim 1, characterized in that: The step S60 comprises: Configure motion board: Configure the motion board in the peripheral communication unit to ensure accurate transmission of motion control signals and achieve precise control of the equipment; Configure IO control card: Configure the IO control card in the peripheral communication unit to ensure accurate input and output control of digital signals and achieve real-time control and monitoring of the equipment; Configure 485 module: Configure the 485 module in the peripheral communication unit to ensure stable communication and achieve reliable data transmission between multiple devices; Configure 232 communication module: Configure the 232 communication module in the peripheral communication unit to ensure stable data communication and achieve seamless connection with external devices; Activate the peripheral communication unit: After confirming that the abnormal report is correct, activate the peripheral communication unit to control the equipment and ensure that all types of communication modules are working properly.

9. The digital simulation method of a programmable controller according to claim 1, characterized in that: The step S70 includes: Conduct comprehensive testing: Conduct comprehensive testing of the entire system to ensure that each module is working properly, adjust system parameters, and optimize overall performance; Optimize communication data return flow: By optimizing the communication data return flow process, efficient communication between HMI and programmable controller can be achieved, ensuring the stable operation of the system comprehensive display program; Analyze data model: Analyze the data model collected by the data acquisition unit and transmit it to the corresponding API interface of the digital simulation system to ensure that the data model is accurate and timely and provide basic data for the simulation system; Execution results: The programmable controller simulator in the server unit obtains data, performs program analysis and judgment, and outputs it to the drive simulation execution unit to execute the corresponding operation results; Closed-loop monitoring: Closed-loop monitoring is performed through the data acquisition unit and the monitoring and proofreading unit, the drive simulation operation module is proofread, and abnormal reports are output to achieve stable control.

10. A digital simulation system of a programmable controller, characterized in that: The system includes a server unit, a program compilation and execution unit, a data acquisition unit, a drive simulation execution unit, a monitoring and proofreading unit and a peripheral communication unit; The server unit is used to simulate the programmable controller and realize the simulation of the programmable controller and the human-machine interface through the internal communication unit; The program compiling and executing unit is used to write a program and download the program to the program compiling and executing unit through a data interface, and the program compiling and executing unit compiles the user program and performs data collection and analysis; The data acquisition unit is used to collect the actual environmental data of IoT devices and establish a data model library and digital simulation interface; The drive simulation execution unit is used to perform drive simulation, including at least I / O simulation, drive simulation and peripheral simulation; The monitoring and proofreading unit is used to compare the execution results, output abnormal reports, and achieve differentiated display and control; The peripheral communication unit is used to communicate with multiple simulated programmable controllers through the Modbus TCP protocol, and to communicate with the real I / O boards, driver boards and host computers; The server is also used to obtain real-time data in production, simulate the digital simulation environment of actual production, and realize offline development and initial debugging.