LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

XML ini file

Has anyone used an XML file to retain state information fro a CVI application in lieu of the registry or an .ini file?

 

Has anyone generated a report using XML?

 

I normally would use a Word template and paste to bookmarks using ActiveX to make a report, but someone here at work seemed to think that I could or should do this with XML instead.

 

I see in the Wiki XML entry there's a pull-parser scheme to get data from an XML file using the iterator design pattern - anyone tried this?

 

Thanks for any insight anyone cares to share.

 

Menchar

0 Kudos
Message 1 of 4
(3,627 Views)

What type of information do you want to save?  Simple control values, window pane size information, arrays of acquired data, etc.  If you could be a little more specific about your report it would be helpful.

 

What are some of the reasons people are saying you should switch to XML? 

Eric S.
AE Specialist | Global Support
National Instruments
0 Kudos
Message 2 of 4
(3,589 Views)

Using XML for a report was suggested because of problems using ActiveX / Word to create reports.  We've had trouble with odd, high order type anomalies when using large Word docs as reports.  Some inner resource was getting exhausted and Word would fail, typically after pasting a bit map into the Word doc.  Might have been theoffice clipboardgetting filled up but we were never able to prove that.  IMHO the problem could have been mitigated by using a Word document template and bookmarks as opposed to simply hacking the 50 page document out through large numbers of automation calls.

 

I normally put config info (or any data that must persist from run to run) in the registry but some of the people I work with view this as perfidy and demand full parameterization of anything and everything in an .ini file that they can read and edit with Notepad.  I had understood Microsoft was migrating from using the registry to retain program state data to using XML to have program state data to live in the .exe folder as a companion file.

 

Menchar

 

 

0 Kudos
Message 3 of 4
(3,569 Views)

I have also just started storing information in a XML file.  I have been using the CVIXML built-in tools.  In the past, I have however just used a simple text file with a variable name=#.

 

It seems if you know what variables you are looking for, a simple .txt file or even .xml file can be used and just search for that text manually or parse the file line by line.  It was a good way to save booleans and numbers.

 

If any variables were perhaps optional or there existed alot of options dependent on different things, then I would recommend the XML format as this has alot more flexibility in seeing attributes and children properties within the file.

 

0 Kudos
Message 4 of 4
(3,556 Views)