Restarting A .ctl File Without Exiting Daqfactory


cadcoke5

Recommended Posts

Since I am writing and debugging a lot as I learn, I often want to re-start the .ctl file.  I normally exit DAQFactory and then open it again and then re-open the same .ctl file I had been working on. I tried just using the FILE/OPEN to open the same .ctl file, but that does not re-initialize all the variables, etc.  Rather, data collection continues without restarting.

 

As a programmer, what is the easiest way to restart a .ctl file?  Ideally, I would also like to create a "Reset" button for the user to re-initialize everything.

 

Is there a way to do this?

 

-Joe

Link to comment
Share on other sites

There are two ways to do this.  Doing file - open and trying to open the same file name doesn't work because the windows framework thinks its smarter than you and doesn't realize you want to revert.  Now to the two ways:

 

1) do File - New, then do File - Open to reopen the file (or use the most recent file list)

2) I often add a clearGlobals() call at the beginning of my auto-start sequence.  That way I can basically reinitialize my system by rerunning startup, or by switching into then out of safe mode.  Its not quite the same as closing and reopening, but in most cases it works for me, especially since I typically do all my initialization in an autostart sequence rather than rely on auto-start for other things (like logging sets, PID loops, etc), and I usually set the initial page in the sequence too.

Link to comment
Share on other sites

Archived

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