• Not Answered

Open a Specific Picture in DeltaV Operate when a certain alarm is triggered

Hi Everyone,

I`m trying to write a script that will Open automatically a certain Picture in DeltaV Operate Run and POP UP a windows telling the operator that a certain variable of in one of my control modules have changed from 0 to 1.

I`ve seen that there are come threads in this blog that discuss similar cases, and they try to solved my problem with the Scheduler, but I am new with this tool so if some can guide me to the solution I will appreciate.

Thanks

4 Replies

  • Yes the scheduler is the best place to do this. I'm a bit tied up to get into details right now. I'll try to get you a solution within a couple of days.

    I suggest you start by creating a scheduled event that looks at a sample module parameter you can trigger on demand. This will let you learn how to work with the scheduler functions to run the required code at the right time. Start with a module assigned to the Pro Plus that contains a simple Boolean parameter. Then create a schedule event that looks for this parameter to transition to true. When the event fires, it can simply drive a MSGBOX to confirm it fired as expected.

    What you want to avoid is creating an event that continually fires when the parameter is true. You want a one time event. Once we have figured out the structure of the Schedule event, we can focus on the function to call up the display as a popup using the FRS functions for displays.

    Starting with BOL Operator Basics and Graphics Configuration/Mastering DeltaV Operate/The Scheduler, you should familiarise your self with the capabilities of the scheduler.

    For this application, you will want to use the foreground scheduler, as you will be interacting with displays. that is one question answered.

    In the section on Designing Schedules, the different types of events and actions are explained, so a good read to set your foundation before you start to program a solution.

    With a basic event created that you can control at will, you can then start testing how you want the script to interact with the Operator. You will want to be comfortable with this before you deploy something to the runtime Operators, because if you create an issue, you'll need to resolve it quickly, and this forum is not an emergency support center...

    One suggestion I would have is to have some "override" logic that disables the function quickly. You can create a global variable in the User.FXG project, call it, gb_EnableAlarmPopUp. (gb means Global Boolean variable. this convention is used throughout the global variable projects.) In your schedule script, check to see if this is TRUE. This way, if you enable the scheduler function, but it is misbehaving, you can set this variable to FALSE, and you bypass all your code. This way, you can quickly restore operator console behavior. Make sure you expose this variable in a Datalink that you can get to and quickly. Maybe a utility display.

    Andre Dicaire

  • Thank you very much Andre I will try to configure the scheduler trigered by an event and I will let you know how it goes. 

  • We have a safety popup that can help you.

    First you need a module with a boolean variable.

    Then you go to schedule and add a new event.
    The properties of the event are:

    The event itself you code in VB.

    Private Sub EVENTNAME_OnTrue()
    On Error GoTo ErrorHandler
        Dim strPic2Open As String
                    strPic2Open = "YOUR DISPLAY"
                    frsOpenPic strPic2Open       
        Exit Sub
    ErrorHandler:
            frsHandleError
    End Sub

    If you only want to show it to certain workstations you can filter them:

        Dim strUser As String   
            strUser = frsreadvalue("DVSYS.THISUSER/USERNAME.A_CV")
                
            If (InStr(1, strUser, "PLANTA_") > 0) And _
               StrComp(frsGetComputerName, "WORKSTATION1", vbTextCompare) <> 0 And _
               StrComp(frsGetComputerName, "WORKSTATION2", vbTextCompare) <> 0 And _
               StrComp(frsGetComputerName, "WORKSTATION3", vbTextCompare) <> Then
                    strPic2Open = "YOUR DISPLAY"
                    frsOpenPic strPic2Open
            End If

    Mind that this code will execute whole the time.

    If your variable is TRUE for a certain time then the display will be forced during that time period.

  • In reply to Peterlx01:

    Thank you Andre Dicaire and Peterlx01 with your help i was able to accomplish my task.