LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pause a vi programmatically (with many loops and cases)

Solved!
Go to solution
Solution
Accepted by topic author ASH2020

Your event case is probably has the checkbox set to lock the front panel until the event completes.  Since the Mouse Down event is still running, the front panel is locked and you can't press the stop button to cause the inner loop to stop, which is what you need to have happen for the event case to complete and the front panel to unlock.

 

It is a catch-22.  Event structures really should not have long running code or loops that need other interactions to stop them inside of them.

 

Read Caveats and Recommendations when Using Events in LabVIEW - LabVIEW 2016 Help

Message 21 of 25
(1,176 Views)

@RavensFan wrote:

Your event case is probably has the checkbox set to lock the front panel until the event completes.  Since the Mouse Down event is still running, the front panel is locked and you can't press the stop button to cause the inner loop to stop, which is what you need to have happen for the event case to complete and the front panel to unlock.

 

It is a catch-22.  Event structures really should not have long running code or loops that need other interactions to stop them inside of them.

 

Read Caveats and Recommendations when Using Events in LabVIEW - LabVIEW 2016 Help


Thank you. You are a star! That was the vital piece of information I was looking for through this whole thread. I had missed that check box and now it works beautifully. Well done.

BTW, there is no getting away from the fact I have to loop 10 times, at 4 second intervals and I have to have a way of pausing it. Thanks again.

Andrew

 

0 Kudos
Message 22 of 25
(1,172 Views)

@ASH2020 wrote:

@RavensFan wrote:

Your event case is probably has the checkbox set to lock the front panel until the event completes.  Since the Mouse Down event is still running, the front panel is locked and you can't press the stop button to cause the inner loop to stop, which is what you need to have happen for the event case to complete and the front panel to unlock.

 

It is a catch-22.  Event structures really should not have long running code or loops that need other interactions to stop them inside of them.

 

Read Caveats and Recommendations when Using Events in LabVIEW - LabVIEW 2016 Help


Thank you. You are a star! That was the vital piece of information I was looking for through this whole thread. I had missed that check box and now it works beautifully. Well done.

BTW, there is no getting away from the fact I have to loop 10 times, at 4 second intervals and I have to have a way of pausing it. Thanks again.

Andrew

 


Ummm... no.  You are using a band-aid to cover bad habits.  The proper thing to do is make it so you don't have to lock the front panel.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 23 of 25
(1,154 Views)

@billko wrote:

@ASH2020 wrote:

@RavensFan wrote:

Your event case is probably has the checkbox set to lock the front panel until the event completes.  Since the Mouse Down event is still running, the front panel is locked and you can't press the stop button to cause the inner loop to stop, which is what you need to have happen for the event case to complete and the front panel to unlock.

 

It is a catch-22.  Event structures really should not have long running code or loops that need other interactions to stop them inside of them.

 

Read Caveats and Recommendations when Using Events in LabVIEW - LabVIEW 2016 Help


Thank you. You are a star! That was the vital piece of information I was looking for through this whole thread. I had missed that check box and now it works beautifully. Well done.

BTW, there is no getting away from the fact I have to loop 10 times, at 4 second intervals and I have to have a way of pausing it. Thanks again.

Andrew

 


Ummm... no.  You are using a band-aid to cover bad habits.  The proper thing to do is make it so you don't have to lock the front panel.


The front panel isn't locked now. That's the whole point. That's what the problem was all along. And BTW, people don't learn very well if they are criticised. I have done my best, it is moderately tidy and it works very well, oh, and I've delivered it on time.

0 Kudos
Message 24 of 25
(1,148 Views)

Hi Andrew,

 

BTW, there is no getting away from the fact I have to loop 10 times, at 4 second intervals and I have to have a way of pausing it.

We didn't say so.

We suggested to implement a producer-consumer scheme, maybe combined with state machines. You still should handle UI events with an event structure!

 

I have done my best, it is moderately tidy and it works very well, oh, and I've delivered it on time.

If it's ok for you and you done your job, it might be ok in general.

As long as nobody else has to support any future development based on your VI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 25 of 25
(1,134 Views)