LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pausing execution of a VI

Solved!
Go to solution

Hello, I am fairly new to LabView.  For the VI I am writing, I would like it to pause at a certain point, wait for the user to click a button (which is wired to a case structure), and then continue execution based on the case that was selected.  I'm not sure how to do this.  Does anyone have any advice? 

 

Thanks!

0 Kudos
Message 1 of 13
(4,633 Views)

You could use an Event Structure to implement the solution.

 

Actually there are many approaches... 

 

To better understand what you want to do, I need to ask the following questions:

 

1.  No matter what, until that button is pressed, you want the sw to pause.  Is that correct?

 

2.  What happens if the button does not provide the selection or option that the operator wants?  does the sw wait forever?

 

3.  Are you implementing an interface where the operator must make some sort of selection, entry or "something" and then must click a button to accept the settings?  If so, you could even have a sub vi that loops until the button is pressed, and it passes all the collected values to the calling VI.

 

4. Can you provide some additional information on what you want to do?

 

R

0 Kudos
Message 2 of 13
(4,619 Views)

 

Thanks for getting back to me!

Basically, I have 2 text strings in the front panel of the VI- one is patient-specific and the other is a backup.  Labview opens another program, which uses the patient-specific string to create a model.  I would like the VI to pause at this point to allow the user to check the model in the other program.  If the model looks good, then they will click "model ok" in labview, and labview will continue, using the patient-specific string.  If the model doesn't look good, then the user will click "model NOT ok", and labview will continue, using the backup string.

 

So in other words, there is no data entry at all- all the user has to do is click a boolean to TRUE or FALSE to continue execution of the VI.  It would be fine to set it to wait a maximum amount of time, say 5 minutes, before continuing on it's own.   Ideally, I'd like it to go as soon as the button is checked.

0 Kudos
Message 3 of 13
(4,610 Views)

Hi,

Can you tell me which case should execute after 5 mins like your are telling that " It would be fine to set it to wait a maximum amount of time, say 5 minutes, before continuing on it's own " is it that you want to set an default case to execute or 5mins delay for every button click. What that on its own, Can you explain still clear.

Regards
Aks

(Appreciate answers by giving KUDOS)
Hit the stars.............. sky is not the limit.
0 Kudos
Message 4 of 13
(4,584 Views)
I guess I'm not making myself clear- it may be that this issue is beyond my capabilities.  I would like the VI to pause at a certain point, the user clicks a boolean to "true" or "false" and then hits OK to continue execution of the VI.  If it's not possible I wouldn't be at all surprised. 
0 Kudos
Message 5 of 13
(4,554 Views)

Everything is do-able...  😉

 

Have a look at the attached example for a sample solution using radio buttons. 

There are many ways of creating a solution.  You need to define more what you want.

 

R

 

 

Message 6 of 13
(4,547 Views)
Solution
Accepted by chlloyd
I just found a solution- I simply put a "wait (ms)" inside of a while loop.  I wired i+2 into the wait icon, and an "ok" button wired to the stop condition terminal in the while loop.  So now, the "wait" runs until the user selects the case and then hits "ok", which stops the "wait" and allows the VI to continue execution.
0 Kudos
Message 7 of 13
(4,547 Views)
And thanks for all of your help... it's probably frustrating trying to help someone who doesnt know what they are doing!
0 Kudos
Message 8 of 13
(4,544 Views)

LOL!  Not at all..

 

We were all at that level at some point in our career.  Just having fun helping others..

 

R

0 Kudos
Message 9 of 13
(4,524 Views)

JoeLabView,

 

Are you usually the Dilbert icon?  I like your psycho pumpkin avatar - a kind of nintendo spasm inducing freak-out deal!

 

Cheers,

cb

0 Kudos
Message 10 of 13
(4,513 Views)