LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is best practice on adding a History section to a .ini file?

I would like to save a history of changes to a configuration ini file.  

Does anyone have a good way to do this?

One of the problems is a line feed\new line confuses the parser.  

 

 

Mark | CLA
0 Kudos
Message 1 of 7
(3,307 Views)

Use the OpenG variant configuration file VIs to write arrays. Then you can keep the last X number of changes in the array. 

Message 2 of 7
(3,266 Views)

You can save a history of all of the changes to all of your LabVIEW files if you use some form of Version Control (like SVN).  It also keeps your code "lean and mean" -- if you need an older version, you can go back and get it (and can "find" it easily because you wrote "good comments" when you Committed it, didn't you ...).

 

Bob Schor

0 Kudos
Message 3 of 7
(3,222 Views)

I do use SVN almost everyday for my code.

 

I am asking is for a way to include the change history inside of an ini file since these are configuration files that are at a customer site.

 

 

 

Mark | CLA
0 Kudos
Message 4 of 7
(3,205 Views)

It would be a big change but instead of using plain text INI files and parsing text use XML based INI files. 

 

Then you can add comments or something like a history tag to document your changes.

 

Adding more tags and moving old tags under it will not confuse the XML parser because XML is hierarchical.

 

So if you were parsing for Input voltage

 

  •  <Input
    • <voltage>120</voltage>
    • <current>10</current>
  • </Input>
  •  <history>
  •  <!--01/05/17 Changed input voltage to 120 and current limit to 10 -->
    •  <Input
      • <voltage>240</voltage>
      • <current>5</current>
    • </voltage>
  • </history>

The XML parser would return 120 not 240 or an error.

 

Microsoft even has a FREE XML editor https://xmlnotepad.codeplex.com/ for making and editing XML files.

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 7
(3,198 Views)

I am going to jump ahaed and state that you can NOT put anything in an "ini" file that is not a section or a tag.

 

Comments etc will be tossed the first time the file is written.

 

Please tell me I am wrong becuase I would love to add notes to the ini file.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 7
(3,189 Views)

Thank you all for your input.

From thinking about this my best solution is to place the History as one long string.  Formatting comes out well on the Front Panel indicator although not as easy to read with a text editor such as Notepad.   I keep "wrtie raw string?" = to FALSE.  The \r\n shows up as hex which makes it a little cryptic.  

 

I do have a simple way to read/write arrays to make them easier to read with a text editor.   I have these placed in polymorphic VIs so that I can quickly choose the dimension.  Array to INI Config Key format.pngINI Config Key format to Array.png

 

 

From a quick web search Ben it looks like a semicolon can be used as a comment.  Not sure the value of it though as it would have to be editted outside of the normal config VIs.  

 

 

Mark | CLA
0 Kudos
Message 7 of 7
(3,171 Views)