From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Web UI Builder and Data Dashboard

cancel
Showing results for 
Search instead for 
Did you mean: 

Parameters to WebUI

I need a way to pass a parameter to the WebUI.  Basically I need a way of allowing the user to edit some local file (could be txt or the html file itself or whatever) in that directory or something that will inform the program the IP Address of the server it needs to connect to.  Yes we could rebuild the entire application every time we wanted a change and yes we could prompt the user for an ip address at the start but both of these are far more cumbersome than I would like.  I know you can pass parameters to a .xap, but with the custom build that WebUI does I am not sure what the best way of getting "constant" data to the webserver that can be recieved after build but prior to a prompt that runs every time.

 

Jason

0 Kudos
Message 1 of 2
(5,471 Views)

What you need is the Application URL node from the HTTP palette. This gives your code access to the full url of the page containing your deployed applicaiton. Your users can then use the ? syntax to provide additional information in the url. For example if you application is deployed at http://yourserver/webapp.html, they could add an IP address as http://yourserver/webapp.html?130.164.1.1. If you have multiple pieces of information, a syntax like the following is typically used: http://yourserver/webapp.html?ip=130.164.1.1&port=8080.

 

This node will return empty strings when run in the development environment, so you probably want to put a check in your code that will return a default string if the output is empty. This allows you to still run the code in the editor while still exercising your URL parsing code.

0 Kudos
Message 2 of 2
(5,463 Views)