Dieser Inhalt liegt nicht in Ihrer bevorzugten Sprache vor.

Der Inhalt wird Ihnen in einer anderen verfügbaren Sprache angezeigt. Ihr Browser bietet ggf. Funktionen, die Sie bei der Übersetzung des Textes unterstützen.

Programmatically Start and Stop the LabVIEW Web Server

Updated Nov 9, 2020

Environment

Software

  • LabVIEW

I have an application that I want to publish on the web, but I would like the ability to programmatically start and stop the LabVIEW Web Server rather than having to manually start it from Tools » Web Publishing Tool or from Web Server:Configuration Options.

You can use VI Server to programmatically enable and disable the LabVIEW Web Server using the Web Server.Server Active property:

To create this piece of code, follow these steps:
  1. Open an Application Reference (Functions Palette » Application Control » Open Application Reference) to the local version of LabVIEW. By leaving the machine name input of the Open Application Reference VI blank, LabVIEW defaults to the local machine.
  2. Wire a Property Node to the LabVIEW Application Reference output, and select the property Web Server.Server Active.
  3. Right-click on the property and select Change to Write. This property accepts a boolean input and determines whether the Web Server is turned on or off.
  4. Connect e.g. a boolean constant to that boolean input to switch the server on or off.
  5. Close the Application Reference using a Close Reference node.

Additional Information

As explained in the context help, this property can only be accessed from the local copy of LabVIEW. Any attempt to access this property from a remote application will result in a permission error. In addition, any active connections to the web server that are open when this VI is called will not be automatically closed.

All Web Services served by the Web Server will be in active while Web Server is inactive.