Vincent Wong Posted March 7, 2008 Report Posted March 7, 2008 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. Quote
Jim Kring Posted March 7, 2008 Report Posted March 7, 2008 QUOTE(Vincent Wong @ Mar 6 2008, 10:58 AM) 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 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 Quote
Vincent Wong Posted March 14, 2008 Author Report Posted March 14, 2008 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 Quote
Vincent Wong Posted March 23, 2008 Author Report Posted March 23, 2008 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 -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 Quote
Yair Posted March 23, 2008 Report Posted March 23, 2008 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. Quote
Vincent Wong Posted March 24, 2008 Author Report Posted March 24, 2008 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 Quote
Jason H Posted September 1, 2008 Report Posted September 1, 2008 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? Quote
Jim Kring Posted September 1, 2008 Report Posted September 1, 2008 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 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 Quote
Vincent Wong Posted September 3, 2008 Author Report Posted September 3, 2008 QUOTE (jasonh_ @ Aug 31 2008, 06:55 AM) 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? Hi Jason, The way I've generated XML code from a cluster is by using the the Format into String function built into LabVIEW. An example of this can be seen in the following post: http://thinkinging.com/2008/01/21/using-xm...abview-is-hard/ It's Figure 3, under Creating Arbitrary XML Data. Best of luck, -Vincent Quote
nagaece Posted March 28, 2013 Report Posted March 28, 2013 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 Dear Vincent, I would like to use your VI for my project but unfortunately couldn't find the updated robust code :-) Please share it Regards Nagarajan Quote
todd Posted March 28, 2013 Report Posted March 28, 2013 http://thinkinging.com/2008/01/21/using-xml-data-in-labview-is-hard/ which links to: http://thinkinging.com/2008/03/01/using-xml-data-in-labview-just-got-easier/ which links to: http://jki.net/easyxml Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.