PLC CPU Global Variable Consistency via Synchronous Buffers
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In Programmable Logic Controllers (PLCs), ensuring consistency of global variables across multiple control programs without requiring explicit handling by each control program, while allowing concurrent execution without long-term access restrictions, is challenging due to the need for managing shared variables among multiple processes.
Innovation Solution
A CPU unit in the PLC is configured with a microprocessor, memory, and communication circuit, using a system program that generates synchronous buffers for each global variable, allowing owner-side and referrer-side control programs to manage access and data consistency through specific execution and copy processes, ensuring that referrer-side programs can access the latest data without blocking concurrent execution.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If exclusive control is performed to ensure consistency of global variable, then calculation consistency is ensured, but other control programs are blocked for long period
Solution Approach 1:
The patent segments the global variable access mechanism into two distinct components: synchronous buffers for reading and the global variable area for writing. This segmentation allows referrer-side control programs to access consistent data from synchronous buffers without blocking owner-side control programs that need to modify the global variable area, thereby resolving the contradiction between calculation consistency and concurrent execution capability.
Solution Approach 2:
The synchronous buffer acts as an intermediary between the global variable area and referrer-side control programs. Instead of directly accessing the global variable area during execution, referrer-side programs access the synchronous buffer which contains a copy of the data. This intermediary mechanism ensures calculation consistency while allowing concurrent execution without long-term blocking.
2Reliability
If control program copies global variable to local variable before use, then calculation consistency is ensured, but processing burden is increased
Solution Approach 1:
The system provides self-service by automatically maintaining synchronous buffers that contain consistent copies of global variable data. Referrer-side control programs can directly access these pre-prepared synchronous buffers without needing to implement their own copying mechanisms, thereby ensuring calculation consistency while reducing program complexity and processing burden.
Solution Approach 2:
The system performs preliminary action by pre-copying global variable data to synchronous buffers before referrer-side control programs need to access them. This advance preparation ensures that consistent data is already available when needed, eliminating the need for control programs to perform copying operations themselves and reducing overall processing complexity.
3Reliability
If waiting is performed until global variable rewriting does not affect other programs, then calculation consistency is ensured, but execution time is increased
Solution Approach 1:
The patent segments the data storage into synchronous buffers and global variable area, allowing referrer-side control programs to access the synchronous buffer immediately without waiting for the owner-side control program to finish rewriting the global variable area. This segmentation eliminates waiting time while ensuring calculation consistency through the use of pre-copied data in the synchronous buffer.
Solution Approach 2:
The synchronous buffer serves as an intermediary that decouples the timing of data writing and reading operations. Referrer-side control programs can access the synchronous buffer immediately without needing to wait for global variable rewriting to complete, as the synchronous buffer already contains the necessary data. This intermediary mechanism eliminates execution delays while maintaining calculation consistency.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
The system program includes, as an execution control process of the control program, an owner-side start process that starts execution of an owner-side control program; a copy process in which, when execution of the owner-side control program ends, a global variable that is rewritten by the owner-side control program is copied from a global variable area to a synchronous buffer corresponding to the global variable; and a referrer-side start process that starts execution of a referrer-side control program.