From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using subVI as control?

Solved!
Go to solution

@prettypwnie wrote:

 

And yeah, it's a functional global not a global variable.


In addition, "global" implies just that, so once the subVI is preallocate/reentrant, there is nothing "global" about it. Each subVI instance has it's own sandbox. (... which we want in this case, of course!)

 

Action engines and functional globals are typically non-reentrant so the data can be shared globally.

 

Semantics. 😄

 

 

0 Kudos
Message 11 of 15
(846 Views)

Yeah, I tend to always say functional global when referring to an uninitialized shift register, but you're right, its a bit misleading to say it's "global" when it has pre-allocated reentrancy.

0 Kudos
Message 12 of 15
(841 Views)

@altenbach wrote:

You can handle all possible state transitions by creating an array with four elements (the current boolean values and their previous value from a feedback node), converting it to a number (boolean array to number) and wiring the number to a case structure.


Here's a quick example. Notice that the logic is now MUCH simpler than yours. 😄

 

 

 

(please verify correct operation. It would be easy to implements the logic into a subVI using the references as mentioned already).

 

Message 13 of 15
(824 Views)
Solution
Accepted by topic author RaymondLo

altenbach wrote:
It would be easy to implements the logic into a subVI using the references as mentioned already.


 

Here's an example for that.

 

 

Message 14 of 15
(818 Views)

@altenbach

Thanks! This does seem much nicer. I am sticking with what I had because it's working and it's a subVI so it doesn't really mess with the main BD, but this is definately a much nicer way to handle the boolean logic and I will keep an approach like this in mind next time I try and do some boolean binding.

 

Best,

Ray

0 Kudos
Message 15 of 15
(783 Views)