Loading saved variables on startup


Recommended Posts

I created a calibration control using Daq Factory and its working great. I currently have it setup to read a text file at startup called settings.txt that houses all the variables for the different calibrations levels. Also I have a Save button on the GUI that will save and overwrite the current settings.txt with what ever settings they currently have on screen. So far, this method has been working quite well. They have multiple pieces of equipment now that they want to use the .ctl for, but since there is only one settings file, there is no way to make it work for many different types of equipment. Ideally all pieces should have unique settings associated with them.

What they have started doing is creating a seperate .ctl copy for each type of equipment. The only problem with that is since all .ctl files are hardcoded to look for settings.txt, they all pull the same values it, which is incorrect.

After dragging you through all that, Im beginning to think my method just isn't going to work for multiple pieces of equipment. I am wondering if there is a way to save variables within a .ctl file some how in DaqFactory. Either that or could you maybe suggest a way to somehow tie default variables or settings to a .ctl that can be saved and reloaded on startup. Thanks in advanced.

Link to comment
Share on other sites

First, BeeHay, good ideas, but probably not the best choice as you run into the same scaling problem bstringer is running into.

My general recommendation is to save the file to different names for each machine. So, instead of settings.txt, save it to MR4000.mds or IE8439.mds where MR4000, in this example, is the name of the machine. I'd use .mds (machine data settings) or some other unique extension instead of .txt. Then you can use the file.getfilepath() and similar functions to retrieve the names of all the machines in the system.

Using this technique would work for 1 or 1000 machines and scales well.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.