top of page

How to manage a fixed data set

When you have a set of fixed data within your program (for example, data that identifies the mode of a job, or data that indicates the delay before turning on an output), the best way to manage, load, save, etc. it is to define data structure types (typedef structs), in which the fixed data is defined, and to define a set of functions for various operations related to the data (such as resetting it to its default values, etc.).

The data structure is declared in common.h (or in a .h file included in common).

Within the same .h file I also define the functions and variables to perform operations with the data.

Example:

Below we also report a real application example with comments

 

Real Example

banda 1_#rect222.png

SYEL SRL Industrial Automation Electronic Systems

PI/CF 01140840503     Via Liguria, 1     56030 Pontedera Gello (PI), Italy

Phone: ++39 0587 294096      e-mail: syel@syel.it     PEC: syel@pec.it

unique recipient code 5RUO82D

banda 2_#rect222.png

SYEL SRL Industrial Automation Electronic Systems

PI/CF 01140840503     Via Liguria, 1     56030 Pontedera Gello (PI), Italy

Phone: ++39 0587 294096      e-mail: syel@syel.it     PEC: syel@pec.it

unique recipient code 5RUO82D

bottom of page