Applies To:
  • CitectSCADA 5.xx

Summary:
My system has Citect as the shell and I need to call an external program for operator use. When the program is running and the operators click on the background mimic, the mimic comes to the foreground and the external application vanishes behind the mimic. To get access to the application they load it again. Last time I checked there were 36 copies of the external application grinding away in the background. How can I set up the external application up to be called only once? The application in this case was the Windows Calculator for computing dosing rates.

Solution:
You can control the way an application is called with the following Cicode routine:

FUNCTION VIEWCALC()
    int calc;
    calc=WNDFIND("Calculator");
    if calc=0 then
        EXEC("C:\windows\calc.exe")
    else
        WNDSHOW(calc,9)
    end
end

The routine uses the WndFind function to search the environment for a window already running the application. WndFind will search for the name appearing in the window title bar. If it does not find an application already running, it will load it afresh. If it found to be running, it will redisplay it in its previous mode. For example, if the operator has minimised the window it will redisplay it full size. Read the help entries for WndFind, WndShow and Exec to ensure that you understand their functionality.

You will need to provide the operators with a button on the template or on the mimic to call the external application. The Up Action of the button calls (in this example) viewcalc(). You can use the icons.calc symbol from the include project symbol library to get a windows standard appearance.

 

Keywords:
 

Attachments