LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read/Write INI Cluster OpenG

Solved!
Go to solution

I am trying to use the Read and Write INI Cluster VI by OpenG.  They look straight forward, but I can't get them to work.  In the attached code, the top section won't write cluster into ini file as expected, and I have no idea why.  I did notice one thing.  It seems the data within the cluster doesn't have names when I debug the code. Anybody with experience with this?  Thanks!

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
Download All
0 Kudos
Message 1 of 9
(2,327 Views)
Solution
Accepted by topic author jyang72211

Use a "Close Config Data" VI after writing your cluster.

Picture1.png

Message 2 of 9
(2,306 Views)

That's a great catch.  I am still seeing other issues.  Are there any general advices on using these VIs such as naming?  Thanks!  

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 3 of 9
(2,232 Views)

That seemed to do the trick for me. I think how the naming propagates to the INI file depends a bit on your data structure. For example, if it's a single cluster or a cluster of clusters, it might behave differently.

 

You may want to give a look at the MGI Read/Write Anything toolkit. That's generally what I use for config files, and it is pretty fast even for larger data sizes.

Message 4 of 9
(2,227 Views)

@jyang72211 wrote:

That's a great catch.  I am still seeing other issues.  Are there any general advices on using these VIs such as naming?  Thanks!  


I think you might want to break out those clusters inside and save them separately.  I use the OpenG VIs that you are using, but I never have clusters within clusters.  You figure that an ini file can only handle two levels of organization - sections and keywords.  Clusters within clusters might confuse the VIs.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 5 of 9
(2,214 Views)

I did an ini writer/reader of my own, and solve Cluster in cluster by setting the section name to [top cluster name-lower cluster name]

Should you give the same name to several fields it'll bomb.

/Y

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
Message 6 of 9
(2,199 Views)

Did you mean the data type should always be a single cluster which represent a section of the INI file?  

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 7 of 9
(2,172 Views)

@jyang72211 wrote:

Did you mean the data type should always be a single cluster which represent a section of the INI file?  


I don't know if it has to be, but to me it doesn't make sense to have a data structure that is deeper than that.  Now I've never had reason to save a whole cluster to a keyword in the ini file using the OpenG ini VIs, so I don't really know if it will do this correctly.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 8 of 9
(2,168 Views)

@jyang72211 wrote:

Did you mean the data type should always be a single cluster which represent a section of the INI file?  


I don't know how the OpenG version handles it, but mine requires data to be in a cluster or array. 

It came about as a way to read/write ini-files with system settings easier. As i had them in a cluster it became natural to develop it so:

 

[Clustername = section name]

Control name = Key name

...

Control name = Key name

 

Check it out.

/Y

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
Message 9 of 9
(2,149 Views)