Question:
How can I create a button whose pulse lasts 1 second?
Solution:
To do so, you must use a Counter Tag, and set it up as described:
CounterType: 0 – Preset
Enable: False
Increment: 1
Preset: 1
ResetCounterWhenEnabled: True
On the button generating the pulse, use a script that activates the desired output, and then enable the counter.
Sample script:
Application.GetObject(“Data.InternalTag1”).Value = 1
Application.GetObject(“Data.CounterTag1”).Enabled = True
Application.GetObject(“Data.CounterTag1”).Enabled = True
On the Counter Tag’s OnPreset event, use a script to both turn off the output previously activated and disable the counter:
Parent.Item(“InternalTag1”).Value = 0
Enabled = False
Enabled = False