Have you ever had the situation where an application you were using suddenly quits and after a restart you discover you have lost all your work? (If not, then you will someday!) This blog discusses how Cimetrix CimControlFrameworkTM handles this situation.
What is persistence and why you should use it?
The problem:
During execution of any and all applications, there is always a risk of execution termination: closing the application prematurely, power loss to the computer, or program malfunction. Normally programs have data in memory that represent the essential data and states of the application up to that point. When execution is halted unexpectedly, all information that has been accumulated up to that point is in jeopardy of being lost and unrecoverable because what is in memory is not persistent in nature. After the program terminates, any data stored in memory is gone.
Solution:
A typical solution is to immediately write data to disk as essential data is created or changed. It is typical to save such data in one or more files to implement a complete persistent storage mechanism. This effectively makes each data item “persistent” so that essential information is never lost, even if the program terminates. An application can then recover from unexpected termination by reading the persistent file(s) when the application is re-launched and restoring each data item to its last saved value.
Persistence in CCF:
Two examples of persistence in CCF are explained in the following section.
NVS (Non-Volatile Storage)
When the Tool Supervisor application or a GEM host changes the value of a persistent variable, the new value is stored in a corresponding file in CCF’s NVS facility. When the Tool Supervisor restarts, the values from the NVS files are read and applied to the affected variables during equipment application initialization.
Material Tracking
The CCF product includes data persistence for material (substrates) so that if the equipment application were to terminate, the persisted information about material and its last known movements is loaded and visualized on the GUI.
The Material Tracking package provides a specific service to store the current state of material within the equipment. When enabled, each material movement will be recorded into a “material map” file on the disk.
A maintenance GUI screen is also provided so the user can identify material that is no longer present, or that is at a different location than last saved. A function to move material out of the equipment is provided to facilitate the recovery process.
Job data persistence
Now let’s discuss how to implement a feature for job data persistence. Job data are sets of values that tell the equipment how to move and process each material item. There are two types of Jobs: Control Jobs and Process Jobs.
- Process Job: Associates a list of material with a recipe.
- Control Job: Collection of process jobs. Also contains material destination information.
Implementing job data persistence in CCF:
1. What to Persist
The Cimetrix CIM300 product (installed with CCF) manages the lifecycle of SEMI E39 Objects for ProcessJobs and ControlJobs. CCF creates job-related data at runtime and stores this data in the ControlJobData and ProcessJobData classes. Additionally, the object attributes and states should also be persisted and later restored. Both CCF and CIM300 keep a list of the instantiated ControlJobs and ProcessJobs.
CCF Objects to Serialize/Deserialize
CIM300 Objects and API to Serialize/Deserialize
2. Create a Persistence Package
CCF contains a Material Tracking package which has been developed to provide persistence for materials and locations. Let’s define a similar code package with a class (AllJobs) that will contain the serialized strings to be written to disk.
2.a When to write ALLJobs data to disk:
- On SerializedJobsChanged event (add if not handled)
- At start-up immediately after attempt to Load in order to force writing the persistence file for the first time.
- On any CIM40 Callback from CIM300
- On any CIM94 Callback from CIM300
- On SchProcessJob instantiation
The figure below illustrates how the persisted data is written.
2.b When to read ALLJobs data from disk:
- Once on Tool Supervisor start-up after StartFactoryAutomation() but before starting EquipmentControlSystem().
The figure below illustrates how the persisted data is read and applied.
Conclusion
Data persistence is a crucial aspect of any application to prevent the loss of essential information in the event of unexpected termination. By immediately writing data to disk in persistent files, applications can recover from these scenarios and restore data to the last saved values. In the case of Cimetrix CCF software, persistence is implemented through NVS and material tracking, ensuring that variables and material movements are stored and can be visualized even after equipment application termination. To learn more about how CCF handles data persistence and other features, we encourage you to reach out and speak with an expert by clicking the button below.