zl程序教程

您现在的位置是:首页 >  后端

当前栏目

LabVIEW如何以编程方式获取克隆VI名称?

编程 如何 获取 方式 名称 vi labview 克隆
2023-09-14 09:09:42 时间

LabVIEW如何以编程方式获取克隆VI名称?如何使用克隆VI名称关闭特定的克隆VI?

调用正在运行的VI服务器引用。

放置一个调用节点,然后选择“打开”前面板>>。

使用属性节点检查VI是否为克隆VI>>。

使用属性节点>>克隆名称获取克隆VI名称。

关闭对VI服务器的引用。通过关闭对VI服务器的引用,将能够关闭特定的克隆VI。

以编程方式读取Clone名称

获取克隆VI名称,还可以在关闭引用之前检查VI名称,以确保关闭正确的克隆VI。

根据名称关闭克隆VI

从LV 2013开始,FP Open属性已被“弃用”。这意味着可以使用此属性使用现有代码,但新属性节点不提供此功能。

请使用调用节点,方法为“前面板>>打开”(分别为“前面板>>关闭”)。

附加信息

不可重入的VI意味着在任何给定时间只有一个VI副本在运行。如果尝试同时从多个位置调用非重入VI,则每个子VI实例必须等到其他子VI实例停止使用它。使用可重入VI,制作VI的副本,称为“克隆VI”。这意味着同一子VI的多个副本可以同时运行,每个副本都有自己的内存空间。

打开前面板窗口。如前面板已经打开,则前面板窗口的状态为通过连线对该方法设定的状态。

前面板:关闭方法可用于关闭前面板窗口。

还可使用前面板窗口:状态属性,设置已经打开的前面板窗口的状态。

1. Overview:

This Exampleshows how to programatically get the Name or Clone Name of a VI. If the VIis run as top level VI, the name of the VI will appear. If the VI is used assubVI in a main VI, it will return the name of the clone.

2. Description:  

Sometimes isneeded to get the name of a VI. In this example is implemented a way of gettingthe name of a VI both if it is a clone or not. To implement this, calls to theVI Server are used.

The exampleincludes a VI called "Clone Name Finder" that calls 4 clones of the"Get Clone Name LabVIEW 2012 NI Verified.vi". In this case, the namesof the 4 clones are shown in the front panel.

If "GetClone Name LabVIEW 2012 NI Verified.vi" is run, the name of the VI will beshown in its front panel.

  

3. Requirements

  • LabVIEW 2012 (or compatible)

4. Steps toImplement or Execute Code

  1. Extract the files from "Get Clone Name LabVIEW     2012 NI Verified.zip"

  2. Run "Get Clone Name LabVIEW 2012 NI     Verified.vi". As is run from itself, it will return its own     name 

  3. 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. AdditionalInformation or References

 VI BlockDiagram

需要说明的是,上述的例程和文档,都是可以下载的,双击即可打开,其中压缩文件是可以采用粘贴复制的方式,拷贝到硬盘上。这不是图片,各位小伙伴看到后尝试一下,这个问题就不用加微信咨询了。有关LabVIEW编程、LabVIEW开发等相关项目,可联系们。附件中的资料这里无法上传,可去公司网站搜索下载。

LabVIEW程序,如下附件所示。

相关资料说明,如下所示。