09-23-2018 02:46 PM
Hi guys,
Imagine a case where I have a vi with a couple of sub-vi (A and B), each of it changes the value of a boolean.
I'd like to control the value of these booleans through the main one. The idea is to activate the boolean of A and 1 minute later activate the boolean of B, all of it automatically. How can I do that?
Many thanks 🙂
09-23-2018 03:38 PM
If the subVIs and the caller fight for changing the same boolean we have a contention. Who should win?
What is the architecture of the subVI? Do they contain a loop or return immediately? What do they do?
You can change controls via references wired to the subVI and value property nodes. OTOH, they can keep their own time, for example if the switch delay is one of the wired numerical controls when each is called.
I have the nagging feeling that you should try to approach the problem differently. What does the program (caller, subVIs) do?
Can you attach some simplified code so we have a better understanding of the issues?
10-08-2018 04:40 PM
Hi,
I don't really understand how labview works, but I have a vi whose function is to open a hatch remotely (and a lot of extra functions), I have another that sets the frequency of a device remotely.
The idea is, through a vi on the top of the hierarchy, do both functins automatically (press open of the subvi 1, and set the frequency on subvi 2) without modify these subVI's.
Many thanks 🙂
10-08-2018 05:34 PM
Seeing code would really help. However, overall it sounds like you are trying to make some existing code work in ways it was intended or designed. Like Christian asked, are these subVIs called and then left to run on their own or are they called and the main VI will wait on them until their execution is complete? If the first, then you need some messaging between the top level control and the lower level tasks. Queues work well for this.
10-08-2018 06:28 PM - edited 10-08-2018 06:35 PM
Watch the flame war go...
Use a global variable.
Better set a notifier and get notifier with history
Advanced use a channel wire
In no case mentioned does "not modify subvi" become a realistic option. If the subvis function is to "control opening a hatch" after co editions are met.... the subvi should monitor those conditions and act per design... forcing implementation details into the caller is problematic at best, ranging straight though poorly designed and possibly past ludicrous into plaid!
"We've gone plaid!" -Mwag