Global Variable Persistence Example

Recommended Posts

I needed to gather and persist to HDD all entries into several sets of configuration/calibration data EditBoxes on a setup page - not a data acquisition page (I am familiar with the reasons for using EditBoxes and such on modal dialogs instead of on running control and monitoring pages).

I studied the documentation some more and opted to use Registry-stored values, since such data is only added infrequently in this system, and then only during manual operator intervention, so the slightly slower access times for Registry data is not an issue.

Thanks for your support - IT ROCKS!

Link to comment
Share on other sites

If you have a bunch of configuration data, you might consider using an object to store all the data, then use the ToJson / FromJson along with the File. functions to log it all to a file. Its a little more involved (meaning a few more lines of script), but it is self-organizing, and doesn't have the limitations registry variables have. If, however, you only have, say, 3 or 4 values, then registry variables are easiest.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.