Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Running G Web Server In A Stand Alone Application Returns Error 1025

Primary Software: LabVIEW Toolkits>>Internet Developers Toolkit
Primary Software Version: 6.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I made a VI that calls and runs the G Web Server of the LabVIEW Internet Toolkit 6.0.1. 
It works perfectly in the LabVIEW 8.5 environment. I have created an executable from my VI and I get Error 1025 when I run it.

Solution:
The Get GWS Application Instance.vi and the HTTP Server are loaded dynamically when launching the HTTP Server Control.vi.

If the HTTP Server Control.vi is used in a stand alone application Error 1025 at Open Reference.vi will occurr because Get GWS Application Instance.vi and HTTP Server are not found.
This behaviour is expected because in the block diagram of the HTTP Server Control.vi there's the Current VI's Path function. When running the HTTP Server Control.vi  from the LabVIEW environment this function returns the path labview\vi.lib\addons\internet\http\http0.llb.
When creating an executable the Current VI's Path returns a different path as stated in the KnowledgeBase 18RDJ60O, and this is why it occurs Error 1025 at Open Reference.vi. 

To prevent this error the http0.llb needs to be added in the same folder as the EXE file and
the HTTP Server Control.vi needs to be modified.

Attached below there is the HTTP Server Control (Stand Alone).vi, which is the modified version of the HTTP Server Control.vi shipped with the Internet Toolkit.

In order to have the executable running correctly follow these steps:

  • Add the HTTP Server Control (Stand Alone).vi  to the project. This is can be done by right clicking on My Computer»Add»File in the Project Explorer page.
  • Add the labview\vi.lib\addons\internet\http folder to the project. This can be done by right clicking on My Computer»Add»Folder (snapshot) in the Project Explorer page: 
  • Add the labview\internet\http\conf folder to your project.
  • Repeat the previous step also for icons folder, logs folder and htdocs folder. These folders are located in the labview\internet\http directory.
  • Create the executable by right clicking on Building Specifications and selecting New»Executable.
  • Set the main VI as the Startup VI in the Source Files tab.
  • Set the folders added to the project as Always Included.
  • Click Build and the executable will be compiled and created.

The G Web Server is now ready to run in the stand alone application.

Related Links:
KnowledgeBase 18RDJ60O: Why Does My Executable Not Work When Using the Current VI's Path Constant?

Attachments:

HTTP Server Control (Stand Alone).vi




Report Date: 06/16/2008
Last Updated: 07/07/2008
Document ID: 4MF64U53

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit