amaggs145 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 Link to comment Share on other sites More sharing options...
Jim Kring 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). Link to comment Share on other sites More sharing options...
amaggs145 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 Link to comment Share on other sites More sharing options...
Jim Kring 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.