10-21-2011 02:59 PM
I have a web method vi (login.vi) to receive data from web browser form.Once the username and password match, client IP will be added to web server's TCP/IP access list.
But the App property doesn't work. Anything I missed?
Thanks.
Solved! Go to Solution.
10-24-2011 08:30 AM
well, I think it did work but not worked as the way I expected.
The application name of the web method vi and web server config file path are
ApplicationWebServer.exe
C:\Program Files\National Instruments\Shared\NI WebServer\niwebserver.conf
What I wanna programmatically change is the web server for the remote front panel, the application name and web server config file path are
LabVIEW.exe
C:\Program Files\National Instruments\LabVIEW 2011\niwebserver.conf
I tried to assign a port number for the vi server from project option dialog box and open an applicaion reference as shown below, but it did not work,
how can I donfig remote front panel web server from a web method vi?
Thanks.
10-24-2011 05:22 PM
Hey Eric,
I'd like to hear more about how your VI works, and what is going wrong, if you could give me some information about what you have done to troubleshoot it so far I think I can help you find out how to fix it.
10-24-2011 06:19 PM
Eric,
Thank you. Let me simply descript my situation.
I built a web service which includes a static document start.html (http://localhost:8080/myservice/start.html) and a web method vi login.vi (/myservice/login)
The start.html contains a form and the data will be posted to login.vi. The browser then will be redirected to a web published remote front panel Main.vi (http://ipaddress:8000/main.html).
Before redirection, I just wanna add client computer's ip address to remote front panel web server's TCPAccess List, and add Main.vi to visible VI list.
I used application property to write these lists, but as my I said in last two posts, it did not write to the remote front panel's web server config.
Hope it can help you understand my question.
Thanks.
10-24-2011 07:30 PM
You'll need to use VI Server to have your application web server connect to the main LabVIEW instance (the one that's running your VI) and remotely execute a VI that updates the web server properties for that instance. The web server runs in a separate application instance; you need to set the properties in the application instance in which your VI will execute.
10-25-2011 08:27 AM
Nathand,
Thank you for reply.
I configed VI Server and named it as MainApp/VI Server, added "*" to machine list and exported vi list. Then open application reference to change application properties as shown below, it didn't work.
Then I moved app properties config to a seperate VI, say, ConfigWebSer.vi, and proceeded as shown below, still did not work.
did I miss anything?
Thanks.
10-25-2011 12:29 PM
I recommend that you take advantage of the error terminals, and read the documentation for the functions you are using. You've wired "MainApp/VI Server" to the "machine name" input of Open Application Reference, and that's almost definitely not a valid machine name. You will probably need to use TCP to connect between instances, even on the same machine, so you'll need to configure VI Server to listen for TCP connections on a specific port in your project, and then connect to that port. Also, connect the error wires between functions, and put an indicator at the end so you can see when errors occur.
10-25-2011 12:55 PM
Thank you Nathand, you are really appreciated. I changed service name to IP address and port on the second procedure shown above, it now working fine.
The only thing is the vi path of Open VI Reference.vi has to be a complete path
I tried this, but it did not work.
10-25-2011 01:08 PM
Eric LZ wrote:
The only thing is the vi path of Open VI Reference.vi has to be a complete path
I tried this, but it did not work.
This only works if the VI ("ConfigWebSer.vi" in your case) is already loaded in memory. I'm guessing that the only time you call ConfigWebSer is through VI Server, so it's loaded when you make the VI Server call and unloaded when it finishes running. If you want to keep it in memory so that you can reference it by name rather than path, put a static reference to that VI inside your Main VI (the one that's running continuously).
10-25-2011 01:31 PM
Nathand, you are expert.
Done. Thank you so much.
Can you help me about another problem?
http://forums.ni.com/t5/LabVIEW/method-not-allowed-http-405-error/td-p/1750564
Thanks.