LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change the value of a boolean through other VI

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 🙂

0 Kudos
Message 1 of 5
(2,805 Views)

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?

0 Kudos
Message 2 of 5
(2,785 Views)

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 🙂

0 Kudos
Message 3 of 5
(2,731 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 5
(2,722 Views)

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


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 5
(2,717 Views)