04-25-2015 08:44 AM
04-25-2015 10:44 AM
@mikeporter wrote:
I think everyone eventually builds a wait with error clusters. There are a couple enhancements you might want to consider.
1. Include a case structure so of there is an incoming error the delay is bypassed. For short delays it won't make much of a difference, but for delays of multiple seconds it is a good thing to have.
2. Configure this VI as a shared clone. In one of the posts I wrote on dynamically launching VIs I talked about this feature in detail, but the short version of the story is that they offer all the runtime benefits of reentrancy but without the need to have maybe hundreds of instances in memory at once. It does this by creating a pool of clones. When one is needed, the execution engine goes to the pool and uses one that is not currently busy.
Mike...
I learned #2 the hard way. I was wondering why my waits were a lot longer than they should be. Then I realized the waits were approximately the same as all the waits on the program added together. That was what tipped me off. How embarrassing. Thankfully I only embarrased myself because it was something I was working on at home. (But I see this a lot when I go to a new place. Of course I then go into the existing code and see that they don't have anything running in parallel so they just never noticed it.)