LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to read back a xml file

hi all

I have a problem reading back an xml file.

What I want to do is to store sensors and some vi parmaters.
To do it, I put the parmaters in a cluster, flaten it to xml and then write the xml file.
till here, no problem.

When I want to read back the xml file, it doesn't work with the way I do (I use unflaten and read xml file)
The datas i read back are not those I want to take back from my xml file.

Can somebody help me with this point?

The 7 datas filed are :
string
string
string
string
U16
I32
I32

Please help me with this, I cant do anything till this problem is solved.

Thanks in advance for your help.

ps : hereafter, the xml file i have written with labview. (I have put it in .txt to be sure the upload works.)
put it back in test.xml to wok whith it.
0 Kudos
Message 1 of 5
(3,432 Views)
Hi,

there are two examples in Help >> Example Finder >> Fundamentals >> File Input and Output. One is Write Data to XML File and the other is Red Data from XML File. The first will write it and the second will read it back.

I expanded th example with the String data and the value provided in your post and it work even with the '/' in the data.

Message Edited by waldemar.hersacher on 04-06-2005 11:23 PM

Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 2 of 5
(3,416 Views)
OK waldemar.

Thank you for the answer.

I try to use it before but dont understand how it works, now it's ok.
I have made a vi using the exemples and modify it to my needs.
Thank you for your help.
have a good day.
0 Kudos
Message 3 of 5
(3,401 Views)
Is there a reason that you are using an XML file instead of using a LabVIEW datalog file?

You can write a cluster directly to a data log file in LabVIEW and read that cluster back.
Use the example finder, search for "datalogging", open the "Write Datalog File Example.vi", and the "Read Datalog File Example.vi". Run the write and then run the read. The datalogging uses the same File I/O functions, but you wire your data type into the "datalog type" terminal on the Open/New function and the write function.

Are you writing to the XML file to be able to share data been computers, executions, or different OS? If so have you considered using DataSocket Server?

Hope this information is helpful.
Chad
Message 4 of 5
(3,392 Views)
wonderfool !

I use the datalod file, and it's exactly what I want to do !
Thank a lot for you help !
0 Kudos
Message 5 of 5
(3,379 Views)