Note The VI Analyzer tests are available only if you install and activate the LabVIEW VI Analyzer Toolkit. Refer to the NI website for more information about the VI Analyzer Toolkit.
Tests in the Block Diagram category of VI Analyzer tests analyze VI performance and style related to the block diagram. The VI Analyzer groups the Block Diagram tests into three subcategories: Performance, Style, and Warnings.
Performance
The tests in the following list analyze coding conventions that affect VI performance.
Arrays and Strings in Loops—Checks loops to see if they contain Build Array or Concatenate Strings functions. Avoid using these functions in loops because each call to them requires a dynamic resizing of the array or string, which can affect memory and processor time. (Real-Time, Windows) This test does not check Timed Loops.
Coercion Dots—Checks the total number of coercion dots on the block diagram and the number of coercion dots on individual wires and compares them to user-specified limits.
Enabled Debugging—Checks whether debugging is enabled or disabled. Disabling debugging improves VI performance.
In Place Element Structure Usage—Detects the use of function pairs that can be replaced with the In Place Element Structure. Use the In Place Element Structure to avoid making unnecessary memory copies.
Inlinable VIs—Detects VIs that are able to inline but that are not currently inlined. Some VIs might show improved performance when inlined into their calling VIs.
Parallel For Loop Debugging—Detects the use of parallel For Loops with debugging enabled, which forces sequential iteration execution. Debugging is not recommended in production code where parallel execution is required.
Parallelizable Loops—Detects For Loops that can run in parallel safely. This test also detects For Loops that run in parallel but that contain non-reentrant subVIs, which prohibit parallel execution.
Prepend Scalar With Build Array—Checks whether the VI uses the Build Array function to prepend an array with a scalar.
Redundant Boolean Operations—Checks for And, Or, Not, Not And, and Not Or functions with constants wired to one or more of their inputs. In this situation, a Boolean function is not necessary, and you can remove it.
Value Property Usage—Checks for a Value property, which updates the values of front panel controls and indicators. In most cases, a local variable updates front panel object values much faster than the Value property.
Wait in While Loop—Checks While Loops with front panel control terminals for structures or functions other than I/O functions that regulate the speed of the While Loop.
Wired Terminals in Subdiagrams—Checks to see if any control or indicator that is wired on the connector pane does not reside within the top-level diagram. In order to avoid unnecessary memory copies, place control and indicator terminals that are wired on the connector pane should be placed on the top-level diagram.
The tests in the following list analyze block diagrams for issues related to LabVIEW style.
Array Constant Style—Checks that array constants indicate the size of the array or have a scrollbar that indicates elements are not all visible.
Backwards Wires—Checks whether wires flow from left to right.
Case Structure Default Frame—Detects uses of the default case wired to enums for Case structures or uses of the default case that are unnecessary and decrease readability of the code.
Code Simplification—Detects the use of block diagram constructs that can be replaced with simpler code.
Control Terminal Label Visible—Checks if labels of block diagram control terminals are visible. To easily identify control terminals on the block diagram, always make labels visible.
Control Terminal Wiring—Checks whether wires exit control terminals from the right side and enter indicator terminals on the left side.
Diagram Disable Structures—Flags Diagram Disable structures. Although Diagram Disable structures may be useful for development and debugging, these structures are not recommended in production code.
Mixed Terminal Styles—Detects whether block diagram terminals are displayed consistently. All terminals should be displayed as either icons or data types.
Poor Names of Enum Items—Returns failures for item names in an enumeration list that include white space characters. A single space character between words is allowed. This test only analyzes Control VIs that contain a single enum on the front panel.
Sequence Structure Usage—Checks whether the block diagram includes Stacked Sequence structures that contain more than the user-specified maximum number of frames. The test does not check Flat Sequence structures.
String Constant Style—Checks the style of string constants on the block diagram. String constants containing no characters fail the test. Replace them with an empty string constant. String constants set to Normal Display that contain only white space—such as spaces, tabs, or line feeds—fail the test. Set the constants to '\' Codes Display to improve block diagram readability.
Tunnel Position—Checks whether all input tunnels are on the left side of a structure and all output tunnels are on the right side. This test ignores Flat Sequence structures.
Unused Code—Checks for unnecessary code on the block diagram.
Wire Bends—Compares the total number of bends on a wire to a user-specified maximum and compares the length of each wire segment to a user-specified minimum.
Wire Crossings—Checks whether the number of wire crossings is within the user-specified limit.
Wires Under Objects—Checks for wires that run under objects or other wires.
The tests in the following list analyze block diagrams for potential design problems.
Adding Array Size Elements—Checks whether the Add Array Elements function connects to the output of the Array Size function to determine the size of a multidimensional array. Wire the Multiply Array Elements function to the size(s) output of the Array Size function to determine whether a multidimensional array is empty.
Array Sum and Product Overflow—Checks the Add Array Elements and Multiply Array Elements functions to see if the numeric array input is a signed or unsigned 8-bit or 16-bit integer data type. Since the sum and product output of these functions matches the input data type, the add or multiply operation may result in an overflow. Consider changing the input data type to these functions to a signed or unsigned 32-bit or 64-bit integer to reduce the possibility of an overflow.
Breakpoint Detection—Checks for breakpoints on the block diagram, including breakpoints on wires, nodes, and subdiagrams.
Bundling Duplicate Names—Checks element names in the Bundle By Name and Unbundle By Name functions for duplicates. Duplicate elements can cause confusing and sometimes incorrect block diagram behavior.
Case Structure with String Range—Detects Case structures with strings wired to the case selector with one or more ranges in selector labels. Use of ranges is not recommended with Case structures based on strings.
Error Cluster Wired—Checks that the error output on a block diagram node is wired. You can set the test to ignore VIs with automatic error handling disabled. You also can ignore nodes that usually have unwired error outputs.
For Loop Error Handling—Returns a failure for a For Loop that does not implement proper error handling to account for zero iterations.
For Loop Iteration Count—Checks For Loops to ensure that the VI does not use both auto-indexing arrays and the N terminal to govern the number of iterations the For Loop runs. You also can check for multiple auto-indexing arrays governing the iteration count.
Globals and Locals—Checks whether a block diagram contains global and local variables.
Hidden Objects in Structures—Checks whether any objects in structures are hidden outside the visible bounds of the structure.
Hidden Tunnels—Checks tunnels, shift registers, and other structure border elements to see if they overlap each other. Overlapping tunnels can make your block diagram difficult to read. (Real-Time, Windows) The test currently does not check dynamic event tunnels, tunnels on Timed Loops with frames, or tunnels on Timed Sequence structures.
Indexer Datatype—Checks functions that index array elements and string characters to ensure that signed or unsigned 8-bit or 16-bit integer data types do not index string or array elements. The test ignores functions that use constants for indexing.
Reentrant VI Issues—Checks for uninitialized shift registers and non-reentrant subVIs in a reentrant VI. Because reentrant VIs maintain multiple data spaces, unexpected results can occur when using uninitialized shift registers. Additionally, parallelism could be inhibited if the reentrant VI calls non-reentrant subVIs.
Type Casting References—Detects when the VI contains a Type Cast function to cast one reference type into another reference type. This situation might lead to instabilities or crashes with some reference data types.
Unwired I32 Error—Detects subVI calls that have unwired error outputs, where the error terminal is an I32 instead of an error cluster. To implement effective error handling, wire the error output to a VI, such as the Error Cluster From Error Code VI, and handle the resulting error cluster.