PLC Simulator Virtual Clock Execution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current methods for simulating programmable logic controllers (PLCs) face challenges such as high setup effort, complexity in integrating simulation systems, additional costs, and risks of code modifications affecting timing and accuracy during testing and commissioning.
Innovation Solution
A system that separates control and simulation programs within the same runtime environment, using a virtual clock to execute simulation code between program cycles, ensuring no changes to the user program and maintaining real-time timing, allowing for switchable simulation without additional hardware and enabling quick mode changes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a simulation environment is used to test the controller, then realistic testing is enabled, but setup effort and system complexity increase considerably
Solution Approach 1:
The patent merges the simulation environment and the programmable logic controller into a single integrated system. The simulation unit is implemented as a software module within the PLC itself, allowing the controller to simulate its own target system. This eliminates the need for separate external simulation systems while enabling realistic testing during commissioning phases.
Solution Approach 2:
The PLC is designed to perform multiple functions: it can operate as a real controller during productive operation and as a simulation system during commissioning and testing. The simulation unit can be activated or deactivated based on the operational phase, making the same hardware platform universally applicable for both control and simulation purposes.
2Reliability
If additional simulation hardware and software are deployed, then simulation capability is improved, but system costs and setup effort increase
Solution Approach 1:
The PLC performs simulation functions using its own internal resources - its processor, memory, and existing communication interfaces. The simulation unit is implemented as software code within the PLC, utilizing the same hardware platform already available for control operations. This self-service approach eliminates the need for additional dedicated simulation hardware and reduces setup effort.
3Adaptability or versatility
If simulation code is executed during productive operation, then code versatility is improved, but timing accuracy and performance deteriorate
Solution Approach 1:
The patent implements a dynamic execution model where the simulation unit can be activated or deactivated based on the operational phase. During commissioning and testing, the simulation unit is active. During productive operation, it is deactivated. This dynamic switching ensures that simulation code does not interfere with the timing-critical control operations while maintaining code versatility for different operational phases.
Solution Approach 2:
The simulation unit operates in periodic cycles during commissioning, executing simulation logic at intervals that match the PLC's scan cycle. This periodic execution pattern allows the simulation to run without disrupting the deterministic timing requirements of the control program, as both operate in synchronized periodic fashion during testing phases.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
The invention essentially relates to a system and a simulator for the switchable simulation of plants or machines within programmable logic controllers (PLCs), in which the control program and the simulation program are consistently separated within the same execution environment. The access direction for the input/output memory area is ensured during normal operation, and its consistent reversal is guaranteed during the simulation phase. The simulation program is executed between program cycles, with a virtual clock being paused during the simulation. This avoids errors caused by code changes during the commissioning or testing phase by testing an unmodified user program in the PLC. Furthermore, by replicating the timing behavior of the actual plant, particularly during timer tests and race conditions, higher program quality is achieved through improved test results. The use of multiple processor cores is also possible.Since the simulator runs in the same controller as the actual control code, no additional test hardware is required, and the quick switchover between test and production modes saves further time. If the simulator remains on the controller, test scenarios are readily available in case of a malfunction.