06-24-2006 01:40 PM
06-24-2006 02:19 PM
@greg wrote:But what if you had a breakpoint set on the subVI. At the breakpoint, the panel is open, and you type in new data. Oops. The caller is supposed to protect the data, but if the terminal is conditionally read, it can't predict you won't do what I just described. On the otherhand, if the terminal is on the top level, the breakpoint on this VI will always happen after the data from the terminals is read. That means the subVI can truly be inplace only if its terminal is owned by the top diagram and not placed into a loop, sequence, or case diagram.
Although, since breakpoints are exposed in the VI server object hierarchy, it should be theoretically possible to only copy the data if a BP has been set, wouldn't it?
Or would that take up too much resources?
Or maybe there are other cases where you couldn't guarantee the inplaceness?
See what you get when you expose the decision making process? A lot of pests second-guessing your decisions...
BTW, I'm fairly sure that the part about placing the terminals in the root of the diagram has been documented in the style guide, so you should be alright there...
06-24-2006 02:34 PM
@greg McKaskle2 wrote:
That means the subVI can truly be inplace only if its terminal is owned by the top diagram and not placed into a loop, sequence, or case diagram.
06-24-2006 09:12 PM
06-25-2006 10:27 AM - edited 06-25-2006 10:27 AM
Hi Greg eta al,
I think I got it!
The attached code an image illustrates what I concider a common construct that illustrates the point.
In the "good" version, the control and indicator are on the root of the diagram and LV can see that the array of the caller can be the same VI inside the sub-VI and the same with the returned data.
The "bad' version force a data copy.
On my laptop an array size of "1000000" and loop count of "1000" and error is "false"
Good = 1uSec
Bad = 23 mSec
With error = True
Good = 1uSec
Bad = 47 msec
Generally, the time required for "Bad" scales with array size (because of the copy) while "Good" is fixed up untill you run out of physical memory.
Thanks Greg!
Ben
Message Edited by Ben on 06-25-2006 10:28 AM
07-17-2006 03:57 AM
07-17-2006 07:33 AM
Rolf wrote;
"I had been right all the time "
After reading your posting for 7 years now, I have to agree.
Ben