石鑫华视觉论坛

 找回密码
 注册会员
查看: 5927|回复: 6

[转载] LabVIEW EXE文件Web发布

[复制链接]
  • TA的每日心情
    开心
    昨天 21:00
  • 签到天数: 3412 天

    连续签到: 14 天

    [LV.Master]2000FPS

    发表于 2015-4-15 17:13:15 | 显示全部楼层 |阅读模式 来自:广东省东莞市 移动

    注册登陆后可查看附件和大图,以及购买相关内容

    您需要 登录 才可以下载或查看,没有账号?注册会员

    x
    常規的VI web發布很簡單,然而,當需要生成Exe可執行文件后進行Web該如何做呢?

    1.创建一个labview 项目.
    2.
    编写源代码并将其添加到项目中.
    3.
    生成VIWeb
    (1)
    VI的前面板上, 选择工具 Web 发布工具.
    (2)
    按照你希望的方式配置查看模式 (点击帮助按钮以获得各选项的说明).点击下一步.
    (3)
    创建一个文档题目并点击下一步.
    (4)
    保存HTML文档至[LabVIEW]www 目录下. 点击保存至磁盘. 确认你已记下URL地址. 现在需要显示的Web页就已经生成并保存到你的硬盘上了.
    4.
    LabVIEW项目浏览器中, 右键单击我的电脑图片选择添加文件添加HTML文档到项目中. 找到你新生成的HTML文档并将其添加进来.

    5.
    右键点击 程序生成规范 新建 应用程序来生成可执行文件. 选择源文件 部分将顶层VI添加至启动VI 并添加您的HTML文件至动态VI及支持文件. 点击生成按键生成您的可执行文件.

    6.
    复制可执行文件及生成的其他所有文件到目标机器上(请确认在目标机器上已安装LabVIEW运行时引擎).
    7.
    在你的目标机器上找到应用程序存储的目录. 打开.ini 文件.
    (1)添加WebServer.Enabled=True这个键值 到其他WebServer键值之后.
    (2)
    web server root path从原来的[LabVIEW]www改为现在您的HTML网页所在的目录(它应该在您的应用程序所在的data目录下).
    (3)保存对.ini 文件所做的修改并关闭文件.


    8.
    运行您的应用程序. 注意: 如果你在代码的开发机器上运行应用程序,请确认LabVIEW已经关闭.
    9.打开其他机器的网页浏览器,输入你在步骤3d中获得的网址. 如果在网页中得到错误This page cannot bedisplayed, 请尝试将网址从http://TargetComputerName/VIname.html改为http://TargetComputerIPaddress/VIname.html. 另外若使用Windows XP请检查您的防火墙设置.
    10.您现在应该可以访问到您的程序.
    对于一个安装程序中使用远程前面板,思想是相同的. 创建一个Web. 在项目中包含这个Web. 生成应用程序并将Web页包含到支持文件中. 创建一个安装程序并在安装程序的源代码设置中将安装程序包含进来. 生成并发布安装程序.最后, 修改.ini文件.

    注意:  默认情况下, 在这个应用程序中对于远程前面板有一个应用许可.  如果你有LabVIEW 专业版, 你会有5个许可.  为了使用这些许可 (或者其他更多您购买的许可), 你需要在安装文件中包含你的应用程序和在附加安装程序中包含 LabVIEW 8.x发布许可.   如果不添加这些附加许可信息, 您发布的应用程序只可以由一台机器进行远程连接.

    注意:  如果容量许可管理器在同一台机器上使用,则一个LabVIEW Web服务器不能允许一个以上的许可(因为它们在使用相同的技术).

    英文更詳細
    How Can I Use Remote Front Panels With LabVIEW Executables?


    Hardware: PXI/CompactPCI>>Controllers

    • Troubleshooting:Create a LabVIEW project
    • Add your source code to the project
    • Build the web page for your VI:
      • Select Tools圀攀戀 Publishing Tool...
      • Select the VI to publish from the VI name drop down menu.
      • Configure the Viewing Mode as either Embedded, Snapshot, or Monitor (click the Helpbutton for an explanation of each option) and click Next
      • Edit the Document title, Header, and Footer and click Next
      • Ensure that the HTML document is saved in your LabVIEWwww directory and clickSave to Disk.
      • Note the Document URL for use in step 9 and
    • Add the HTML document from step 3 to Project Explorer by right-clicking My Computer and selecting AddFileand then select the HTML file from your LabVIEWwww directory.
      project_explorer.png
    • Save your project and build your executable by right-clicking Build Specifications andselecting NewApplication (EXE). Select the Source Files category. Then, place your top level VI under Startup VIs and your HTML file under Always Included. Click Build and then clickDone when the build is complete.
      application_props.png
    • Copy the executable and all of the generated files to your target computerNote: The target computer must have the LabVIEW Run-Time Engine installed and it must match the version of LabVIEW used to develop the executable.
    • On the target computer, browse to the directory where you just copied your executable. Open the .ini file in a text editor and perform the following:
      • Verify the token WebServer.Enabled=True exists. If you cannot find it, add it to the end of the file

        application_ini.png

      LabVIEW 8.x prior to LabVIEW 8.6:

      • Add or modify the WebServer.RootPath so that its value is set to the directory where the HTML page currently resides (it should be located in the application's datadirectory)

        application_ini_root_path.png
      • Save the changes to the .ini file and close it

      LabVIEW 8.6 and later:

      • Close the .ini file and open niwebserver.conf in a text editor. This file was created to handle the new functionality provided by the LabVIEW web server in LabVIEW 8.6
      • In the second section labeled Directives that apply to the default server there is aDocumentRoot tag. Replace the default LabVIEWwww with the location of your HTML file. Do not include the name of the HTML file in the path

        niwebserverconf.png
    • Launch your executable
      Note: Running the executable on the development machine requires that LabVIEW be completely shutdown
    • Open a web browser on another computer and navigate to the URL you obtained in step 3. If you are not running the executable on your development machine, replace the name of the development computer in the URL with the name of the target computer. You can now view and control the LabVIEW executable remotely
    Q. What steps can I take to resolve the This page cannot be displayed error?
    A. Try changing the URL from http://TargetComputerName/VIname.html tohttp://TargetComputerIPAddress/VIname.html.Also, verify that your firewall allows access to the port that the LabVIEW web server is using (default is 80).

    Q. Why do I receive an error statingRemote Panel Connection Refused by Specified Server?
    A. Typically, this message results from a mismatch in LabVIEW versions. Ensure that the version of the LabVIEW Run-Time Engine on the target computer matches the version of LabVIEW used on the development machine.

    Installers:
    To enable remote front panels for an installer, the same ideas apply. Create a web page. Include the web page in your project. Build your executable and include your web page in the support files. Create an installer and include your executable in the installer under the source files setting of the installer. Build and deploy the installer. Lastly, change the .ini and niwebserver.conf files.

    Licensing:
    By default, LabVIEW includes one remote front panel license. This means that one connection at a time can be made to the remote front panel of your executable. If you have LabVIEW Professional Edition you are entitled to five licenses for remote panels. In order to have access to these additional licenses (or any others that you may have purchased), you need to build an installer that contains your executable along with the LabVIEW 8.x Deployable License under Additional Installers.

    Note: A LabVIEW web server cannot permit more than one connection if Volume License Manager is in use on the same computer. This is due to the fact that remote front panel licenses share components with the Volume License Manager.

    回复

    使用道具 举报

  • TA的每日心情
    慵懒
    2015-5-10 13:45
  • 签到天数: 13 天

    连续签到: 1 天

    [LV.3]300FPS

    发表于 2015-4-24 13:04:34 | 显示全部楼层 来自:安徽省合肥市巢湖市 电信
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    慵懒
    2015-5-10 13:45
  • 签到天数: 13 天

    连续签到: 1 天

    [LV.3]300FPS

    发表于 2015-4-24 13:04:54 | 显示全部楼层 来自:安徽省合肥市巢湖市 电信
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2024-8-9 12:52
  • 签到天数: 307 天

    连续签到: 1 天

    [LV.8]800PFS

    发表于 2015-6-2 20:30:09 | 显示全部楼层 来自:甘肃省天水市 电信
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2022-5-20 20:25
  • 签到天数: 957 天

    连续签到: 1 天

    [LV.10]1000FPS

    发表于 2017-11-19 03:35:12 | 显示全部楼层 来自:河北省唐山市 电信
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    难过
    2023-7-29 15:36
  • 签到天数: 6 天

    连续签到: 1 天

    [LV.2]200FPS

    发表于 2023-7-1 10:40:00 | 显示全部楼层 来自:江苏省 电信(全省通用)
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    擦汗
    2 小时前
  • 签到天数: 202 天

    连续签到: 180 天

    [LV.7]700FPS

    发表于 2023-10-7 22:55:03 | 显示全部楼层 来自:四川省乐山市 电信
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册会员

    本版积分规则

    LabVIEW HALCON图像处理入门教程(24.09)
    石鑫华机器视觉与LabVIEW Vision图像处理PDF+视频教程11种全套
    《LabVIEW Vision函数实例详解2020-2024》教程-NI Vision所有函数使用方法介绍,基于NI VISION2020,兼容VDM21/22/23/24

    QQ|石鑫华视觉论坛 |网站地图

    GMT+8, 2024-12-23 02:21

    Powered by Discuz! X3.4

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表