12-26-2017 12:18 AM
Hi
There is a buffer allocation of the cluster on the input tunnel of the case structure.
Why is this happening, and more important, how can I avoid it?
12-26-2017 07:19 AM
It's happening because the Case Structure needs a copy of the cluster to operate on regardless of how it's branched externally.
I don't have LV on this PC. But, depending on what your logic is in the False case, you likely can replace the structure entirely with something else if you're worried about the allocation. For example, what's shown here can be replaced with a Select.
If you get to a place where your buffer allocations are causing harm, you can potentially take a look at DVRs. Although, I'd be careful with those. They will benefit you in the way they'll only ever duplicate a pointer instead of the entire cluster. But, they can also introduce race conditions if you're not handling them well.
12-26-2017 07:31 AM
You might try the In-Place Element structure (which, if the name is to be believed, operates "in place", without allocating another copy). Of course, another copy will be needed for the Output variable. Note that I simplified the Case Statement -- "if input is True, output is False, while if input is False, output is False" is equivalent to "output is False".
Bob Schor
12-26-2017 11:40 AM
That isn't a buffer allocation. It's a terminal that's been configured to automatically wire the data through the structure. This is used when you might add a case later but need to have the cluster wired through in all cases.
If you right-click the output terminal you can "clear" the link.
12-27-2017 07:27 AM
While we are looking at simplification, why not just remove all structures. Just use the bundle and input the False if both cases update it to False?