In the example above, the software defect was obvious, but in many scenarios the defect may be hard to discover and the method of using the VI Server to troubleshoot an application is useful. Nor may it be possible to change the built executable for a more debuggable executable without invalidating configuration requirements.
For example, it may not be possible to install the LabVIEW development environment on the target computer. This ability of the VI server is very useful when traditional debugging cannot be used. The front panel of the VI was also opened. In the steps above the VI Server was used to inspect the state of a VI running in a built executable. The Tool VI can then be used to command the subVI to show itself, and the Done button of the subVI can be clicked. The Execution state of the vi is seen to be “Running”. The “hung” subVI is automatically displayed in the Tool’s list of VIs. This Tool VI must be run with the Port Number that was specified in the executable’s ini settings.
This property is like “All VIs In Memory”, but it works for built executables:
Note that the Application Property “ExportedVIs” is used. In the LabVIEW development environment, we can open and run the Tool VI shown below. However, the subVI cannot complete until the done button is pressed, which cannot happen since the subVI window is not open. LabVIEW creates controls and indicators for the new SubVI, automatically configures the connector pane based on the number of control and indicator terminals you selected, and wires the SubVI to the existing wires. In this state, the application is hung because no code in the top level VI can execute until the execution of the subVI completes. The selected section of the block diagram is replaced with an icon for the SubVI. Now, if we click on the “Call SubVI” button and then click on the close box of the SubVI window, we are ready to demonstrate using VI Server. When the top level VI is built into an executable, three files result:īy default, the VI Server of the built executable is disabled, but we can enable it by editing the ini file so that it contains the following settings: 1Īfter saving the settings and restarting, the executable will begin listening for VI Server connections. The subVI has a defect that will effectively lock up the program if the subVI’s close box is used.
The front panel and block diagram of a simple VI are shown below:
The VI Server allows connections between instances of LabVIEW, with full functionality for LabVIEW development environments, and more limited functionality for LabVIEW built executables. This LabVIEW Tip shows how the VI Server may be used to troubleshoot a built executable.