Error 404 Cannot Open Web VI Hosted in a CompactRIO Device

Updated Sep 15, 2023

Reported In

Hardware

  • CompactRIO Controller

Software

  • LabVIEW
  • G Web Development Software

Issue Details

I have created a web VI using G Web Development Software and I am using a CompactRIO device to host it along with a LabVIEW web service using a Real-Time application. However, after deploying the stand-alone application to the controller, when browsing to the web VI I get the following error:

Access Error: 404 -- Not Found
Cannot open document for: <html file>

 
image.png
This happens with any browser, including Mozilla Firefox, Google Chrome and Microsoft Edge.
 

Solution

The error message indicates that the client, the web browser in this case, cannot find the published web page. There are numerous potential root causes, including an error in the URL being used or a conflict with the port assigned to the web service. You can check the following to try to fix the connection issue.
  • Confirm the correct URL is being used.
1. The web VI's public URL can be confirmed in the LabVIEW project. You can right-click the appropriate HTML file within the Public Content folder of the Web Service in the LabVIEW project and select the Show Public URL... option:
 
public URL.png
 
Take note of the IP address and path to the HTML file. Omit the port shown here, instead confirm the port as explained in the next step.
 
2. Right-click the Real-Time Application build specification in the LabVIEW project, select Properties and confirm the port being used in the Web Services page:
 
web service port.png
 
Make sure the public URL shown in the LabVIEW project, including the port configured in the Web Services page of the build specification, is the one being used to try to access the web VI.
 
  • If the correct URL and port are being used in the browser, the issue might come from the Application Web Server in the cRIO using the same port as the one configured in the stand-alone application. You can change the port being used in the stand-alone application or the one configured for the Application Web Server. Two ways you can confirm which port is being used by the latter and change it if necessary are:
  • Using the Web Configuration in NI MAX. Right-click the cRIO controller in NI MAX and select Web Configuration:
 
web configuration MAX.png
The page opened by the Web Configuration option needs to be opened in Internet Explorer. In this configuration page you can change the port assigned to the Application Web Server:
 
web configuration crio
 
crio terminal.PNG

Additional Information

The Application Web Server component installed in a cRIO is different from the web server published via a stand-alone application, that is why they must have different ports assigned. Using the same port for both will result in connectivity issues when trying to access one service or the other. Due to the same reason, if the Application Web Server is not part of the cRIO installed software, the web server published via the stand-alone application can still be accessed and used.