Solution
Web Services on Windows Host PCs
Standalone Web Services that are running on a Host PC are intended to be published directly from LabVIEW, as described in
Publishing a Web Service (Real-Time, Windows) . If the Web Service is installed using a Package build, the LabVIEW Run-Time Engine may not start up quickly enough after the pc reboots. This can prevent Startup VIs from running.
To avoid this issue, it is recommended to distribute the Web Service with a standalone application. The LabVIEW Application will use a unique Web Server to host the Web Service. Refer to
Publishing a Web Service through a Stand-Alone Application (Real-Time, Windows) for further information. If you want to launch the executable when Windows boots you can follow the steps in the following article:
Running a LabVIEW Executable When Windows Boots.
When using LabVIEW 2020 or 2021 a standalone Application does not correctly execute Startup VIs when using the
NI Web Server unless a
niembeddedws.config file is included in the Application build files. This file can only be generated when the Application is built to use the
Application Web Server. This bug was reported with ID 1754642 and fixed in LabVIEW 2022 Q3, it is listed in the
LabVIEW 2022 Q3 Bug Fixes. Please note that the fix works when using an executable to publish the web service but does not work correctly when using a package and rebooting the pc.
If you are using LabVIEW 2020 or 2021 and publishing the web services using a stand-alone application (EXE) you can follow these steps to work around this bug:
- From the LabVIEW Project tree, right-click Build Specifications >> New >> Application (EXE).
- In the Information tab of the Application Properties Window, specify a name and destination for the Application.
- In the Source Files tab, ensure that the executable VI is listed as a Startup VI and any Web Service VIs are listed under Always Included.
- In the Web Services tab, place a checkmark in the Web Service to include. Then, select Application Web Server.
- Click Build.
- When the build is complete, navigate to the Application directory and verify that a niembeddedws.conf file exists amongst the other Application build files.
- In the LabVIEW Project, right-click the newly built Application and select Properties.
- From the Web Services tab, select NI Web Server.
- Click Build.
- When the build is complete, launch the standalone application to start the Web Service.
- The Startup VIs will execute when the landing page URL is accessed.
Web Services on Real-Time Targets
For Web Services published on real-time targets, refer to the troubleshooting suggestions below.
- Reformat the target and try deploying the Web Service again.
- If the Web Service was previously working, try changing the name of the Web Service and redeploy it.
- Only one instance of a Web Service with a particular name can be hosted at a time. Hosting multiple Web Services requires that they have different names.
- Enable error logging for the Web Service and look for specific errors.