impuls on Button Click

Hi Everyone,

how can I generate an impuls on Button Click on Control Module Tag in DeltaV Live System?

thanks

  • Are you wanting to create a one shot write, or do you want to write a value to true and some time later write that value back to false?

    A one shot is easily accomplished with a Button object that will write the value to the target parameter. The state of the parameter can be reflected using a color expression on the background or outline.

    For a time pulse, you would add a timer that starts with the value going to 1 and then writing the value to 0 when the timer times out. But I would not recommend this approach. If for some reason the button is pressed and display is closed, or for what ever reason the timer function is interrupted, the value would remain on indefinitely. It would be more robust to add a pulse timer to the Control Module where you start the pulse from the console and let the module finish the pulse action. this would be a more deterministic implementation and ensure the module is always able to terminate the pulse.

    Andre Dicaire

  • In reply to Andre Dicaire:

    Hi Andre,

    thanks for your reply.

    I would like to make one shot, that means it should set a bit with the button click, and reset it by unclicking the button. At the same time I would like to visualise it on the button color. Is it possible?

    Thanks,
    Kobrizo

  • In reply to KoBriZo:

    Yes, it is possible. However, some knowledge of VB (Visual Basic) is needed!
    So, find a simple course on Visual Basic programming. You don't have to go too deep, but some understanding will help!

    A button has several events to configure. The standard action is the 'OnClick'-event. This is what you used.
    Instead of using this OnClick you could use the 'OnMouseDown' and the 'OnMouseUp' events to fire two actions one after the other.

    When you understand this text, give it a carefull try.
    When you do not understand this text, first do a simple course on Visual Basic programming.
    And, be aware that the VB dialect used in DeltaV may differ from other dialects.
    And, you will program this at you own risk. It is safe when you know what you do.
  • In reply to Maarten van der Waal:

    Hi Maarten,

    unfortunately there is no VB option in DeltaV Live. It needs to be a TypeScript code.

    thanks
  • In reply to KoBriZo:

    There is no On Up/On Down Interaction in Live. Your button behavior would need these, and that is what you would use in VBA in Operate.

    I'm not aware that Mouse Button actions can be responded to within the typescript environment of Live,

    One option would be to combine two buttons that toggle the value, and use visibility to show the button that is opposite of the current value. Click ones for down, click again for Up logic. This is not the same, but results in the same write sequence.

    Andre Dicaire

  • 1. Create button from palette.

    2. Select action "Write Value to Destination"

    3. Write conditional to change value based on value observed. Example: Dsp.intButton == 0 ? 1 : 0 check if Dsp.intButton equals 0 and sets value to 1, else sets value to 0.  These conditionals can be nested.

    4. Set destination as desired, usually the same thing that is driving the value.  Example: Dsp.intButton.

    5. If animation desired, choose or create animation.  Text changing on click requires additional custom scripting (choose custom script as action, write TypeScript code to drive text of button object and value writing) or a layering of a text box that is driven by a script.

    6. Test.

    Ben Merryman