To download NI software, including the products shown below, visit ni.com/downloads.
Overview
Some developers are interested in the number of Controls or Indicators on a Front Panel or the number of Nodes on a Block Diagram. This is a good way of measuring code complexity. This example illustrates the properties that can be used to get these counts.
Description
This VI uses Front Panel property Controls[] and the Block Diagram property Nodes[] to get references to all respective items in an array. The size of this array returns the count of the respective items. In the case of Nodes on the Block Diagram, a Loop or Structure along with any code inside of it will be counted as a single Node. To account for all of the Nodes inside of a Loop or Structure this VI implements an algorithm to find all Nodes on all Diagrams of a Loop or Structure. Notes are included explaining how to account for nested Loops or Structures.
Requirements
Steps to Implement or Execute Code
Additional Information or References
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.