Effective Use of the "Suspend When Called" Option in LabVIEW

Publish Date: Feb 13, 2007 | 3 Ratings | 4.67 out of 5 |  PDF
LabVIEW offers many different tools for debugging applications. One such tool, which is not commonly used, is the Suspend When Called option for subVIs. This setting can be enabled in multiple ways. You can either right-click an instance of a subVI and select SubVI Node Setup and enable it from this window:

You can also select Operate>>Suspend when called.

Enabling this option suspends a subVI when called and waits for user interaction. The subVI's Front Panel will open and allow the user to run the VI repeatedly to test different input values. For instance, supposed we build a VI, X^Y.vi, to calculate x^y for input values x and y. We use this as a subVI and enable the Suspend when called option as described above. When our application is run, the Front Panel of X^Y.vi shows as follows:

The Run arrow, , is used to run the VI using the displayed inputs. However, you can also change the inputs of the VI, while in this mode, and run it to see the corresponding output. Then, after we have finished testing various inputs, press the Return to Sender button, , to return to the main VI. At this point, the last output values you calculated will be passed back to the main VI. Therefore, if while is Suspend mode, we change the VI's inputs to x = 2 and y = 3, then x^y = 8 and when execution returns to the main VI, it will output 8.

Suspend when called is a very powerful tool for debugging. As you become a more advanced LabVIEW developer, take advantage of this utility when developing your applications.

Back to Top

Bookmark & Share


Rate this document

Answered Your Question?
Yes No