Skip to main content
Firmware Stable

emGUI basics III: Memorizing

This tutorial shows how not to lose those precious adjustments.

info
  • Assume that you have made some value changes and want to save them for the future use.

Tracking the changed parameters

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

emgui

Saving and loading parameters on board

All modified parameters, will retain their new values only until a device reset. To save the values to the device's non-volatile memory, you need to issue the Save (Check consistecy and save parameters) command. Similarly, to discard the modifications, issue the Load (Load previous parameters and pull values) command. The easiest way is to click the icons in the toolbar:

emgui

Restoring parameters to their defaults

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

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 will not save them. To retain the defaults after a restart, make sure to save them to the device.

Exporting and importing variables to/from a file

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

emgui

tip

In most cases, only non-default parameters should be exported. This is the most common use case for saving a "configuration file" for a device. You can clone one device's setup to another, or maintain your own sets of parameters for different integrations. It is not recommended to uncheck Non-default only. Doing so will export all parameters, increasing the likelihood of the resulting file 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: 3.0.0
# time generated: 2025-04-14, 13:32:44
#
# basename: 'SX-serpent'
# hwid: 'esc5-sx1e_25kxa1040-C00'
# swid: 'VECTOR_OPHION_generic v4.4.0 Jan 7 2025'
# s/n: '451VPP14264C'
# uuid: '20343531565050140026004C'
# class: '0D:SX'


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

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

emgui

notice
  • Only writable variables will be imported, and only those which have been found inside the device's data model.
  • Before importing, you may want to put all parameters to their defaults. Otherwise, the previously changed values will be kept.
  • After importing, you may want to Save the variables to the device's 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 its 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

A quick way to share variables is through the clipboard. You can click on a variable, 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 can use this to quickly copy values between devices or share them with siliXcon online support, etc. Similarly, 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.

Import variables using drag&drop

You can also import variables using drag and drop. Drag a file containing the configuration into emGUI.

warning

The configuration will be imported only to the selected folder or device. If you drop the file into the driver folder, only variables inside the driver folder will be imported.

emgui