LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW 2009 - Executable w/ Remote Panels

Just hit a wall.

 

I'm want to make an installer that sets up the remote panel webserver and document for me.  My goal is to not have to tweak or move setting files, or my html files around to get this to work.  I can get it to work, but only with a little bit of tweaking.

 

Here is the krux of the problem (and I will get to the details of my setup after that):

 

I can't place my document.html that contains my web page with the remote panel in the appropriate folder automatically using the "Source Files" tree in my installer.  See the attached image.

 

Within the niwebserver.conf file that my application creates (because my custom .ini file has WebServer.Enabled=True) there is a variable $LVSERVER_ROOT.

 

This variable points to:

$LVSERVER_ROOT = "C:\Program Files\National Instruments\Shared\LabVIEW Run-Time\2009\webserver"

 

The default documentroot (where the .html files go) is:

DocumentRoot "$LVSERVER_ROOT/../../www"

 

Which resolves to:

"C:\Program Files\National Instruments\Shared\LabVIEW Run-Time\www"

 

Seems somewhat trivial. 

1. Make a custom .ini file for my compiled program that has the WebServer.Enabled=True, add it to my project and set it as the .ini file for my build specifications.

2. Make a .html file using the Web Publishing Tool, and add it to my project.

3. Have my .html file placed in "C:\Program Files\National Instruments\Shared\LabVIEW Run-Time\www"

 

The closest alias for this is [LV90RTEDIR] which resolves to C:\Program Files\National Instruments\Shared\LabVIEW Run-Time\LabVIEW 2009\.  But I can't seem to figure out a way to select the directory above.  I suppose I could make the file path in the [ProgramFilesFolder], but what if the user decided to place the run-time in some other folder (can they even do that?).

 

How should I resolve this?  Should I just hard-code the path from the [ProgramFilesFolder] directive onward?

 

Thanks!

-nic

0 Kudos
Message 1 of 3
(3,858 Views)

Hey Nic,

 

I think hard-coding the path into [ProgramFilesFolder] will be your easiest solution. From a quick glance, I don't think any of the other "destinations" will be helpful in this case. Most of them resolve to some path dictated by the Windows environment variables.  

 

Make sure you are aware of this devzone article: LabVIEW Web Services FAQ, especially sections 13 and 15. You will have to jump through a couple more hoops if you are distributing this to a target machine without a LV development system. 


 

 

Misha
0 Kudos
Message 2 of 3
(3,825 Views)

Hi mishkin,

 

I will have a read through your linked article.  However, I was able to get the installer to setup everything for my target computer w/o me messing with config files as desired.  The steps I followed were:

 

1. Code a desired VI and place it in a Project

 

2. Create a custom .ini file with the line "WebServer.Enabled=True".  Add the .ini file to your project.

 

3. Create a Build of the VI, with the custom LabVIEW .ini

 

4. Use the web publishing tool to generate a .html file for the VI.  The .html file will be placed in the root of your LabVIEW web server folder (see options dialog).  For me this was C:\Program Files\National Instruments\LabVIEW 2009\www.  If you study the .html file, you will see that it would not be difficult to make your own .html file.

 

5. Add the .html file to your project.  (As a pre-step, I like to copy the .html file out of my web server root and into my project directory).

 

6. Build your application

 

7. Create an Installer.  Add the application build of your VI to your desired directory.  Place the .html file in [ProgramFilesFolder]\National Instruments\Shared\LabVIEW Run-Time\www

 

8. Build your installer

 

9. Install on target machine

 

So long as your target machine doesn't have another web server running on port 80 (which would require the need of an additional config file to be included to put the web server on another port), and the target machine's local group policies and firewall allow it, a user should be able to open their browser and point it to http://<targetmachine>/<targetvi>.html and be connected to that front panel.

 

NI has come a long way in making this feature very accessable.  My only complaint is the lack of documentation.  Although v8.5 and 8.6 were well documented, the steps in v2009 have changed and I had to figure them out through trial and error.

 

Now I need to add to my code that will allow my user to turn on and off the web server.

 

 

0 Kudos
Message 3 of 3
(3,791 Views)