Can I open other applications using the Cogent DataHub through scripting?
I want the DataHub to be able to launch a certain process when a tag hits a certain level. Can I open other applications using the DataHub through scripting?
Yes, you definitely can do this.
In Windows, there are a couple of choices for running applications, depending on how much precision you want in starting the new process. The DataHub can execute these windows commands directly from its scripting language.- ShellExecute: We recommend this method because it is easier to work with. Below are a couple of examples:
ShellExecute(0, "open", "c:\\usr\\cygwin\\cygwin.bat", "", "c:\\", SW_SHOW);
ShellExecute(0, "open", "notepad.exe", "", "c:\\", SW_SHOW);
ShellExecute(0, "open", "C:\\startService.exe", "", "c:\\", SW_HIDE); - CreateProcess: This gives you very precise control over the process that is started. You can do things like redirect standard input and output to files, and to query and terminate the process under program control. This method can be overkill for most applications.
If you have questions about how to use these commands please contact us.