• Not Answered

Storing previous mode in Deltav Operate to display it for confirmation dialog box

I need to display a confirmation box for changing mode.  Please let me know whether we can store any text value in VBA script of deltav operate as we do in Control studio VB scripting.

Please find below the Deltav Operate script which I am working on :

Private Sub CommandButton14_Click()

   'The Comments below have been added automatically.

   'Any changes could cause adverse effects to the functionality

   'of the Script Authoring Experts.

   'WizardName=ToggleDigitalPoint

   'Property1=DVSYS.A47010_CMPR_1/HS-6152.F_CV

   'Property2=False

   Dim RESPONSE As String

   Dim CurrentMode As String

   Dim LastMode As String

   CurrentMode = frsreadvalue("DVSYS.A47010_CMPR_1/HS-6152.A_CV")

   RESPONSE = MsgBox("Do you want to change mode from " & CurrentMode & " to " & LastMode & " ?", vbYesNo, "confirmation")

   If RESPONSE = vbYes Then

   ToggleDigitalPoint "DVSYS.A47010_CMPR_1/HS-6152.F_CV"

   End If

   LastMode = CurrentMode

End Sub

4 Replies

  • It is possible to store values in DeltaV Operate, however, what happens if the parameter was toggled through another station or some other means like control studio? This would present a problem for your VB logic.
     
    If you want to store last mode, use a parameter in the module itself and a BDE / ACT block to capture the last value.
     
    When you discuss modes, are you referring to CAS/AUTO/MAN etc. or do you really mean a toggled digital point? Remember MODE is not a two state point (toggle), whereas the logic you present will only work for two states.
     
    Hope this helps.
     
    Adrian
     
     
    From: shivraj.andelwad [mailto:bounce-shivrajandelwad@community.emerson.com]
    Sent: Friday, February 22, 2013 9:55 AM
    To: DeltaV@community.emerson.com
    Subject: [EE365 DeltaV Track] Storing previous mode in Deltav Operate to display it for confirmation dialog box
     

    I need to display a confirmation box for changing mode.  Please let me know whether we can store any text value in VBA script of deltav operate as we do in Control studio VB scripting.

    Please find below the Deltav Operate script :

    Private Sub CommandButton14_Click()

       'The Comments below have been added automatically.

       'Any changes could cause adverse effects to the functionality

       'of the Script Authoring Experts.

       'WizardName=ToggleDigitalPoint

       'Property1=DVSYS.A47010_CMPR_1/HS-6152.F_CV

       'Property2=False

       Dim RESPONSE As String

       Dim CurrentMode As String

       Dim LastMode As String

       CurrentMode = frsreadvalue("DVSYS.A47010_CMPR_1/HS-6152.A_CV")

       RESPONSE = MsgBox("Do you want to change mode from " & CurrentMode & " to " & LastMode & " ?", vbYesNo, "confirmation")

       If RESPONSE = vbYes Then

       ToggleDigitalPoint "DVSYS.A47010_CMPR_1/HS-6152.F_CV"

       End If

       LastMode = CurrentMode

    End Sub

  • In reply to AdrianOffield:

    Thanks Adrian,

    The Control studio parameter is a input parameter assigned to a Named set ( Auto/Man modes only). I am using digital toggle point to write 0 and 1 on the parameter whenever operator selects the commandbutton.

    Please let me know if there is best way we can do this.

    Is it best practise to use mode parameter instead of Named set?

  • Hi,
     
    I don’t fully comprehend what it is you are trying to accomplish, the HS you are using is a Boolean that is linked to a named set, is that correct?
     
    The named set contains two states 0 = Auto, 1 = Man and I assume 255 is undefined, is this correct? What is the purpose of this mode parameter?
     
    Sorry for all the questions but I need to understand your goal before I would offer a suggestion.
     
    From: shivaraj123 [mailto:bounce-shivrajandelwad@community.emerson.com]
    Sent: Friday, February 22, 2013 12:52 PM
    To: DeltaV@community.emerson.com
    Subject: RE: [EE365 DeltaV Track] Storing previous mode in Deltav Operate to display it for confirmation dialog box
     

    Thanks Adrian,

    The Control studio parameter is a input parameter assigned to a Named set ( Auto/Man modes only). I am using digital toggle point to write 0 and 1 on the parameter whenever operator selects the commandbutton.

    Please let me know if there is best way we can do this.

    Is it best practise to use mode parameter instead of Named set?

  • In reply to AdrianOffield:

    Change the command button so that it opens the message box only, when you get the feedback from messagebox 1 or 0, then you execute the original command button code. (if answer is  no-> end.)

    Niklas Flykt 

    Klinkmann Oy

    Key Account Manager safety products

    nikfly@gmail.com