LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Develop run time menu using Xml and text file.

hi all,

 

 I hava an application where i am reading the text file and converting it to xml. And then using the xml tags i want to dynamically change by run time menu .

 

Right now I am getting problem in the format of the xml file. LV by default introduing <name> and <val> tag in the xml file. As I am reading the text fie i want to conver tthe particular section in the text file into the xml headers.

But right now whatever i have wriiten in text file I am getting in the <val>tag of xml and nothing in the name tag.

 

I am not getting how to customize which sectin in the text file should be the xml tag and which should be in the value tag.

 

I am attaching the text file as well as VI.

 

For eg:From text file date field should be in my <name>tag whereas 12/11/2010 should be under <val>tag..but I am getting both under <val> tag.

 

anyone know how to do this??

 

Thanks..

 

0 Kudos
Message 1 of 9
(2,740 Views)

can anyone help me out?

0 Kudos
Message 2 of 9
(2,698 Views)

You are making this far more difficult than it needs to be. Just read your text file into a cluster, and then just write out the cluster to XML using the LabVIEW schema. When you read the XML file, it will read it in correctly without all the hoops you're trying to do. You should make the cluster into a typedef. See attached.

Download All
0 Kudos
Message 3 of 9
(2,688 Views)
Thanks for the reply...But this is not required output.Here also as per labview schema it is taking name and val tag.I dont want that. I want that xml file should have the tags of the fields listed in text file.for eg:date tag,time tag etc. Is there any way in labview schema to do this or do I need to manually create the tags(by appending <> and to the string)????
0 Kudos
Message 4 of 9
(2,663 Views)

 


@LV Again wrote:
Thanks for the reply...But this is not required output.Here also as per labview schema it is taking name and val tag.I dont want that. I want that xml file should have the tags of the fields listed in text file.for eg:date tag,time tag etc. Is there any way in labview schema to do this or do I need to manually create the tags(by appending <> and to the string)????

LabVIEW's XML functions are designed for a specific LabVIEW schema.  If you want an easy way to read and write to any XML schema, then you might want to try EasyXML, a commercial tool that I helped create.

 

 

Good luck,

 

-Jim

0 Kudos
Message 5 of 9
(2,643 Views)
Thanks...Seems to be useful for me.But unfortunately I am not allowed to download VIPM on the machine on which I am working. 😞
0 Kudos
Message 6 of 9
(2,611 Views)

If you want to use your own schema you have the following choices (in order of ease):

  • Use the Easy XML toolkit, as Jim mentioned.
  • Use the LabVIEW XML Parser functions.
  • Use LabXML, a free library, though I do not believe it's supported.
  • Use text manipulation functions.
0 Kudos
Message 7 of 9
(2,605 Views)

 


@LV Again wrote:
Thanks...Seems to be useful for me.But unfortunately I am not allowed to download VIPM on the machine on which I am working. :(

 

That's too bad.  I would recommend lobbying your IT dept and/or manager to get VIPM on the list of approved applications -- this might not be too tough, since it's officially endorsed by NI (also note that VIPM does not need to be connected to the network -- you can install package files that you obtain off-line, or build yourself).

 

If you're unable to download the individual EasyXML package from the network from within VIPM, I can arrange to get you a copy of all the required VI Package files to install using VIPM.

 

I'm happy to help.  Just ping me via JKI's contact page.


Cheers,

 

-Jim

0 Kudos
Message 8 of 9
(2,596 Views)

thanks a lot...it would be gr8 if i get it

0 Kudos
Message 9 of 9
(2,536 Views)