Using Non-Volatile Memory

Epec devices have non-volatile memory which is used to store parameters and to log information. Parameters are variables that are stored into non-volatile memory, they keep their values after boot up.

 

The parameter system is based on the CANopen Object Dictionary (OD). The Object Dictionary is an interface between the application and CAN bus. All variables, that should be accessible via CAN bus, have to be defined in the device's OD. MultiTool Creator automatically creates OD(s) and all needed platform specific initializations for Epec devices.

 

The possible variable types are:

- RAM: Variables exist only in the device’s RAM memory, on reboot the values return to default

- Parameter: A variable can be saved to the device’s non volatile memory

- Retain(*): Automatically written to the non-volatile memory, the value returns to default when a new application is downloaded. Supported for ArrayOf and Record index types.

- Retain Persistent(*): Automatically written to the non-volatile memory, the value is retained even if a new application is downloaded to the device. Supported for ArrayOf and Record index types.

- Safety Parameters(*): A variable can be saved to the device's non-volatile memory. Authentication is required to adjust safety parameters. Parameter validity is checked during every boot-up.

 

* The variable type possibilities depends on the hardware

 

Retain and Retain Persistent variables are automatically written to non-volatile memory. The following chapters do not apply to them.

 

The following chapters describe

 

 

To use parameters, CANopen must be initialized.

 

It is possible to use OD backup functionality for E series and S series devices. It can be taken into use from the MultiTool library manager. For more information, see Epec Programming & Libraries manual, section Using NVRAM.

 

Keyword - Protecting Application Parameters

S series / E Series products do not use the file system library and the variable names differ from the names in this chapter. However, the functionality is the same.

 

MultiTool Creator automatically creates a keyword protection for each application so that it is not possible to use of another application's parameters. The keyword is a fixed numeric value, stored in a global variable G_FileSysKeyWord. The keyword is created for each device that is added to a MultiTool Creator project. This value is saved to non-volatile memory together with parameters.

 

When the file system is initialized, this value is given for the file system and checked if it corresponds to the saved value. The keyword can mismatch, if a different application is downloaded to the device. If there is a mismatch, the file system is formatted and all parameters reset to their default values. Keyword mismatches can be seen after file system initialization in a Filesys librarys global variable G_FileSysFileSystem, as seen in the following image.

 

 

Storing (1010h) and Restoring (1011h) Parameters

 

The CANopen standard defines two indexes for parameter handling: store and restore default parameter. The standard provides also manufacturer specific sub-indexes which are used in MultiTool Creator to define application specific storing and restoring index ranges.

 

Saving parameters into the device's non-volatile memory is done by store parameters index (1010h). By restore default parameters index (1011h) the default values of parameters are taken into use. The selected sub-index defines the parameter range to be saved / restored:

 

Storing and restoring parameters functionality is only executed when a specific signature is written to the appropriate sub-index. The signatures are "save“ and "load“ in ASCII, see the following tables.

 

Saving signature:

 

MSB

 

 

LSB

ASCII

e

v

a

s

hex

65h

76h

61h

73h

 

Restoring signature:

 

MSB

 

 

LSB

ASCII

d

a

o

l

hex

64h

61h

6Fh

6Ch

 

Application Specific Storing and Restoring Sub-Indexes

The CANopen standard defines the sub-indexes 1-3, Epec reserves the fourth sub-index. The application can use sub-indexes 5-127 to define the application specific store/restore areas.

To define the application specific store and restore areas, open the Object Dictionary tab and select icon. This will open the Store / Restore Settings (see the following image).

To add sub-indexes, select icon. Then, define the index range for storing/restoring to Start and End Index.

To delete a sub-index, first select the sub-index and then delete icon.

 

 

 

 

See also,

 

 

Epec Oy reserves all rights for improvements without prior notice.

 

Source file topic200085.htm

Last updated 26-Nov-2024