06-22-2006 05:06 PM
06-22-2006 06:46 PM - edited 06-22-2006 06:46 PM
" I am curious..."
Your Q had the same effect on me.
I wrote illustrated benchMark VI's to make sure I would get this right.
It appears the answer to your questions depends on the state of the booelan most of the time.
By using a large array to exagerate the act of reading the control I oberserved some interesting things. It looks we ahve three situations that are coming into play.
1) Not reading the control (because it is in the true case and the boolean is false)
2) Reading the control conditionally (Again control in true case but now boolean is true)
3) Always reading the control.
My findings indicate that
Fastest - Not reading the control
Medium - Always reading the control
Slow - Conditionally reading the control
To me this makes sense. Not doing anything should take less time than doing anything. A control on the root of a diagram lets LV do its thing and optimize the operation. Still slower than doing nothing. The conditional read seems bad.
Thanks for the question!
Ben
Message Edited by Ben on 06-22-2006 06:47 PM
06-22-2006 08:46 PM
You got it right, Ben. If a control or indicator is wired on the connector pane, terminal reads/writes are always most efficient if they are done on the top level diagram. In fact, there is a test that ships with the VI Analyzer 1.1 called "Wired Terminals in Subdiagrams" that looks for violations of this very rule. Here is a sample failure message of that test:
"The control terminal "Numeric" does not reside on the top-level diagram. In order to avoid unnecessary memory copies, control and indicator terminals that are wired on the connector pane should be placed on the top-level diagram."
...and for those of you who recognize this name, Greg McKaskle is the one who requested I add a test to check for this in VI Analyzer 1.1.
-D
06-23-2006 08:19 AM
Darren wrote;
"The control terminal "Numeric" does not reside on the top-level diagram. In order to avoid unnecessary memory copies, control and indicator terminals that are wired on the connector pane should be placed on the top-level diagram."
So that is what that test (I disabled in my configuration) was for!
Ben
06-23-2006 08:30 AM
06-23-2006 09:07 AM
Thanks to Ben for the test.
I hadn't realized that I could just put in stop watches and check elapsed time.
However, since Windows can vector off for no apparent reason (as it is not a real-time OS), can the fact that it can go and service a network packet (e.g) have an adverse effect on the test measurement? I would think that it would be necessary to run the test a statistically significant number of times and eliminate any outliers.
To Darren: pardon my ignorance, but what does the term "connector pane" mean?
To shoneill: Is your question related to why I asked the question, or why the timing data shows what it does?
06-23-2006 09:08 AM
06-23-2006 09:13 AM
Hey guys,
I'm not sure about the exact reasons either...I'll see if I can get someone to enlighten us.
To answer the previous question: The connector pane is the terminal configuration of a VI that allows you to wire inputs and outputs to it when using the VI as a subVI. Check the LabVIEW Help for "Connector Pane" for more information.
-D
06-23-2006 09:14 AM
06-23-2006 09:37 AM