Variable Initialization¶
When the electrical power of the Proemion device is reset, all volatile variables lose their current values and are set back to zero.
Variable Initialization allows you to define initial values for volatile variables when the device boots up.
Differences Between Non-Volatile and Volatile Variables¶
| Non-Volatile Variables | Volatile Variables |
|---|---|
| Slower value retrieval | Faster value retrieval |
| Limited number of allowable accesses (EEPROM) | Practically unlimited accesses (RAM) |
| Retains last value at Power ON | Initialized to zero or a defined value at Power ON |
Add Variable Initialization to Your Project¶
- Right-click the root entry of the Object Dictionary tree.
- Select New Object Dictionary Group > Variable Initialization from the context menu.
The Variable Initialization group is added to the Object Dictionary tree on the left side of the application.
It can be configured through the Variable Initialization window.
Variable Initialization Window¶
The Variable Initialization window allows you to set initialization values for volatile variables.
| Field | Description |
|---|---|
| Initialization Table for Volatile Variables | Displays a list of all volatile variables for which an initial value has been defined. |
| Parameter of Existing or New Table Entry | Select the variable to be initialized. The data type of the selected variable is also displayed. |
| Init Value | Defines the value used for initializing the variable. You can either enter a direct value or link it to another existing variable. |
| New Button | Creates a new entry in the Variable Initialization list. |
| Change Button | Modifies the selected entry in the Variable Initialization list. |
| Delete Button | Removes the selected entry from the Variable Initialization list. |