Flexible Settings Files

Discover an example in how we take advantages of the oop in labview. Here we talk about interface for adapt data in configuration files.

Setting files as ini, xml, json, csv, binary it’s used to give flexibility by parametrization the application after compiled.

IN our experience we use Cluster to transport the all setting data, it’s readable and easy to use for both the type of files.

But in our libraries each time the cluster need to change, and we need a more flexible type of data.

The Variant is the first opportunity, but need a lot of work for flatten, unflatten.

The Naturally Hierarchly architectures of the classes inspire us to take also the data as a class.

Then the idea is to create a parent data “SettingData” and we create the desired setting data as a child, without change the functional code as Read/Write method that remain only in the parent class.

The advantage is:

1-No need to create vi adapted for the class, or no need to create code to adapt variant.

2-Polymorphic at runtime

3-Protect Data

Not simply to start in the concept and in the organization on the disk, but after some experiment and a couple of hour to take confident in use it, is useful.

The class XML-Class is the parent and it’s the place where the data are.

Only need to add a class, inherit from the XML Class and then create the controls and the accessors to set and get the data.

ti potrebbero interessare

LabVIEW Functional Global Variable

La Functional Global Variable (FGV) è un design pattern molto utilizzato in quanto gestendo una memoria internamente ed essendo non rientrante viene spesso utilizzato per evitare race condition. In realtà

LANGLOC – tradurre le etichette dei controlli in modo automatico

Quante volte ci capita di dover modificare il testo delle etichette sulle Interfacce e magari ci è stato richiesto che questo sia fatto dopo aver compilato il nostro eseguibile. Un

LabVIEW Practice

Il corso labview pratico ha la finalità di accelerare il tuo progetto, mettendo l'esperienza di anni di sviluppo labview, portando il partecipante direttamente sul percorso più efficace.

Vuoi approfondire l'argomento? Hai un progetto e stai cercando un Team che ti possa supportare?