Timer for Binary Switch Button
-
I am trying to add a binary switch button to my dashboard that I can turn on manually through the dashboard and after X amount of seconds it turns off automatically. I do not see any parameters where I can change these settings. Are there any functions/settings/parameters that can enable me to do this timing functionality with a toggle switch? Can I get some help on this?
Mango Core Verison: 3.6.0
Mango API Module Version: 3.6.0
Mango UI Module Version: 3.6.1
Platform: Windows 10 Pro
Browser: Google Chrome -
@shehryar-tariq said in Timer for Binary Switch Button:
I am trying to add a binary switch button to my dashboard that I can turn on manually through the dashboard and after X amount of seconds it turns off automatically.
This is something that you should ideally do within your PLC program. If you are not using a PLC you can do it from the Mango backend using an event detector.
The reason for this is that if you close the tab/window, or if there is some sort of communication issue the command to turn the binary point back off will not get sent.
@shehryar-tariq said in Timer for Binary Switch Button:
Are there any functions/settings/parameters that can enable me to do this timing functionality with a toggle switch? Can I get some help on this?
It is possible to do this from a dashboard, but I would not recommend it as per above.
-
Thank you for your response but I am not using a PLC. Can you please explain what do you mean by using backend Mango? I thought event recorder is only for getting events, I don't think it can trigger anything, can it?
What I intend to do is that I have a toggle switch shown above, and I want it to automatically close once I manually turn it on after a certain time delay
-
To be more explicit about how to do this with an event detector -
-
Add a binary state detector to your binary data point
-
Under the state tab, choose the true state and set the duration to X seconds
-
Save event detector
-
Go to event handlers page
-
Add a "Set point" event handler
-
Under the "Set point" tab choose your binary point
-
Under the "Event types" tab select your binary state event
-
Under the "Active action" tab, choose "Set to static value" and set the value to false
-
Save event handler
-
-
@shehryar-tariq said in Timer for Binary Switch Button:
I thought event recorder is only for getting events, I don't think it can trigger anything, can it?
The event detectors are used to monitor for certain conditions and trigger an event/alarm yes. But you can hook up event handlers to these events to perform actions.
-
Something that might be useful - you can create a single event handler that you can attach to multiple event detectors.
- Change the event handler to "Set to scripted value"
- Add this script -
var points = DataPointQuery.query('eq(id,' + event.referenceId1 + ')'); points[0].runtime.set(0); return UNCHANGED;
This will make the handler lookup the point which triggered the event and set that point back to zero.