cancelar
Mostrando los resultados de 
Buscar en lugar de 
Quiere decir: 

Detect data type within Variant

I typically flatten the variant to xml using the aptly named Flatten to XML function.

0 kudos
Mensaje 11 de 20
3.378 Vistas

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 kudos
Mensaje 12 de 20
3.371 Vistas

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.

0 kudos
Mensaje 13 de 20
3.362 Vistas

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

 

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 kudos
Mensaje 14 de 20
3.356 Vistas

Perhaps you could use something like this.

Mensaje 15 de 20
3.353 Vistas

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.

0 kudos
Mensaje 16 de 20
3.321 Vistas

Wow, thanks to everyone!  This is very helpful and I will start working through your suggestions.

 

Erik

 

0 kudos
Mensaje 17 de 20
3.316 Vistas

In the end of it all, I still believe the LVOOP approach is elegant, easy to maintain and robust.

 

negative:

 

Learning curve.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 kudos
Mensaje 18 de 20
3.312 Vistas

[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-

0 kudos
Mensaje 19 de 20
2.443 Vistas

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


"Should be" isn't "Is" -Jay
0 kudos
Mensaje 20 de 20
2.418 Vistas