Jump to content
News about the LabVIEW Wiki! Read more... ×
0_o

OpenG ini file issues

Recommended Posts

Hi, 

I tried using the openg ini vis and here is my two cents feedback:

1. Read operation locks the file and doesn't open it as read-only, thus, blocking a write operation. There is no permission or access handling in the package

2. Even though a numeric variable should be represented as 4 and not as "4", for example, inside a cluster every variable is represented with " around it

3. Read/Write panel from/to ini is a great concept yet it needs to be debugged. I saw strange results from variant controls for example that got 2 lines but I wonder if it can deal with two controls with the same label, for example.

4. It would be nice if the open could have got a file reference from the general file open vi that will handle permission settings or any other file operation before the openg gets involved.

5. Some VIs require a type input yet even after they know the output type they still give out a variant. Maliablle VI?

Edited by 0_o

Share this post


Link to post
Share on other sites

Those are all great suggestions.  The read/write panel could have other improvements too a list of controls to exclude, or an option to exclude indicators.  Do we really need to read and write the Error In/Out?  Most likely no.

The core of the code is using NI's configuration functions, which are fine for small files but for arrays of clusters of arrays it struggles.  OpenG Read/Write takes a long time for large data types that are heavily nested, or array based.  The MGI Read/Write Anything work much better when it comes to this.

Share this post


Link to post
Share on other sites

Do people still use ini files? I mean XML, Json? What is the consensus. Should any effort be put into this? Yes, the MGI tool is way faster. Yes, I'm derailing this post...

Share this post


Link to post
Share on other sites

Yes, I still heavily use ini files.  Admittedly, I am starting to transition my code to use XML.

Share this post


Link to post
Share on other sites
1 hour ago, Michael Aivaliotis said:

Do people still use ini files? I mean XML, Json? What is the consensus. Should any effort be put into this? Yes, the MGI tool is way faster. Yes, I'm derailing this post...

Whenever I have something that an average human is going to edit I use INI files. It's a lot harder to completely mess up and easier to understand for non-software types. Otherwise, I've shifted to JSON.

Share this post


Link to post
Share on other sites

Since you asked... I personally don't use ini files.

I use MVC and thus all my controls are also in a class. 

I use traverse and save the class as a binary file. 

For config I use JSON or SQL.

However, some projects demand ini file config so here we are

Share this post


Link to post
Share on other sites

I still have some legacy stuff that uses INI keys.  The users I trust, know how to edit them pretty easily.  Not saying they can't do the same for JSON but it is a more familiar looking format.  It's good and bad, but every operating system has a text editor.

Share this post


Link to post
Share on other sites

I actually still use the OpenG ini library for a lot of my config files. As I recall, it's output was a bit more human-readable compared to the MGI ini format. Recently I've started to look at TOML as a possible replacement: https://github.com/erdosmiller/lv-toml

Of course JSON or XML could also work very well but they look a bit more intimidating to the non-technical user.

Share this post


Link to post
Share on other sites

I use JSON almost exclusively. A verbosely formatted JSON file is more readable than an INI file. Also, With JDPowell's JSON library, saving and loading any LV type is a breeze.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use.