06-21-2016 12:29 PM
@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. 😄
06-21-2016 12:33 PM
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.
06-21-2016 02:45 PM - edited 06-21-2016 02:45 PM
@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).
06-21-2016 02:53 PM - edited 06-21-2016 02:53 PM
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.
06-23-2016 10:50 AM
@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