amaggs145 1 Posted April 6, 2012 Report Share Posted April 6, 2012 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 Quote Link to post Share on other sites
Jim Kring 133 Posted April 6, 2012 Report Share Posted April 6, 2012 I think that this might be the type of solution you're looking for: It outputs the following XML. <Variables> <Var_1>true</Var_1> <Var_2>0</Var_2> </Variables> Note that this uses some OpenG VIs that are probably already installed on your system (since EasyXML depends on them). Quote Link to post Share on other sites
amaggs145 1 Posted April 20, 2012 Author Report Share Posted April 20, 2012 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" ? Thanks, Anthony Quote Link to post Share on other sites
Jim Kring 133 Posted April 21, 2012 Report Share Posted April 21, 2012 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" ? Thanks, Anthony Yes, it does use OpenG VI "Format Variant Into String" for at least flattening some data types, but not all types. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.