12-30-2013 08:25 AM - edited 12-30-2013 08:28 AM
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 🙂
12-30-2013 09:06 AM
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.
12-30-2013 09:27 AM
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.
12-30-2013 09:37 AM
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.
12-30-2013 09:52 AM
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.
12-30-2013 10:08 AM
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.
12-30-2013 10:55 AM
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.
12-30-2013 11:09 AM
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?
12-30-2013 11:27 AM
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.
12-30-2013 11:44 AM - edited 12-30-2013 11:48 AM
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.