Jump to content

Writing out Variable Name and Value

Recommended Posts

In an application that we are using, we have many variables, they are stored in a data structure as variants although their type varies. I would like to be able write their names and values out to an XML file using a string as the name and just the variant as the value. This works for one element, however when I try to write them all out using an array I get Error 1. I have attached the VI. Maybe there may even be a better method for doing this, any suggestions are welcome. Thanks

Write Variable Name and Value.vi

Link to post
Share on other sites

I think that this might be the type of solution you're looking for:


Variables Array to XML.png



It outputs the following XML.





Note that this uses some OpenG VIs that are probably already installed on your system (since EasyXML depends on them).

Link to post
Share on other sites
  • 2 weeks later...

Yes, that is what I was looking for. Thank you very much. Just out of curiosity, within the XML VIs, when writing values to the XML file does it use the OpenG VI "Format Variant Into String" ?





Yes, it does use OpenG VI "Format Variant Into String" for at least flattening some data types, but not all types.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.