Jump to content

Example - Convert XML to a LabVIEW Cluster


Recommended Posts

I recently read Jim Kring's post on "Using XML Data in LabVIEW is Hard" and I felt I could share this example program I've had in the works for a while. Its mainly based on vi's from OpenG toolkits, so I figured I'd share as well.

Using OpenG toolkits, I was able to make this example program that takes an XML string and converts it to a LabVIEW Cluster. It's still a bit buggy when it comes to handling attributes, but the basics are there and it works for my purposes.

The attached code is written for LabVIEW 8.5

 

[Moderator Note]

This post contained some kind of attachment links which could not be found, so they've been removed. A best effort was made to find these missing attachments but unfortunately could not be found.

Link to comment

QUOTE(Vincent Wong @ Mar 6 2008, 10:58 AM)

Hi Vincent,

Nice job. This is a great example, and I like the liberal use of the OpenG VIs. In fact, this example reminds of early prototype versions of EasyXML :) Our proof of concept took only about an afternoon to create. Then, as we started to add support for attributes and test for things like nested entities with similar names, variable whitespace, xml comments, etc. we started noticing that there were lots of bugs and the fixes were not nearly as straight-forward as you might think. In the end, there was a considerable amount of time getting EasyXML to the point where we felt comfortable with releasing it.

That's one of the main differences between commercial-grade software and proof of concept code. At JKI, we have an entire suite of unit tests (almost 100 individual tests for EasyXML) that we use to validate that the code meets the specification -- I'll talk about that in a future blog article. And, we're committed to fixing issues that are reported and to continue to improve the product's features over time.

Please don't take my comments as a knock against your code, which is very nice. My point is to raise awareness for the fact that if you decide to go down the road you're headed (or if users try to adopt this as a solution for thier XML parsing needs), I believe that you'll soon realize that there is a lot of work in-store.

Keep up the great work. This is a wonderful example and raises awareness for OpenG and using XML in LabVIEW :)

Thanks,

-Jim

Link to comment

QUOTE (Jim Kring @ Mar 6 2008, 07:47 PM)

Hi Vincent,

Nice job. This is a great example, and I like the liberal use of the OpenG VIs. In fact, this example reminds of early prototype versions of EasyXML :) Our proof of concept took only about an afternoon to create. Then, as we started to add support for attributes and test for things like nested entities with similar names, variable whitespace, xml comments, etc. we started noticing that there were lots of bugs and the fixes were not nearly as straight-forward as you might think. In the end, there was a considerable amount of time getting EasyXML to the point where we felt comfortable with releasing it.

That's one of the main differences between commercial-grade software and proof of concept code. At JKI, we have an entire suite of unit tests (almost 100 individual tests for EasyXML) that we use to validate that the code meets the specification -- I'll talk about that in a future blog article. And, we're committed to fixing issues that are reported and to continue to improve the product's features over time.

Please don't take my comments as a knock against your code, which is very nice. My point is to raise awareness for the fact that if you decide to go down the road you're headed (or if users try to adopt this as a solution for thier XML parsing needs), I believe that you'll soon realize that there is a lot of work in-store.

Keep up the great work. This is a wonderful example and raises awareness for OpenG and using XML in LabVIEW :)

Thanks,

-Jim

Thanks for the feedback Jim. I'm glad you had a chance to look over my code. I know my code isn't perfect, but I do plan on fixing the attributes handling. Once I get that working, I'll put that code to rest. If I see myself needing any additional XML features, I will definitely get the EasyXML toolkit.

Take care,

Vincent

Link to comment
  • 2 weeks later...

QUOTE (Vincent Wong @ Mar 13 2008, 02:12 AM)

I've updated my code and made it more robust.

-Attribute handling was fixed

-Selective clearing of Arrays has been fixed

-The code was cleaned up

runs faster because of various modifications

-A new/better example is included showing a variety of features.

QUOTE (Vincent Wong @ Mar 13 2008, 02:12 AM)

Thanks for the feedback Jim. I'm glad you had a chance to look over my code. I know my code isn't perfect, but I do plan on fixing the attributes handling. Once I get that working, I'll put that code to rest. If I see myself needing any additional XML features, I will definitely get the EasyXML toolkit.

Take care,

Vincent

I've updated my code and made it more robust.

-Attribute handling was fixed

-Selective clearing of Arrays has been fixed

-Code is cleaner and runs faster

-A new/better example is included showing a variety of features.

Still written for LabVIEW 8.5 and needs OpenG "oglib_*" toolkits

Link to comment

QUOTE (Yen @ Mar 22 2008, 09:38 PM)

You might wish to save this as an LLB for easier distribution and download. If you use the OpenG builder, you can even include the OpenG VIs with your own namespace.

Thanks, I tried using a labview Library .lvlib, which didnt want to upload. Apparently this messed up how all the files were linked. So I'll repost as an .llb

Link to comment
  • 5 months later...

QUOTE (Vincent Wong @ Mar 22 2008, 06:54 PM)

Thanks for the advice Yen. I also noticed all the VIs I uploaded earlier didnt link properly.

The code has been updated and made more robust.

-Attribute handling was fixed

-Selective clearing of Arrays has been fixed

-Code is cleaner and runs faster

-A new/better example is included showing a variety of features.

Still written for LabVIEW 8.5 and needs OpenG "oglib_*" toolkits

Thank you very much Vincent. But how do you generate the XML code from a cluster? Did you have an example that could do that, or is it beyond your needs?

Link to comment

QUOTE (Vincent Wong @ Mar 22 2008, 06:54 PM)

Hi Vincent,

Have you tried creating a VI Package for this library using VIPM 2.0? By default, VIPM will build all of the OpenG VIs into your VI Package, so that users won't need to download them. Or, you can choose to make this a dependency. We have a Package Building Guide that is helpful in getting started.

As a good "critic" of JKI software, I'm very curious about your opinion :)

Cheers,

-Jim

Link to comment
  • 4 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.