12-10-2009 11:49 AM
This is a problem on Windows XP running LV 8.6.1. Also running MS IIS, which already occupies port 80. Browser of my choice is Opera 10.10
I am working on a legacy project, that I moved up from 7.1. Part of the features is the publishing of certain LV front panels (as static image) on a web browser.
Since that was new to me and the intended access was not working right away I started with the NI web examples. Which did not work either !!!
But that was while my project was open.
So after some try and error this my resumé:
Starting a VI standalone, setting the port in the tools->options->Webserver to 81 allows me to access that image with
http://localhost:81/.snap?ShowTime2.vi as URL
which is a simple VI that shows the current time in a loop and is not part of any project.
While this VI is still open I open my project as well. Not opening any VI from inside. The same tools->options->Webserver from the menue of the project shows the port also as 81. I still can access the open VI and while it's running, can see snapshots of the time.
When I close it and re-open it, it gets automatically part of the project, at least it's title says so, and that seems to be enough, that no web access is possible any more.
Needless to say, that I cannot show any vi that's really inside of the project.
Also opening a new blank project and start the ShowTime inside there does not help.
Fall back to IE7 does also result in a 404.
For benefit of the knowledgeable I attach two log files.
Thanks for any help .
Gabi
12-14-2009 04:32 AM
I would not call this a solution, maybe an explanation ?
When running from a project environment the web server apparently needs not only the name of the vi but something like
http://localhost/.snap?Projekt.lvproj/My%20Computer/showTime2.vi
In the end I want to embed that URL into a html page that would be built dynamically by an executable. I have found no way how to programatically find out whether I'm running inside a project so I could modify that kind of "path".
Anyway, I think this going to be interesting. I'll keep you updated.
Gabi
12-14-2009 04:40 AM
Hi Gabi,
The thing is, that the adress changes if you run the VI from inside a project. So for a standalone VI it is http://localhost/test.html and for the same VI in a project it has to called in the browser by http://localhost/test_project.lvproj_My%20Computer_test.html . The Adress is a combination of the project name the target and the VI name. My target is "My Computer" and the project has the name "test_project.
Hope this helps.
Regards
TomBaum
12-14-2009 05:07 AM
Hi Gabi,
to check whether you are on the Development System or in an Executable you can use a property node (Application»Kind). This property tells you where you are.
TomBaum
12-14-2009 07:24 AM - edited 12-14-2009 07:32 AM
Thanks, Tom, for your interest in this.
As you see from my posting of this morning, I already found out that the URL has to be amended with whatever the name of the project is (plus assuming I use the English version of the development system) "My Computer".
The property node you mention tells me the _kind_ of the application. Even though I know now it's a "Development System" I still don't know the name of the project. The name of the application is of course "LabVIEW.exe" BTW.
OK, somehow I could fix a kludge, to build a really universally working solution I would need to access the name of the project.....
Gabi
12-14-2009 07:47 AM
Hi Gabi,
You can also use a property node to determine what's the name of the current project the VI is running in. Select Class VI Server»Project and choose Name..
Hope this helps you.
TomBaum