07-27-2023 09:54 AM
Hello,
I want when my Discard button is clicked(on) it stays on for 30 seconds then goes back to off;
How can I do this please?
Thanks you
Solved! Go to Solution.
07-27-2023 10:31 AM
So currently, it does not do that, right? A latch action button resets when the terminal is read by the code, so you could place the terminal into the timeout case and enable a 30s timeout when clicked.
Of course any other event will also reset the timeout, so you need to work around that.
07-27-2023 10:37 AM
Here's a quick draft doing 5 seconds (easier to test).
(Of course a real solution would be more scalable if there are other events.)
07-27-2023 10:54 AM
At this point, we might want to be asking "why" because there might be a better solution than this approach.
07-27-2023 11:01 AM
@billko wrote:
At this point, we might want to be asking "why" because there might be a better solution than this approach.
Of course there is!
Once we have the full picture, more and better code will be needed. Maybe latch action is not even the right setting. For example what else should be allowed or not allowed during these 30 seconds (a very long time for a computer!!!!). etc
07-27-2023 11:37 AM
Hi @altenbach,
07-27-2023 12:20 PM
LabVIEW is a rich programming language, so everything is possible once you define all requirements.
07-27-2023 12:35 PM
Hi @ altenbach,
1. If you press the button again, it remains ON for 30 seconds and then returns to OFF (it won't change, it's the same).
2. The goal: I actually have a plugin that notes the value of the button in a csv file when the user presses the Discard button.
The Discard button indicates that the session is false and so it must remain pressed after 30 seconds because it cannot remain ON throughout the scenario. It is used for an annotation.
3. A 30 second delay has been set to allow the logger to write to the annotation file.
If I set the button to latch mechanical, for example, I won't be able to see in the annotation file that the Discard button has been pressed because it's very fast. the logger won't have the time.
07-27-2023 12:53 PM
Nothing you explain makes much sense.