|
Re: OpenCV and New Control System
Not to continue the hijack, but the reason that the signal processing may seem cleaner implementation is that they often flip the state storage from the outer diagram into the subVI. As an example, if a filter has state, it is possible to require the caller to be responsible for the state, pass it in, update it, pass it back out, etc. This is totally legal, but since it spills out on the the top diagram, it just ends up looking messier. It also exposes the important state info in a way that it can be mucked with unnecessarily.
To tidy things up a bit, the state is kept within the subVI, which is usually made reentrant so that the states from different calls don't mix. So, to apply this idea to the Boolean toggle, you make a subVI from the whole thing, one Boolean in, one Boolean out. You have to figure out a name that represents it well, and you end up with something that works well in more complicated diagrams. The only subtle difficulty to this is the initialization.
Greg McKaskle
|