Kalmar Posted April 22, 2006 Report Share Posted April 22, 2006 Hi, Anyone know how to make a custom XML-file (write). Need to change the name of parameters and so on. LabView's write-xml only make a predefined format. Is it an idea to use write to spreadsheet file and write one string at a time? Thanks to any thoughts ! Quote Link to comment
klessm1 Posted April 23, 2006 Report Share Posted April 23, 2006 Hi,Anyone know how to make a custom XML-file (write). Need to change the name of parameters and so on. LabView's write-xml only make a predefined format. Is it an idea to use write to spreadsheet file and write one string at a time? Thanks to any thoughts ! LabVIEW internet toolkit includes an XML tools so you can write whatever you want. You can also use Microsofts XML parser if you don't want to purchase the internet toolkit. See attached how to use it in a very basic fashion. This one just parses, doesn't write. Good luck. Download File:post-2966-1145750064.vi Quote Link to comment
unicorn Posted September 21, 2006 Report Share Posted September 21, 2006 Try the LabXML Toolkit (http://labxml.sourceforge.net/). It is based on Microsofts XML parser Quote Link to comment
leblanc Posted March 15, 2007 Report Share Posted March 15, 2007 well if labview supports oop you should be able to inherit the built in xml writer and override the render event which takes a string builder.. talking more of how its done in .net if your using measurement studio you should be able to create an xmldocument object which has properties to createElement, xmldoc->save(filestreamobject); -lm Quote Link to comment
Aristos Queue Posted March 15, 2007 Report Share Posted March 15, 2007 QUOTE(leblanc @ Mar 14 2007, 03:58 PM) well if labview supports oop you should be able to inherit the built in xml writer and override the render event which takes a string builder.. talking more of how its done in .net Merely because LV has OO capacities does not mean that 20 years of libraries have been rewritten along OO principles. Quote Link to comment
crelf Posted March 15, 2007 Report Share Posted March 15, 2007 QUOTE(Aristos Queue @ Mar 15 2007, 08:12 AM) Merely because LV has OO capacities does not mean that 20 years of libraries have been rewritten along OO principles. ...yet Quote Link to comment
Doon Posted March 16, 2007 Report Share Posted March 16, 2007 This may be an unpopular alternative , but XML is marked-up plain text. One can read/write XML files without much hassle at all. I have developed an XML database that records serial numbers and tracks changes to modules. It took me about a day to write the core vi's needed to interface with the XML database (add, remove, modify, and resolve). I decided to go this route because of cost and speed. A purpose-built text-parser will (usually ) always perform better than a general purpose XML parser. I <heart> XML -H Quote Link to comment
Jeff Plotzke Posted March 16, 2007 Report Share Posted March 16, 2007 QUOTE(Doon @ Mar 14 2007, 07:10 PM) This may be an unpopular alternative , butXML is marked-up plain text. One can read/write XML files without much hassle at all. I have developed an XML database that records serial numbers and tracks changes to modules. It took me about a day to write the core vi's needed to interface with the XML database (add, remove, modify, and resolve). I decided to go this route because of cost and speed. A purpose-built text-parser will (usually ) always perform better than a general purpose XML parser. Yes, but writing a generic text-based parser will probably not be very generic. You may want to look into using MSXML -- It's an ActiveX object that you can use in LabVIEW. I've built a set of VIs that use this object to read/write XML files. It takes a while to get up to speed on all the methods/properties of MSXML, but after that, it's super easy to use! Quote Link to comment
Mike Ashe Posted March 16, 2007 Report Share Posted March 16, 2007 QUOTE(Jeff Plotzke @ Mar 14 2007, 07:23 PM) You may want to look into using MSXML -- It's an ActiveX object that you can use in LabVIEW. I've built a set of VIs that use this object to read/write XML files. It takes a while to get up to speed on all the methods/properties of MSXML, but after that, it's super easy to use! I'll second that. I recently used a colleague's MSXML implementation on some RF testing. The XML defined "objects" of one or more test instruments, and then setup parameters for those instrument/objects on some in-house legacy test executives. The implementation was written with a high degree of abstraction and inheritance and was very poorly documented, (I mean NO documentation, actually) so it was hard to figure out how it worked. However, once you did figure it out, and study up on the MSXML objects and methods, it became very easy to setup very powerful hierarchy trees of data, objects and actions (methods). The XML schema he defined used a lot of attributes, so it was much more compact and readable than the native NI implementation. The only downside was that it was custom and limited to a subset of datatypes. The NI XML is not (yet) very nice to read, but it has the advantage of easy read/write for any complex data type you throw at it. I'll also second the plug for the LabXML toolkit above. Sorry I cannot post a copy of my colleague's tools, but they are proprietary and they'd take away my birthday if I broke the NDA. Quote Link to comment
Doon Posted March 16, 2007 Report Share Posted March 16, 2007 QUOTE(Jeff Plotzke @ Mar 14 2007, 05:23 PM) Yes, but writing a generic text-based parser will probably not be very generic. Touché I would like to qualify my solution. It does result in purpose-built (i.e., very specific) interfaces. Further, the interfaces I have written do not actively consider validation or well-formedness (By design, the generated XML is both valid and well-formed [as long as no one modifies the XML externally ]). Straight text-parsing is definitely worth considering for simple (i.e., shallow) XML files. The XML database I have implemented is no more than three levels deep, and is very wide at the top level. For anything more complex, I agree with Mr. Plotzke that a generic XML parser is a better solution. I cannot comment on the utility of the native LabVIEW Internet Toolkit as I have not used it, but I hear it's pretty cool. Cheers! --H Quote Link to comment
Jeff Plotzke Posted March 16, 2007 Report Share Posted March 16, 2007 QUOTE(Doon @ Mar 15 2007, 02:51 PM) I cannot comment on the utility of the native LabVIEW Internet Toolkit as I have not used it, but I hear it's pretty cool. I'll comment that I remember older versions of the Internet Toolkit having a huge memory leak in the XML VIs (I believe it was version 7.1 or so...) I haven't tested anything newer, so I hope it's corrected, but if you're planning to open many XML files over time, you may want to watch your memory if you're using the Internet Toolkit. Quote Link to comment
Randy Posted March 23, 2007 Report Share Posted March 23, 2007 You may want to check out this (xml using javascript) piece of code I put into the repository, it utiilizes javascript to write to an xml file with the msxml active x objects. The benefit of doing this through the javascript interface is the garbage collection built into javascript where as using the msxml active x objects in Labview can be cumbersome due to the continuous opening and closing of references when working through an xml file. While the example is simplistic, with a little investigation you can turn it into a powerful tool for documentation. The following is an example of an xml file being generated on one of my test systems. XML file example QUOTE(Kalmar @ Apr 22 2006, 02:01 PM) Hi,Anyone know how to make a custom XML-file (write). Need to change the name of parameters and so on. LabView's write-xml only make a predefined format. Is it an idea to use write to spreadsheet file and write one string at a time? Thanks to any thoughts ! Quote Link to comment
Jim Kring Posted March 8, 2008 Report Share Posted March 8, 2008 QUOTE(Kalmar @ Apr 22 2006, 11:01 AM) Hi,Anyone know how to make a custom XML-file (write). Need to change the name of parameters and so on. LabView's write-xml only make a predefined format. Is it an idea to use write to spreadsheet file and write one string at a time? Thanks to any thoughts ! Kalmar, It's two years later, but better late than never, I guess Here is a new http://jkisoft.com/easyxml/' target="_blank">labview xml toolkit that makes using xml data in LabVIEW easier than ever before. Thanks, -Jim Quote Link to comment
JCC Posted February 24, 2009 Report Share Posted February 24, 2009 QUOTE (Jim Kring @ Mar 7 2008, 04:02 AM) Here is a new http://jkisoft.com/easyxml/' rel='nofollow' target="_blank">labview xml toolkit that makes using xml data in LabVIEW easier than ever before. I don't want be bad boy, but did you try import whole TestStand Xml report file? :-) Quote Link to comment
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.