03-20-2022 08:54 PM
So once you click on RUN, then start test. You will notice the relay 1, 2, 3, and 4 keep turning On and off one after the other. So I want to be able to pause the run then continue where I left off. The way I would like to do it is when the circled indicator shown on the picture is ON for more than 2 seconds, I want the run to stop. I have tried to use it as local variable and use the >= 2 secs block and didn't work. Maybe I was doing it wrong. The thing is I keep getting lag when using local variable.
I've been struggling to find a way to do it. Can someone please help me? I have attached my main VI, including the type def VI used.
03-20-2022 10:31 PM - edited 03-20-2022 10:32 PM
Your code is large and messy.
Clean it up and I'll take another look.
03-20-2022 10:41 PM
You need a shift register on the loop that stores the starting time of the boolean transition from False to True. If the input is False, reset the time to current. When the current time minus the transition time is greater than 2 seconds, run an inner loop that only reads the digital input. When the input is False, exit the inner loop and continue running the outer loop.
03-21-2022 03:30 PM
I figured it out.
03-21-2022 03:36 PM - edited 03-21-2022 03:37 PM
@GRCK5000 wrote:
I figured it out.
Since this forum also operates as a place to learn LabVIEW, would you mind if you shared your solution, or at least give a brief description of what you did (and then mark that post as the solution), so that someone else who might have this problem can learn from your experience?
Thanks.
03-21-2022 04:03 PM - edited 03-21-2022 04:04 PM
"If you weren't supposed to push it, it wouldn't be a button." I proved you wrong. 😁
03-22-2022 04:40 PM
@GRCK5000 wrote:
"If you weren't supposed to push it, it wouldn't be a button." I proved you wrong. 😁
I didn't see any proof of anything. What is it that you believe you have proved?