The CANopen stack provides service functions, a callback interface and a system object type for managing parameters. The parameters are handled in parameter groups. The parameter group memory must be a consecutive memory area. The recommended way to allocate this memory area is shown in the following example:
Code Block | ||
---|---|---|
| ||
struct DEMO_PARA_T {
CPU_INT32U ParaLong; /* 32bit demo parameter */
} DemoParaMem; |
The parameter group object holds all necessary information, which are needed for the parameter handling. Note: this structure may be placed into ROM, because it holds only constant values.
Code Block |
---|
const CO_PARA {
sizeof(struct DEMO_PARA_T), /* size of parameter memory */
&DemoParaMem, /* start address of parameter mem */
&DemoParaDef, /* start address of default para. */
CO_RESET_NODE, /* reset type for reload parameter */
(void*)"DemoParaId", /* user parameter identification */
CO_PARA___E /* read value of parameter object */
} DemoParaObj; |
If this parameter group must be controllable from the CAN network side, the standard parameter save object (and optionally the parameter load object) must be placed into the corresponding place of the object directory:
...
The following diagram shows the internal behavior of storing a parameter object:
Panel | ||||
---|---|---|---|---|
| ||||