LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
huerttlen

Automatic ini files

Status: Declined

Any idea that has received less than 5 kudos within 5 years after posting will be automatically declined.

It would be nice, to have a checkbox "[x] automatically store/restore last setting" for every control.

 

It is annoying to restore a lot of settings at program startup from *.ini, and save current settings at program termination. Every time a control changes its value, I wish to have its current value stored and used as default at next startup.

13 Comments
tst
Knight of NI Knight of NI
Knight of NI

The problem is that this is almost never "for every control" - you might want this for some of your VIs, but not for others, and you have some controls where you can't even load a value (latched booleans, for instance, don't allow you to write a value to them).

 

I agree that it would be good if there was some built-in code to handle this, but I don't think this should be completely automatic. In the mean time, there are quite a few examples around for how you can easily do this yourself. You can find one here - https://decibel.ni.com/content/docs/DOC-15349 (in case you're wondering, building the array in the video is done using the JKI RCF toolkit, which you can look up). For that example, you could just use vi.lib\utility\traverseref.llb\TRef Traverse for References.vi to get references to all controls on the front panel.

 

If you want another alternative, OpenG has save and load VIs for all controls on the front panel.


___________________
Try to take over the world!
huerttlen
Member

Hi,

 I do not want it for every control, I want to have a checkbox, to selcet it as a option, to have, lets say, automatic current settings. To have this option would be good.

altenbach
Knight of NI

Of course that would make the VI dirty (unsaved changes) after every run by anyone. How should it work with SCC? How should it work in a built executable?

huerttlen
Member

>>Of course that would make the VI dirty (unsaved changes) after every run by anyone.

 

Yes, exactly this IS what I want ! There is absolutely no diffrence between doing this yourself with *.ini-VIs or doing it by the new option I would like to have.

I think a property in preferences of the controls would be perfect, so one can decide to use this "automatic keep last value" or not.

 

>How should it work with SCC? How should it work in a built executable?

Its normal coding.

Knight of NI

@altenbach wrote:
Of course that would make the VI dirty (unsaved changes) after every run by anyone. How should it work with SCC? How should it work in a built executable?

I don't think the user is proposing that the default value property be updated whenever the control's value be changed. At least I hope the user isn't proposing this, since this would present too many problems. I think the user merely asking to perform the "save control values to disk when the VI has finished" & "load last control values from disk when the VI starts" operations to be performed automatically. Not sure whether I'm really for this.

huerttlen
Member

Ok, to perform the "save control values to disk when the VI has finished" & "load last control values from disk when the VI starts" is ok, too. But my idea is not to have it for all controls activated, I only wish to have this as optional setting availible for some controls. In my mind I don't see a problem with  the default value property be updated whenever the control's value be changed, because this is only for some controls, and rarely.

 

Example: an VI with a control to set the room temperature and an indicator to show it. I would select this new option only for the control to set the room temperature, and it is in my mind easier to code, to change default value property be updated every time the control's value is changed, at once, instead of loop through when the VI has finished.

 

Ok, I see, I am alone to like this. Possibly I am to lazy to code this myself with ini-vi's...  Thank you tst for your link, this is cute and I will use it.

AristosQueue (NI)
NI Employee (retired)

This is actually a request that LV hears on a regular basis. Most of those customers who are regular posters to the Idea Exchange are programmers in LabVIEW. A lot of the users who use LabVIEW more as an engineering tool have panels that they run, they have data in them, they quit LV and they come back expecting the data to still be present. And that's across most of their VIs and subVIs.

 

R&D has had a couple of attempts to make this workable but we haven't come up with anything we like yet, so I encourage ideas in this domain to see if the community can refine a solution that is supports the "LV as engineering tool" users without burdening the "LV as programming language" users.

altenbach
Knight of NI

Currently, we can store the compiled code separate from the VI. What if we could extend this to also transparently store the default data separately in a similar manner if so configured?

 

One problem is with users that end up with gigabytes of data stored inside graphs and charts. Should the defaults only apply to controls or also to indicators? Should the default data remain if the VI is moved to a different machine?

tst
Knight of NI Knight of NI
Knight of NI

AQ, like I said earlier, I agree that it would be useful if there was something built-in to take care of this, but It's quite possible that simply having shipping VIs similar to the example I linked to is enough - basically VIs which accept an array of control references and which you explicitly call at the start and end of the VI (potentially with a couple of additions, such as "save all controls on panel" or "save all controls except these"). One thing which could make it easier is making it easier to build an array of control, similar to the demo I showed there, but Jack Dunaway already posted an idea for that.

 

Another alternative implementation would be that you mark each control separately (e.g. through the right click menu), but I think in that case it would be to easy to forget to mark controls. The actual data would be saved in external files, similar to how my example works. I could probably do this today by creating an edit time tool which sets tags on controls, but I don't think I would want my code to look like that. At least in my case, I think I would prefer something more explicit in code. That said, if NI did do this and there was some special glyph or modification to controls at edit-time (at least by request) to indicate that they're saved, it's possible that it would be acceptable.


___________________
Try to take over the world!
huerttlen
Member

tst, impressive statement. I can agree to everything you say. And your last mind: "some special glyph or modification to controls at edit-time ... to indicate that they're "to be" saved" could possibly be used by an "automatic VI" to save and restore their actual data.