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
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