From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nugget - Using control references

Great example of using control references, I actually started doing the same thing a few weeks ago, but then I learned that I could flatten my cluster to XML with a single VI.

cluster to xml.PNG 

0 Kudos
Message 61 of 67
(1,610 Views)

Sounds good.  Is there any way to see this with the funtion titles turned on?

0 Kudos
Message 62 of 67
(1,584 Views)

There might be better ways to do this, but this is what I did and thought it was extremely easy.  I've also included how I did the read from Config.

cluster to xml2.PNG

xml to Cluster.PNG

0 Kudos
Message 63 of 67
(1,567 Views)

Thanks, it's those little extra clues, like identifying the hieroglyphys out of the thousands of LabVIEW functions, that makes your great idea more useable to others.  The Config read algorithm is especially helpful.

0 Kudos
Message 64 of 67
(1,557 Views)

I'm kind of new to these forums and never even thought about checking to see if my function titles were visible.  To be honest I didn't expect anyone would actually see my post.  Thanks for catching my oversight.

0 Kudos
Message 65 of 67
(1,552 Views)

It's generally useful to use snippets instead of simple images, because people can drag those into LV to convert them back to actual code. I would suggest using the Code Capture Tool for creating snippets over the built-in snippet feature, as it has a number of advantages.

 

As for your actual reply, a couple of comments:

 

  1. LV also has JSON primitives, which generally make the resulting content more readable.
  2. I believe both the JSON primitives and the XML primitives don't handle missing elements well. This means that if you modify your cluster and then attempt to load an old file, the load will fail. I haven't checked this recently, but I'm fairly sure this is still the case. Other tools, like the OpenG config VIs or the MGI R/W anything VIs, don't have this issue and are easier to use, so I much prefer using them.

___________________
Try to take over the world!
0 Kudos
Message 66 of 67
(1,531 Views)

@Fewoiz wrote:

Great example of using control references, I actually started doing the same thing a few weeks ago, but then I learned that I could flatten my cluster to XML with a single VI.


You should check out OpenG and MGI's toolkits.  Both of them have good libraries for writing clusters to ini files.  Might work a little better than XML.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 67 of 67
(1,526 Views)