LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable the whole vi?

Dear All,
         Because the sub-vi uses much memory, when it is running, I want to forbid the user to run other sub-vi.
         That is when the user presses the button to run the sub-vi which uses much memory, I want to the user don't press other button before the sub-vi finishes. Otherwise the vi will be error.
         I see that it can be done by disable buttons one by one. But is there any more easy way?
 
Thank you.
0 Kudos
Message 1 of 6
(3,404 Views)
You can use the even-structure for this. When the user hits the button the event launches the sub-vi make sure that in the event-options the check-mark is placed for the 'lock the front panel....' this locks-up you GUI and will prevent any interaction of the user.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 2 of 6
(3,395 Views)
Thank you for your reply.
But I don't understand how to do it.
Can you give me some details? I use LV7.1
Thank you.
0 Kudos
Message 3 of 6
(3,375 Views)

Oh,I see it.

But if the button is not in the event case for some reason, how to lock the front panel?

 

Thank you.

0 Kudos
Message 4 of 6
(3,371 Views)


hugoliang wrote:
         Because the sub-vi uses much memory, when it is running, I want to forbid the user to run other sub-vi.

You leave out a lot of information.

  1. How does a user "run another subVI".
  2. What is the structure of your main program (e.g. state machine).
  3. How does your program call the subVIs (direct, via reference, etc).
  4. Why does the program use so much memory? Maybe the code is not very efficient and you create more datacopies in memory that actually needed (e.g. overuse of local variables, etc.)

Typically, the only thing you need to do is use proper dataflow and e.g. place all your possible subVIs is different cases of a case or event structure. Once you do this, only one case can run at any given time.

Personally, I would not "lock out" the front panel. The user interface loop should not be blocked and should still and allow simple user interactions, just not lauch an additional heavy CPU process. Alternatively, you could "disable&grey out" certain buttons. Switch the cursor to the hour-glass+arrow, etc. to indicate that the program is actually doing something useful and has not e.g. crashed or locked up. 😉

To give more specific advice, please attach a simplified version of your program.

Message 5 of 6
(3,370 Views)

Ok, Thank you. I will follow your advice to disable certain buttons.

Thanks!

0 Kudos
Message 6 of 6
(3,361 Views)