LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Where can I find an example of a vi which reads a xml file using the Labview schema (LVXMLSchema.xsd)?

Where can I find an example of a vi which reads a xml file using the Labview schema (LVXMLSchema.xsd)?
�Unflatten From XML� is of little use in parsing because it requires the data type. So it seems that the user has to parse each data value, and then �Unflatten From XML� can help a little.
I would like to see NI provide a VI for parsing it�s own schema.
0 Kudos
Message 1 of 17
(4,832 Views)
I haven't tried it yet but you could look at LabXML from OpenG.Org.
0 Kudos
Message 2 of 17
(4,830 Views)
Yes, I have already looked at that. It is very general purpose. The technology they are developing there could be used to parse a xml using the NI LabView schema, but that would be quite difficult for me now. Perhaps I may have to do this eventually, but it just seems to me that it would be useful for anyone logging in xml to have a vi which could be used to replay the log.
0 Kudos
Message 3 of 17
(4,829 Views)
LabVIEW's XML functions are another way of saving data from controls and indicators that is in a more standardized format. If you look at the Unflatten From XML shipping example, it shows taking the data that you would normally send to a Digital Wveform Graph and converting it to XML instead. This data is then unflattend from XML and wired to the graph. Since you know what you wrote to the file, this is an easy thing to do. If what you are looking for is a way to look at any data in any LabVIEW XML file, then you are right, there is not a VI for that. However, I do not believe that that was the intention of the XML functions in the first place.
By wiriting data in XML, this allows other applications outside of LabVIEW to parse and recognize the dat
a. In LabVIEW, you would already know the types and can place a generic item of that type. The issue of knowing the type is that you need to know the type of the wire that comes out of the Unflatten function so that the VI will compile correctly. You could always choose a variant value to unflatten and then do some parsing to take the variant a part. Maybe this will help you out.

See this example for using the Microsoft parser for XML. (http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=B123AE0CB9FE111EE034080020E74861&p_node=DZ52050&p_submitted=N&p_rank=&p_answer=)

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 4 of 17
(4,829 Views)
I agree that Lab Views XML functions were not intended to read in XML data. That is why there are no examples of this. I know, however, that XML technology is intended to read as well as write. The data type is clearly part of the Lab View schema. I feel certain that this information could be used to create a vi which could read any xml file that followed this Lab view schema. I think that this will be done eventually, perhaps I will do it myself.
I am new to Labview, but I now know that it uses �.ini� files for initialization purposes. I wanted to use xml files for initialization, as well as data recording. I�m sure that this can be done, but I am also certain now that this has not been done yet.
PS
Could not reach the url you sup
plied.

The requested URL could not be retrieved

--------------------------------------------------------------------------------

While trying to retrieve the URL: http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?

The following error was encountered:

Connection Failed
The system returned:

(145) Connection timed out
0 Kudos
Message 5 of 17
(4,829 Views)
Hi
I am developlinng one application which will write in to XML file with specified tags. I tried to download the LabXML library but i am not able to download as it is giving error with downloaded zip file. Will you please send the Library to me.
Thanks in advance
Rikki
0 Kudos
Message 6 of 17
(4,417 Views)
Rikki,

LabXML is not a National Instruments product - however, you may be able to find it somewhere on the internet.  If you do not wish to use the Flatten to XML and Unflatten to XML vi's within LabVIEW to store values, you may consider  using Microsoft's XML Parser (ActiveX).

There is an attached vi in this link that may be useful to you.

Dillon

TheDillo
0 Kudos
Message 7 of 17
(4,394 Views)
Hi
Thanks for your reply
Actually i am developing one application which will write in to XML file.
E.g
<Step StepID="0" Wait="2000" Fbck="0">
      <UsrInfo>Operating Text</UsrInfo>
      <UsrHelp>Log File</UsrHelp>
      <Ctrl Value="1">Signal Name 1</Ctrl>
      <Fbck MinValue="1" MaxValue="1">Signal Name 2</Fbck>
</Step>
 
The inputs strings are 0 , 2000 , 0, Operating Text , Log File , 1,  Signal Name 1, 1,1,Signal Name 2
I tried but it is not writing in to the XML file correctly. Will you please help me.
Rikki
0 Kudos
Message 8 of 17
(4,383 Views)
Rikki,

I'd be happy to help.  What errors are you getting?  It sounds like your best bet will be to write to a file and using the string functions to build a large string.  There are examples in the example finder about how to write to file.  You'll mainly be using the Write to Text File vi, and building the output string.

Did you also try using the example from my previous post?

Any specific errors will help me better answer you.

Hope this helps,


TheDillo
0 Kudos
Message 9 of 17
(4,378 Views)

Thanks Dillon

I am not getting errors in writing to XML as such. But i want to specify my own tags in the same format as i wrote in last message. I tried but it is writng some its own tags.

Rikki

0 Kudos
Message 10 of 17
(4,363 Views)