Jump to content

[CR] Data Repository with INI files (not a Source-Code-Control)


Recommended Posts

Hi,

I just added LabVIEW 7.0 code. Try to download again.

-Sam

Just as an aside, not to take away anything from Sam's effort, you can save/read back any LabVIEW data structure very easily to an xml file, making the ini file functions more or less redundant. I have written complicated structures of clusters/arrays/booleans very easily with just a single VI. The read is fairly easy as well.

I think the xml read-write VI's were introduced with LV 7.

Neville.

Link to comment

With this VI I am only pointing out exclusive write access to data. Inside the VI you can use ini or xml or databse to save your data to disk. I have used/using sqlite3 (using openg variants to save LabVIEW objects to sqlite3.). Also if you have a giant Cluster and pass it to openg's cluster to INI it will be saved in one action.

But I often browse the INI file with ini-aware text editor and grouping items makes it easier to browse.

Link to comment
I disagree. I continue using ini's and still will well into the future. XML is great but it's not very human readable.
Especially NI's current version of XML. It is a bit verbose, but does seem to work. I'd like to see them compact it up a bit, and include attributes about the data on the same line instead of multple lines.

Again, not to take away from Sam's effort, which I think is great, but I like the INI version that Jim Kring did using the OpenG variant config file VIs. Sam's effort has the virtue of plugging in the file format of your choice. Perhaps this could be made an explicit plug in API. Keep up the good work Sam!

Lastly, if someone is going to use XML, (ie, NI's XML) it becomes marginally more readable if you indent it. There is a VI on NI Dev Zone to do this. Reformat LabVIEW XML for Simple Text Editors

Link to comment
  • 4 weeks later...

Hi all,

When I try to save an array all I get in the file is:

[Motion config]

Axis names.<size(s)>=0

Where "Motion Config" is cluster containing an array (labeled "Axis names") of strings with 8 elements. The size should be 8 and the element data should be stored in the file - right?. Does anyone what I'm doing wrong?

TIA - Martin

Link to comment

Here is a VI that utilizes another method for reformating an XML file, this one doesn't care about incoming format since it is not doing the parsing through Labview itself but using the SAX Reader.

Download File:post-3040-1164601534.vi

Randy

Lastly, if someone is going to use XML, (ie, NI's XML) it becomes marginally more readable if you indent it. There is a VI on NI Dev Zone to do this. Reformat LabVIEW XML for Simple Text Editors
Link to comment
Hi all,

When I try to save an array all I get in the file is:

[Motion config]

Axis names.<size(s)>=0

Where "Motion Config" is cluster containing an array (labeled "Axis names") of strings with 8 elements. The size should be 8 and the element data should be stored in the file - right?. Does anyone what I'm doing wrong?

TIA - Martin

Figured out myself - Needed to set the data before saving, of course! :headbang:

Link to comment

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.