KB-28712: Developing a pulse button with a confirmation question.

Question:

How can I create a pulse button that asks whether the user wants to confirm the command?

Solution:

This can be done with Click event. When clicking the button, you must set the tag’s value as TRUE, and then activate a counter tag that counts to 1. In the counter tag’s OnPreset event, create a script that returns the tag’s value as FALSE.

Sample script for the button:

If MsgBox (“Do you want to confirm pulse command?”, 52) = 6 then
Application.GetObject(“Driver1.Tag1”).WriteEx 1
Application.GetObject(“Dados.TagContador1”).Enabled = True
End If


Sample script for the tag counter’s OnPreset() event:

Application.GetObject(“Driver1.Tag1”).WriteEx 0

 

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *