Momentary Push Button

How can I create a momentary push button in DeltaV. 

13 Replies

  • Did you mean push button on graphic for select graphic page or to start stop
  • Yes,  in deltaV graphics page create momentary push button for start,  stop,  acknowledgement purpose. 

  • In reply to krishna sen:

    As i know for each start or stop process should be done through class module and each class module have faceplate and you can use the fp button ,this is recommended from Emerson and i saw different costumer project use the class module
  • My problem is different. In control studio I take one input parametet for reset purpose of RS flipflop.how can I link this parameter with momentary push button in deltaV configure? So I can reset Flip-flop from DeltaV operate page.

  • In reply to krishna sen:

    Its depend on the reset parameter coming from which block,when you add push button on the graphic you can select the entry expert and make configuration on this PB
  • I agree with you should try to make this a class base approach but if you decide otherwise you could and the button on the graphic and give it a On Click Event and then do something like this in VBA. The syntax could be off a little as i did not test.


    Private Sub CommandButton1_Click()
    Dim FlipFlopStatut As Variant
    FlipFlopStatut = frsreadvalue("DVSYS.YOUR PARAMETER PATH.A_CV")
    If FlipFlopStatut = 0 Then
    frsWriteValue "1", "DVSYS.YOUR PARAMETER PATH.A_CV"
    Else
    frsWriteValue "0", "DVSYS.YOUR PARAMETER PATH.A_CV"
    EndIf
    End Sub
  • In reply to Nicholas Stom:

    I have a different take on this. I see two ways of creating a momentaty PB. Option 1: For clearing a flip flop, have a parameter that is wired to the flip flop reset. Wire that same parameter to an ACT block that sets the parameter to 0. When a ACT input is high, it can be computationally expensive, but it is not when the input is 0, which is where this input will be the vast majority of the time. The ACT block needs to execute AFTER the flip flop. Option 2: For having an output that is active for as long as the button is pushed and inactive when the button is released (like a Jog function), you'll need to use something other than the click event. I have not personally tested this, but I think that writing a "1" on the button's MouseDown event and writing a "0" on the button's MouseUp event would do the trick. Using this, you'll need to make sure the button is pushed long enough for the module to scan to avoid [Module Scan][Write 1][Write 0][Module Scan], where the module never sees the button push.
  • Can I get VBA code for option:2 ?

  • In reply to krishna sen:

    Again, this is not tested. You will need a parameter wired to whatever logic is needed: DO block, Flip Flop reset, whatever. Something like:

    Private Sub ControlName_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    frsWriteValue "1", "DVSYS.MODULE/PARAMETER.F_CV"
    End Sub

    Private Sub ControlName_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    frsWriteValue "0", "DVSYS.MODULE/PARAMETER.F_CV"
    End Sub

    Where ControlName is the name of the graphic item you'll be using as your pushbutton. If you select the button in DeltaV Operate Configure, right click it and select View Code, you'll be taken to VBA with some default event handler (probably _Click). You'll see two dropdowns above the code pane, one with the name of the control and the other with Click (or whatever the default handler is). Change Click to MouseDown and it will provide the framework for handling the MouseDown event. Select MouseUp and it will provide the framework for handling the MouseUp event.
  • In reply to SBPosey:

    Oh, while I'm thinking about it: if the button is on a faceplate or detail display, the module will be "@MOD@", so:
    frsWriteValue "1", "DVSYS.@MOD@/PARAMETER.F_CV" and
    frsWriteValue "0", "DVSYS.@MOD@/PARAMETER.F_CV"
  • Thanks a lot. After code testing I will revert back to you.

  • In reply to krishna sen:

    Thanks! Don't forget to add error checking logic and you'll need to think about how to handle the situation where the user drags the mouse off the button THEN releases the button (I'm not sure how the MouseMove and MouseUp/Down events are handled when the mouse is moved off the button).
  • In reply to SBPosey:

    Also you can create Name set with two value 0 for start 1 for stop for example.and in control studio for the module that you use you can use input parameter with name set and link to reset Flip Flop,in graphic you select expert to the button and select name set ,its will work