LabVIEW中以编程方式获取VI克隆名称
演示如何以编程方式获取VI的名称或克隆名称。如果VI作为顶级VI运行,则将显示VI的名称。如果VI在主VI中用作子VI,它将返回克隆的名称。
在项目开发过程中,有时需要获取VI的名称。在此示例中,实现了一种方法来获取VI的名称,无论它是否是克隆。为了实现这一点,使用了对VI服务器的调用。
该示例包括一个名为“CloneName Finder”的VI,该VI调用“GetClone Name LabVIEW 2012 NI Verified.vi”。在这种情况下,4 个克隆的名称显示在前面板上。
如果运行“获取克隆名称LabVIEW2012 NI Verified.vi”,VI的名称将显示在其前面板中。
要求
LabVIEW2012(或兼容)
实现或执行代码的步骤
从“Get CloneName LabVIEW 2012 NI Verified.zip”中提取文件
运行 “GetClone Name LabVIEW 2012 NI Verified.vi”。从自身运行,它将返回自己的名称
运行“Clone_Name_Finder.vi”。此VI启动四个克隆并显示每个克隆的名称。每个克隆将显示自己的名称。
VI框图
需要说明的是,上述的例程和文档,都是可以下载的,双击即可打开,其中压缩文件是可以采用粘贴复制的方式,拷贝到硬盘上。这不是图片,各位小伙伴看到后尝试一下,这个问题就不用加微信咨询了。有关LabVIEW编程、LabVIEW开发等相关项目,可联系们。附件中的资料这里无法上传,可去公司网站搜索下载。
LabVIEW程序,如下附件所示。
1. Overview:
This Example shows how to programatically get the Name or Clone Name of a VI. If the VI is run as top level VI, the name of the VI will appear. If the VI is used as subVI in a main VI, it will return the name of the clone.
2. Description:
Sometimes is needed to get the name of a VI. In this example is implemented a way of getting the name of a VI both if it is a clone or not. To implement this, calls to the VI Server are used.
The example includes a VI called "Clone Name Finder" that calls 4 clones of the "Get Clone Name LabVIEW 2012 NI Verified.vi". In this case, the names of the 4 clones are shown in the front panel.
If "Get Clone Name LabVIEW 2012 NI Verified.vi" is run, the name of the VI will be shown in its front panel.
3. Requirements
LabVIEW 2012 (or compatible)
4. Steps to Implement or Execute Code
Extract the files from "Get Clone Name LabVIEW 2012 NI Verified.zip"
Run "Get Clone Name LabVIEW 2012 NI Verified.vi". As is run from itself, it will return its own name
Run "Clone_Name_Finder.vi". This VI launches four clones and shows the names of each of them. Each clone will show its own name.
5. Additional Information or References
VI Block Diagram