opening a DF application from within script


Recommended Posts


I have a system in development that I would like to be able to remotely update the application file once it's in the field

I have a sequence that regularly checks a ftp directory for updated settings files and loads them in, but can this be done with application files? Can I close the current *.ctl file and open a new one from within a DF sequence? Ideally I'd like to be able to check the AppVersion of the new file before opening.

The best option I've come up with is to have a separate bootloader that checks file names for a later version and moves the latest application file to the program directory, and renames the file, before rebooting system. (The application is set to auto start when Windows starts.)

Any tips or suggestions?


Link to comment
Share on other sites

DAQFactory doesn't have a way to read the edit time of a file, so I'd probably upload a secondary file (with say 1 byte in it) whenever the system needs updating, then you can use the file.getFileExists() function to check for it. When you find it, you delete the file and restart DAQFactory. To restart DAQFactory you can use system.shellExecute() to start a second copy (loading the appropriate .ctl) and then use system.quit() to quit the current one, or, if you have the system set to auto-start with Windows, just use system.reboot(), although this would be slower.

If you use the quit() option, you probably should turn off the second instance check on the machine from File - Preferences. This is a machine specific, not document specific setting so has to be changed on the remote PC, not in your application document.

Link to comment
Share on other sites


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