Skip to main content
FW version: Stable

emGUI basics III : Memorizing

this tutorial shows how not to lose those precious adjustments.

info
  • Let's presume that you made some value changes and may want to save them for the future.

Tracking the changed parameters

For overview, it is useful to see which parameters have non-default values. The diff tool filters out everything but parameters with non-default values:

emgui

Saving and loading parameters on board

All parameters, that have been modified, will hold their new values only until device reset. To save the values inside the device's non-volatile memory, you need to issue the save command. Similarly, to discard the modifications, you can issue the load command. The easiest way to reach these is through the device's context menu (right-click on the node). From the menu, select Save/load parameters ... :

emgui

A prompt dialog will appear. If you wish to save the values, select Save. If you wish to discard the changes and use values stored in the non-volatile memory, select Load. Optionally, there is also the Backup storage.

info

The backup storage allows you to back up and restore your current values at any point. On the contrary to the main storage, the backup storage is reserved for the user and is not automatically accessed by the system.

emgui

Restoring parameters to their defaults

Sometimes, you may want to restore all the parameters to their defaults (put the device into factory settings). The easiest way to do that is through the device's context menu (right-click on the node). From the menu, select 'Restore parameters ...'. You will see a simple pop-up dialog with a confirmation button.

emgui

tip

You may also restore a single parameter by selecting its default preset in the parameter's dialog.

warning

Global restoring will apply the default values, but not save them. If you want to keep the defaults after restart, make sure to save them on board.

Exporting and importing variables to/from a file

When you are satisfied with the changes, you may want to export the variables (and values) to a file. If the entire device is of interest, choose File->Export variables to file (or click on the shortcut icon). You may specify the name of the file, or use the autogenerated name:

emgui

tip

Most likely, only non-default parameters shall be exported. This is the most typical use case of saving a "configuration file" for a device. You may clone one device's set-up to another, or maintain your own sets of parameters for different integrations. It is not recommended to un-check Non-default only. This will cause all parameters to be exported and the resulting file has a higher probability of being incompatible with firmware upgrades.

For activation, debugging or R&D, you may wish to select other variable types for export as well (permanents/states/dynamic vars).

The generated file with variables and values looks like this:

# emgui version: 2.11.3
# time generated: 2023-12-11, 17:07:07
#
# basename: 'fn'
# hwid: 'esc5-ax1d_05kxa0810-800'
# swid: 'BLDC_OPHION_generic v4.2.0-punk Jul 20 2023'
# s/n: '895FMP114D4D'
# uuid: '20383935464D5011004D004D'
# class: '0E:AX'


# type : 'parameter' (non-default value)
"/driver/iref" : "60.0"
"/driver/prest" : "1"

In the similar fashion, you can import the file back. Choose File->Import variables from file (or click on the shortcut icon). A dialog will appear with the filename input box and several options for related proceedings:

emgui

notice
  • Only writable variables will be imported, and only those which have been found inside the device's data model.
  • Before the import, you may want to put all parameters to their defaults first. Otherwise, the previously changed values will be kept.
  • After the import, you may want to save the variables inside the device to the non-volatile storage.

If you do not want to work with the entire device, but with a sub-tree only, navigate to the folder and select Import ... or Export variables to file through it's context menu:

emgui

tip

You may explicitly choose the variables one-by-one for export/import using Multi-selection tool. The standard way is holding the ctrl + pick your variables and folders. If a folder is selected, it will be processed recursively.

info

If the file contains a variable(s) that do not match with the user's selection in the tree, it will not be imported.

Exporting and importing variables through the system clipboard

The quick way of sharing variables is through the clipboard. You may click on a variable, or a folder, or use multi-selection:

emgui

After pressing ctrl+c (or choosing 'Copy' in the 'Edit' menu), the clipboard will hold the variables in textual form:

"/driver/supply/cap" : "0"
"/driver/supply/current" : "0.0"
"/driver/supply/currentf" : "0.0"
"/driver/supply/voltage" : "0.028445"
"/driver/energy" : "0"
"/driver/iqmult" : "1.0"
"/driver/irefr" : "0.0"

You may use this for quickly copying the values between several devices, sharing them with siliXcon online support, etc. In the same way, just pasting with ctrl+v (or choosing 'Paste' in the 'Edit' menu), will import the variables from the clipboard.

info

When using the clipboard, all variable types will be exported and only writable ones will be imported.