Compiler Global Variable Synchronization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional techniques require longer compilation times when a global variable declaration is edited, as all sequence programs referencing the global variable need to be recompiled due to changes in memory addresses.
Innovation Solution
A compiler that synchronizes the values of unedited and edited global variables by inserting 'copy' instructions in the execution code, allowing only the sequence programs referencing the edited global variable to be compiled, reducing the need for recompiling unaffected programs.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If all sequence programs referencing a global variable are recompiled when the global variable's memory address changes, then consistency of global variable values is ensured, but compilation time increases significantly
Solution Approach 1:
The patent segments the compilation process by identifying and separating sequence programs that reference edited global variables from those that do not. Only the subset of programs referencing changed global variables is recompiled, while other programs are excluded from recompilation. This segmentation resolves the contradiction by maintaining consistency for affected programs without unnecessarily recompiling unaffected ones, thus reducing overall compilation time while preserving reliability where needed.
Solution Approach 2:
The patent applies local quality by treating different sequence programs differently based on their reference relationships with edited global variables. Programs that reference edited global variables receive full compilation to ensure consistency, while programs that do not reference edited variables are excluded from compilation. This localized approach to compilation quality resolves the contradiction by applying strict consistency checks only where necessary rather than uniformly across all programs.
2Loss of time
If only sequence programs referencing edited global variables are recompiled, then compilation time is reduced, but the consistency of global variable values across all programs may be compromised
Solution Approach 1:
The patent introduces an intermediary mechanism in the form of copy instructions that transfer values from unedited global variables to edited global variables. This intermediary value transfer ensures that programs using edited global variables receive consistent values, even though not all programs are recompiled. The copy instructions act as a bridge that maintains consistency across the system boundary between recompiled and non-recompiled programs, resolving the contradiction between reduced compilation time and maintained consistency.
3Reliability
If the compiler inserts copy instructions to synchronize global variable values, then consistency is maintained with selective recompilation, but the execution code becomes more complex
Solution Approach 1:
The patent extracts the complexity of value synchronization into separate copy instructions that are inserted only where necessary in the execution code. Rather than making the entire execution code more complex, the synchronization mechanism is taken out as discrete, localized operations. These copy instructions are inserted only in programs that reference edited global variables, keeping the overall execution code complexity manageable while maintaining consistency. The complexity is isolated to specific locations rather than distributed throughout the entire codebase.
Data Source
AI summary
A non-transitory computer readable-medium storing a compiler to cause a computer to perform processing for compiling sequence programs including a declaration of a global variable and generating an execution program to be executed by a PLC. When there is a change in a memory address in the PLC assigned to the global variable between before and after edit of a declaration of the global variable, the compiler gives an execution code to synchronize a first value stored at a memory address assigned to an unedited global variable with a second value stored at a memory address assigned to an edited global variable to an execution program corresponding to the sequence program that references the edited global variable.


