Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Identifying Common Operations

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

As you design programs, you might find that certain operations are performed frequently. Depending on the situation, using subVIs or loops to repeat an action can simplify a VI.

For example, consider the following block diagram, where three similar operations run independently.

An alternative to this design is a loop that performs the operation three times, as shown in the following block diagram. You can build an array of the different arguments and use auto-indexing to set the correct value for each iteration of the For Loop.

If the array elements are constant, you can use an array constant instead of building the array on the block diagram.

Some users mistakenly avoid using subVIs because they are afraid of the overhead it can add to the execution time. It is true that you probably do not want to create a subVI from a simple mathematical operation such as the Add function, especially if it must be repeated thousands of times. However, the overhead for a subVI is fairly small and usually minimized by any I/O you perform or by any memory management that occurs from complex manipulation of arrays.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit