02-29-2012 01:20 PM
Only one chance every four years (roughly) to post a Leap Day nugget, so here goes.
I have really been enjoying Class Property Nodes in my current project. I find the familiarity of the Property Node semantic to be helpful in making my class-based diagrams more readable:
This diagram looks much cleaner (in my opinion) than four class data accessor VIs (two write and two read) wired in a row.
Anyway, earlier today I wanted to find all the places in my code where I wrote to a particular class property. It turns out that a simple Find on the write accessor VI for that property was all I needed to do:
Note that I did this from the right-click menu of the icon on the accessor VI's front panel...this trick doesn't appear to work when doing a Find from the Project window. Anyway, once you do this, the Search Results dialog will display all instances of that subVI *and* any property nodes that are using that VI to write the value of that class data.
06-14-2012 03:23 PM
Sorry for resurrecting old post, but this seems to be the best place to ask.
Does using property nodes in this fashion result in a performance hit compared to using normal LV OOP accessor methods? It's the burning question of the day here for the team.
Thanks!
06-14-2012 03:57 PM
@Ben Phillips wrote:
Does using property nodes in this fashion result in a performance hit compared to using normal LV OOP accessor methods?
In the compiled code, class property nodes do an extra case structure check on the incoming error to avoid executing the property read/write VI. So if your property read/write VI has an error case structure in it, that's essentially a double-check of the error condition. This ends up being an extremely small hit, but it is there. Interestingly though, the Property Node will be a bit *faster* in the case where there is an incoming error, since the property read/write VI won't even execute...whereas a direct subVI call will always execute (although its diagram may be cased out) regardless of the error condition.
Other than the error checking, the compiled code between these two scenarios should be identical.
06-14-2012 05:48 PM
Related question:
Will property nodes for classes execute in the UI thread, or in the thread defined in the accessor VI properties?
Cheers,
Christina
06-14-2012 06:46 PM
They execute like a VI, so they'll execute in in the thread defined for that VI.