From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
12-18-2009 03:51 PM
Is there a way to programmatically perform a node count on a VI? I've looked around and can't seem to find anything on it. Would VI scripting do this for me?
Thanks,
Dan
Solved! Go to Solution.
12-18-2009 04:59 PM
Assuming we mean the same thing by Node count, scripting could do this for you. You can return a list of nodes on the BD using the Nodes[] property and take the length to get the number. This is fraught with peril, since as far as scripting is concerned, every structure (while loop, for loop, etc.) counts as a separate diagram and you would need some recursive procedure to count everything. Fortunately, a kind soul at NI has done the work for you, and there is a VI to do this job. In vi.lib/Utility/traverseref.llb there is a VI called TRef Traverse For References.vi, and by typing "Node" as the class name you will get all of the Nodes. What you would do with this, I don't know.
12-19-2009 06:43 AM
If you want to get some metrics from that, there is also some VI in the OpenG collection (I think it was in the Application Control Section) that encapsulated everything the developers could get at this time (the time of secretive scripting in LV 7.1). Maybe this is updated in 8.6. or 2009 where we can access it again.
Felix
02-27-2014 05:00 PM
For posterity, to match the node count generated by the Profile tool you have to traverse classes from the block diagram:
Node
ControlTerminal
Constant
02-27-2014 08:25 PM
One more alternative...you can use the "Node Count" test in the VI Analyzer Toolkit to return a report of the node count of all your VIs...just change the "Maximum Allowable Number of Nodes" to zero so that every VI tested will return a result:
One benefit of using the VI Analyzer Toolkit is the built-in reporting mechanisms, making it easy to generate a text or HTML file report with all the node count values.
02-13-2015 11:21 PM
These two options will give very different node counts. That is because the "Traverse for GObjects" with "Node" as theinput for "Class Name" will only give GObjects that are a "Node" in the Gobjects Class Heirarchy. The Node Count Test in VI Analyzer will give the GObjects that are a "Node", "Constant", or "ControlTerminal" in the Gobjects Class Heirarchy.
Chief LabVIEW Architect, Testeract | Owner, Q Software Innovations, LLC (QSI)
Director, GCentral | Admin, LabVIEW Wiki | Creator, The QControl Toolkit
Certified LabVIEW Architect | LabVIEW Champion | NI Alliance Partner
09-02-2015 05:15 PM
Also, the VI Metrics will count clusters as a single node, but the sctripting VIs enumerate each element, so the numbers can be offset roughly by the number of elements in the cluster (depending on heirarchy).