LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to modify controls when i have a subvi called?

Hi,

 

I have a little problem... when i click over indicator "Number", the principal Vi is calling a subVi named "SubVi.vi" so... the problem is that when i need to modify other controls there while the subVi called is running yet, I can't... Do you have any idea to do that?...

It's possible?..

 

Thanks... I wait answers.

 

Bellow leave the principal Vi and the SubVi 🙂

Download All
0 Kudos
Message 1 of 14
(3,110 Views)

Not sure what you sorts of control modifications you are trying to do, but there are likely several ways you can tackle it.  In general, you just need to ensure that things are able to execute within the confines of data-flow programming.  For example, you can have the control modifications occur in the handler case for the mouse down event with or parallel to the subvi.  Or, if you mean that you want other parts of your program to remain repsonsive while the subvi executes you can use parallel loops or, depending on the circumstances, dynamic execution of VIs etc.  Better description of what you are trying to accomplish might help.

Message 2 of 14
(3,092 Views)

Thanks for te answer Codeman...

 

Can you send me an example of Vi's dynamic execution? Maybe i can use that method for it i want to do.

 

Regards.

0 Kudos
Message 3 of 14
(3,082 Views)

You have several major flaws in your current architecture. The first is having a subVI with a while loop in the event structure. The second is having a 0 ms timeout. The third is having a constant wired to the termination terminal in the main while loop. Nothing really makes any sense. You can certainly look at the asynchronous examples but the overall design needs work.

Message 4 of 14
(3,079 Views)

Thanks for the answer Dennis.

 

Well... I want to make a program that allow to me modify other controls in the same Vi while i have a SubVi called into a "Mouse Down?" Event.. my question was if that is possible.. maybe exist a better method, right. For that reason i asked for help here.

 

Regards.

0 Kudos
Message 5 of 14
(3,076 Views)

Your poblem is the fact that an event typically locks the front panel until the code inside of that event case is complete.  So you can't manipulate anything on your main front panel until that subVI is complete.  This is why we say it is a really bad idea to put loops inside of event cases.

 

What do you actually need that subVI to do?  Right now, it is a very poor example.  If we had some more information, we might be able to suggest a better way.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 14
(3,055 Views)

Thanks for your answer CrossRulz

 

The SubVi that i go to use is a numeric keyboard, for it i thought that was more efficient to use events... but as you see the program don't results it that i wanted.

 

I go to explain better:

 

I have a number of indicators, when i click in one of them will appear a numeric keyboard (subVI) that will allow me write a number there. (Vi main will be run on a touch panel)

 

If events do not allow me to do what I want, what method can I use then?

 

Regards.

0 Kudos
Message 7 of 14
(3,044 Views)

It does not make much sense to use anything at all to allow a user to enter data into an indicator. A control is used for user data entry. If you have multiple controls, why wouldn't you enter data one at a time?

Message 8 of 14
(3,035 Views)

Ricardo23 wrote:

The SubVi that i go to use is a numeric keyboard, for it i thought that was more efficient to use events... but as you see the program don't results it that i wanted.


Well, now things make sense.

 

From a UI standpoint, you don't want people to manipulate things on your main front panel while the keyboard is up.  You should be using an event structure in your keypad VI to capture the button presses on that panel and then close the subVI when an OK or Cancel button are presssed.  You can then pass your new value out of the subVI to update your control/indicator on the main front panel.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 9 of 14
(3,023 Views)

Dennis, i use Local variables of the indicator to modify its values...

 

And CrossRulz, all the contrary, I want the controls that are in the main vi can be modified while the keyboard is up.

 

Regards.

 

0 Kudos
Message 10 of 14
(3,012 Views)