LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Default placement of Controls/Indicators when using Class auto create data member function

LabVIEW experts,

 

A question regarding style and performance...

 

I was always under the impression it is more efficient to place terminals on subVIs on the outer most level, i.e. outside any loops. This also has the benefit (for indicators) that you can wire a default value out if an error propogated into the main error-catching If.

 

Now, I have just started experimenting with Classes (so far I quite like them), but when I auto create a Data Member VI it puts the terminals inside the If statement. So, is there a perfomance benefit, and also what happens if there is an error into the VI, then the indicators will contain, when the subVI exits, the value from the previous iteration.

 

What gives???

 

Neil

0 Kudos
Message 1 of 4
(2,775 Views)

Your impression is generally correct and I don't see this issue with 8.6. All terminals are created on the root diagram.

 


nrp wrote:

what happens if there is an error into the VI, then the indicators will contain, when the subVI exits, the value from the previous iteration.


If memory serves, they contain their default values, not values from previous iterations. The way to be certain is not to have them in structure.


___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(2,759 Views)

Sorry, my mistake the indicators do contain their default values.

 

However, I am using LV8.6 also. The behaviour occurs if the class has an array, and you create a Data Member Access VI to an element of the array, it places the index terminal inside the If. Not a big deal I know, just not what I would expect.

0 Kudos
Message 3 of 4
(2,751 Views)

In this case it really isn't an issue because the gain you get is in reusing the buffer, which doesn't make much difference in a couple of I32s.

You can report it and NI will decide if it's worth changing.


___________________
Try to take over the world!
0 Kudos
Message 4 of 4
(2,741 Views)