DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Roast my Design

@AlexElb wrote:

For my files I just use Flattern from/to XML, which seems to work fine until now.


Just to be clear, I wasn't suggesting JSON as just a "file format"; I was suggesting using JSON strings internally to the program for all passing of configuration data between components.  This is vastly simpler than a massive LVOOP architecture.

0 Kudos
Message 11 of 15
(1,033 Views)

Just to be clear, I wasn't suggesting JSON as just a "file format"; I was suggesting using JSON strings internally to the program for all passing of configuration data between components.  This is vastly simpler than a massive LVOOP architecture.

Thank you for the clarification, I indeed thought you would only use it for saving and loading, not for communication between components. While it seems very elegant for the communication aspect, I wonder how you handle it inside your components.

 

Let us stay in the DQMH world. So we have our Module Data Type Def in the shift register of the MHL. I expect you hold your configuration data inside there too, don't you? In a big Cluster, in a Class, how?

Do you have read/writeSettingXyFromModuleData.vi with a TypeDef to use the setting inside the module?

 

And last but not least: How do parse the JSON to see which settings changed? I think this is the most important question, because we have to specifically react to some setting changes, don't we? So if I use JSON and a library, like "JSON Object Serialization v2.2.0.3 by G Craftsman" I just found on VIPM, I would only shift my problems into my modules, won't I?

 


Proud developer at Hampel Software Engineering where we turn '404 not found' into '200 OK'. Join us on Discord
0 Kudos
Message 12 of 15
(1,024 Views)

@AlexElb wrote:

Let us stay in the DQMH world. So we have our Module Data Type Def in the shift register of the MHL. I expect you hold your configuration data inside there too, don't you? In a big Cluster, in a Class, how?

Do you have read/writeSettingXyFromModuleData.vi with a TypeDef to use the setting inside the module?


There is a variety of options, but I often have a (non-type-def) cluster in a shift register called "Config" that holds the config info.  Then I just convert to/from JSON using standard JSONtext functions.   Example:

Get Config as JSON.png

 

Set Config from JSON.png

If I have Objects to save, then I need to have Get/Set JSON methods to do that, but internally these just use JSONtext subVIs in a similar way.  Then that JSON is combined with other config JSON, again using simple JSONtext functions.

 

Message 13 of 15
(1,016 Views)

@drjdpowell wrote:
@AlexElb wrote:

For my files I just use Flattern from/to XML, which seems to work fine until now.


Just to be clear, I wasn't suggesting JSON as just a "file format"; I was suggesting using JSON strings internally to the program for all passing of configuration data between components.  This is vastly simpler than a massive LVOOP architecture.



Is there an advantage over Variant?

0 Kudos
Message 14 of 15
(988 Views)

@M.Lichtenheld wrote:
Is there an advantage over Variant?

Variants just wrap existing LabVIEW datatypes, none of which are as easy to work with nested tree-like data as JSON.  

0 Kudos
Message 15 of 15
(967 Views)