03-06-2019 07:46 AM
HI
I have a project which request to read out the parameter from XML file,for read out the parameter value is not a problem but the problem is how to write back the changed value to XML file
Any ideas or samples
Solved! Go to Solution.
03-06-2019 12:24 PM
Not sure if this is the best way to solve the problem or not but I was able to accomplish the same thing recently just using the string match functions (search for pre-string, search for post-string and then replace the bit in the middle with your new value) and then writing the whole file content back to disk.
In my case the XML file was quite simple, I have not actually looked at your example so YMMV.
03-06-2019 12:40 PM
I would recommend keeping your parameters in a LabVIEW Object.
Save them like this:
Read them like this:
Note: Be sure that the file reading & writing functions have "Convert EOL" unchecked.
03-06-2019 10:28 PM
Hi
Could you please attach your VI that I can learn how to do this
03-07-2019 07:07 AM
I don't have a VI for you.
04-27-2020 05:36 AM
Hi,
Could you send a picture or a < LV 16.00 version?
I am using LV 15 and would like to apply your example
Thanks
Yariv
04-27-2020 08:22 AM
@Y3G wrote:
Hi,
Could you send a picture or a < LV 16.00 version?
I am using LV 15 and would like to apply your example
Thanks
Yariv
Read my previous posts.
04-27-2020 08:29 AM
You can find the XML tools in the File/XML or in the String/Seralize palettes. Also check out the example browser for working and well-documented examples of the flatten/unflatten functions.
04-27-2020 08:44 AM
From the beginning you're doing everything wrong. You have an XML file but you're treating it like a simple text file. You should use the XML Parser VIs and nodes to manipulate this file and get familiar with some xpath location expressions to retrieve specific xml nodes. There is a Replace Child method you can use to change a node value.
I had a quick look at your XML file and I have the following interrogation, how do you identify one ID node from another?
Ben64