08-10-2011 01:11 PM
I typically flatten the variant to xml using the aptly named Flatten to XML function.
08-10-2011 01:30 PM
Well since you really want to walk THAT path...
JPD developed code that is now part of Open_G that parses variants.
You could either use his coe or look at what he is doing and apply it to your situation.
Ben
08-10-2011 01:48 PM
You may want to take a look at the Read/Write Anything VIs from Moore Good Ideas. They can take any cluster and write it to an INI file. The code is mostly unlocked so you could probably modify it to write to any other format you need.
08-10-2011 01:57 PM
Yes that is another good example to harvest.
My nugget on control refs may be of some use.
But building off what Dave showed us...
restrcture the clusters as string (or enum) and a variant. That way all of the cluster will be converted the same way. Pull the variant from that conversion to a sub-VI that coresponds with the cluster type (driven by the string or the enum) and inside the appropriae sub-VI convert the sub-varian to the proper cluster type.
Ben
08-10-2011 02:14 PM
Perhaps you could use something like this.
08-11-2011 07:41 AM
Take a look at the OpenG Variant Configuration File Library . In particular Write Section Cluster It does something very similar to what you need and should be easy to modify.
08-11-2011 08:37 AM
Wow, thanks to everyone! This is very helpful and I will start working through your suggestions.
Erik
08-11-2011 08:42 AM
In the end of it all, I still believe the LVOOP approach is elegant, easy to maintain and robust.
negative:
Learning curve.
Ben
10-21-2015 04:26 PM - edited 10-21-2015 04:31 PM
[Wayne C writes: "Take a look at the OpenG Variant Configuration File Library . In particular Write Section Cluster It does something very similar to what you need and should be easy to modify"]
I was curious about your proposed solution... I put together something really fast just to see if it would work... and it did! disclaimer: it might not be the most elegant solution
See attachment -compiled in LabVIEW 2015-
10-21-2015 10:22 PM
You also might consider upgrading to LabVIEW 2015
I have not looked into these functions myself but.....I have a bit of faith
4 years of NI R&D efforts since the last post might have obsoleted your efforts