NI Home > Community > NI Discussion Forums

LabVIEW Web UI Builder and Data Dashboard

Reply
Member
jdaming
Posts: 9
0 Kudos

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

Innoventor Inc. "The Original Idea People" http://www.innoventor.com/
Member
GregR
Posts: 134
0 Kudos

Re: Parameters to WebUI

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.