Adding a Calculator on the DeltaV Picture

Dear all,

There is a requirement on my project to give an operable scientific calculator on the HMI

for minor flow calculation purposes .

Now i tried to refer and insert the windows Calculator by inserting  an OLE object but its not working .

Is there a way that i can add an application icon and insert a windows application into a Delta V screen or

is there a built in Delta v calculator that can be used for this purpose.

Sometime ago i saw a someone using a flow calculator on the HMI. i wonder how he managed to create the object?

Regards

M_ASIM

8 Replies

  • Have you considered using an ActiveX control for this? You can embed all kinds of objects that comply with ActiveX in the HMI.

  • In reply to Bruce Brandt:

    Instead of embedding, give them a toolbar button to launch the application- Try adding

    frsruntask("calc.exe",,True)

    to a button in your toolbar.

    Here is usage of the function -

    frsRunTask

    (strExecutable As String, Optional strParameters As String, Optional blnErrorFlag As Boolean) As Double

    To launch an application from DeltaV Operate

    strExecutable - Name of the executable to run.

    strParameters - Command line input parameters for the executable.

    blnErrorFlag - Enables/disables error reporting. Defaults to True (enabled).

  • In reply to Youssef.El-Bahtimy:

    Youssef,  I was thinking of this, but want to caution that if you call this multiple times, the CALC.EXE will run multiple times.  The Operator would not see the window and possibly launch this app a hundred times.

    If you want to call this calculator, you also need to check to see if it is already running, and if so, bring the window to the forefront rather than launch it again, and again,....

    I'm not sure how to do that, as my VB skills are rusty.  I seem to recall that there is a way to check for open windows by name, and therefore verify if the application is open.  You would then need to place focus or set some parameter on the window to bring it to the for front.  Maybe you can set a property on the window to keep it "On Top" so the Operator closes it when done.  Is there a an FRSTask that checks for a window by name?  if so, you would run this first before calling the CALC.EXE and avoid a "memory leak".

    Andre Dicaire

  • In reply to Andre Dicaire:

    I agree with Andre so if you put this logic under your "Object_Event" and it will only open calculator if it isn't already open and brings it to the front if it is already open.

    Private Sub Object_Event()

    Dim lCalc As Long

    On Error Resume Next

       lCalc = findwindow(vbNullString, "Calculator")

       If lCalc Then

           Dim iret As Long

           iret = SetForegroundWindow(lCalc)

       Else

           frsruntask "calc.exe", , True

       End If

    Exit Sub

    ErrorHandler:

       frsHandleError

    End Sub

  • In reply to Andre Dicaire:

    Thanks a lot Yousaaf , the code is working fine, but its working as per andre's post i.e multiple instances  of calculator keep on popping up.

    Let me try a few thing as per andre suggestions. I will post the results after a while and is there a way to integrate a  flow calculation face plate

    where one can write and calculate flow using deltav blocks e.g AGA_SI or AGA _US

    Thanks and Regards

    ASIM

  • In reply to M_ASIM_B:

    I knew I solved this problem before.  Here is the code:

    On Error Resume Next

    'Bring focus to calculator.  If the calculator was minimized, appactivate can't re-maximize....handle by just closing it, see below.

    AppActivate "Calculator", True

    'If it is already running then close it by sending ALT+F4.

    If (Err.Number = 0) Then

    SendKeys "%{F4}", True

    End If

    'Either way, run the task.

    frsruntask "calc.exe", , True

  • In reply to Youssef.El-Bahtimy:

    Thanks a lot Youssef , Matt and Andre , the code is running fine.

    Can you kindly give me any suggestion regarding implementing  the HMI displays for  AGA_SI blocks on the HMI?

    I need flow totalization and compensation variable configurations on screen.

    Thanks a lot

    Regards

    ASIM

  • In reply to M_ASIM_B:

    See the following from the Books on line article 'Flow Metering (AGA_SI) Function Block'

    Using AGA_SI with DeltaV Operate

    DeltaV Operate has a dynamo set called AGA containing a group display faceplate for the AGA_SI (and AGA_US) block. The faceplate shows operating parameters for the block and is applicable for orifice and turbine meters (the IN parameter value is not visible when METER_TYPE is Turbine). In configure mode drag the dynamo onto a picture. Enter the path for the AGA_SI function block in the edit dialog.

    Also included in the dynamo set is a header for the faceplate. The header includes the module tag and module description. Drag the dynamo onto the picture and position it above the faceplate. Enter the module path in the edit dialog.

    The datalinks that publish the interface values for this block provide in-place editing.