At 12:15 -0400 6/3/04, Michael C. Ashe wrote:
>Code Challenge:
>But I think that it will soon be possible to do exactly what you say above,
>grab a VI's own icon, drag and drop, and (if you have a switch or two set
>and some LabVIEW scripting in place) have the VI replaced on the diagram
>with a subVI created from a template (like the Factorial VI) modified by
>LabVIEW scripting, with the name of the VI replaced, or Run Method calls,
>etc.
>
>We just need to be able to capture the LabVIEW error/exception before the
>error dialog pops up and script away.  Now that I think of it, I don't know
>of anything concrete, but I'd be pretty surprised if someone at NI doesn't
>either already have this or could code it up pretty quickly.

I don't think it is going to be quite that easy.  Ignoring the error message is not 
the same thing as solving a problem.  It is more the old "black tape" solution to an 
error indicator.  AFAIK, LV allocates the local stack space (local variables, Shift 
registers etc.) when the icon is DROPPED on the digram.  For reentrant VIs this 
allocated in the Data Space of the calling VI (and can happen many times).  For 
non-reentrant this is done in the Data Space of the sub vi.

Obviously a recursive VI must be reentrant.  This means that when you drop a VI on 
itself then a local data space is allocated recursively at diagram creation time for 
all recursion depths defeating the purpose of recursion.

Of course LV version 27 will completely revamp how data space is allocated but that 
would be a LOT of work.

-Scott


Reply via email to