使用自定义模板和示例项目开发LabVIEW项目

简介: 使用自定义模板和示例项目开发LabVIEW项目

使用自定义模板和示例项目开发LabVIEW项目


创建项目时,LabVIEW会显示创建项目对话框,以帮助开发人员选择可用作起点的模板或样样例项目。如果要将创建的项目用作自定义模板和示例项目,则须将每个项目的源文件和元数据添加到相应的LabVIEW目录中。然后,开发人员可以使用自定义项目作为开发项目的起点。


选择LabVIEW目录来存储自定义内容


LabVIEW在两个位置搜索要在创建项目对话框中显示的内容。选择最适合希望如何使用自定义内容的位置:


<LabVIEW>\ProjectTemplates—如果具有版本管理的托管代码实用程序(如VI软件包管理器)安装了自定义内容,请使用此位置。


<LabVIEWData>\ProjectTemplates—如果没有对<LabVIEW>目录的写入权限,或者想要为多个LabVIEW版本单源自定义内容,请使用此位置。


注意:LabVIEW对<LabVIEWData>\ProjectTemplates目录中的所有模板和样样项目执行版本检查。如果项目的.lvproj文件保存在LabVIEW的更高版本中的LabVIEW中,则创建项目对话框中会省略该项目。


组织<LabVIEWData>目录


首次将模板和示例项目添加到<LabVIEWData>目录时,必须创建子目录以确保LabVIEW可以找到内容。


完成以下步骤来组织<LabVIEWData>目录:


1.       在<LabVIEWData>下创建项目模板目录。


2.       匹配<LabVIEW>\ProjectTemplates目录的文件层次结构,以便存在以下路径:


<LabVIEWData>\ProjectTemplates\CategoryOverrides


<LabVIEW Data>\ProjectTemplates\MetaData


<LabVIEW Data>\ProjectTemplates\Source


储源文件


源文件由每个自定义模板和示例项目的.lvproj文件、库、VI和支持文件(如图像和文档)组成。


在“ProjectTemplates\Source”目录中为要在“创建项目”对话框中显示的每个项目创建一个子目录,并将每个项目的源文件添加到其各自的子目录中。确保没有子目录包含多个项目的源文件。


注意:


确保您的自定义模板和示例项目不包含任何自动填充文件夹。


确保您的自定义模板和示例项目不包含任何受密码保护的源VI。


确保源.lvproj中引用的所有文件都包含在其各自的子目录中。当开发人员尝试使用“创建项目”对话框创建模板或示例项目的实例时,缺少项目文件可能会导致问题。


创建和存储元数据


元数据定义“创建项目”对话框中显示的内容。LabVIEW可识别XML格式的元数据。XML文件可以包含一个或多个项目的元数据。


完成以下步骤以创建和存储自定义项目的元数据:


1.       创建一个XML文件并添加<元数据>标记。此标记包含所有元数据。


2.       为要在“创建项目”对话框中显示的每个项目添加<ProjectTemplate>标记。此标记包含每个项目的元数据。


3.       使用以下标记定义每个模板或示例项目。该表的“示例项目”列列出了使用每个XML标记的项目。请参阅<LabVIEW>\ProjectTemplates\MetaData\NILV_Core_TemplateMetaData.xml中的文件,了解如何定义现有模板和示例项目的元数据。


aa32083257f4dcf971cf81daf30750b7.png



原文内容如下


UsingCustom Templates and Sample Projects to Develop LabVIEW Projects


Whenyou create a project, LabVIEW displays the Create Project dialogbox to help you select a template or sample project you can use as a startingpoint. If you want to use projects you create as custom templates and sampleprojects, you must add source files and meta data for each project to thecorresponding LabVIEW directories. Then, users can use the custom projects asstarting points to develop their projects. In addition to this document, referto the \ProjectTemplates directory to see how source files, meta data, andcategory overrides are stored for existing templates and sample projects. Usethese files as examples of how to create and store files for custom templatesand sample projects.


Selecting a LabVIEW Directory to StoreCustom Content

LabVIEWsearches for content to display in the Create Project dialogbox in two locations. Select the location that best suits how you want to usethe custom content:


§  <LabVIEW>\ProjectTemplates—Usethis location if a managed code utility with version management, such the VIPackage Manager, installs the custom content.


§  <LabVIEWData>\ProjectTemplates—Use this location if you donot have write access to the <LabVIEW> directory, or if you want to single-source the customcontent for multiple LabVIEW versions.


Note: LabVIEW performs a version check on all templates andsample projects in the <LabVIEWData>\ProjectTemplates directory. If the .lvproj filefor a project is saved in a later version of LabVIEW than the version currentlyrunning, the project is omitted from the Create Project dialogbox.

Organizing the <LabVIEW Data>Directory


Whenyou add templates and sample projects to the <LabVIEW Data> directory for the first time, you must createsubdirectories to ensure that LabVIEW can find the content.


Completethe following steps to organize the <LabVIEWData> directory:


1.     Create the ProjectTemplates directory under <LabVIEWData>.


2.     Match the file hierarchy of the <LabVIEW>\ProjectTemplates directory such that the following paths exist:


§  <LabVIEWData>\ProjectTemplates\CategoryOverrides


§  <LabVIEWData>\ProjectTemplates\MetaData


§  <LabVIEWData>\ProjectTemplates\Source


Storing Source Files

Sourcefiles consist of the .lvproj file, libraries, VIs, and support files, such as imagesand documentation, for each custom template and sample project.


Create a subdirectory in the ProjectTemplates\Source directory for each project you want to display in the CreateProject dialog box and add the source files for eachproject to their respective subdirectories. Ensure that no subdirectorycontains source files for multiple projects.


Notes:


§  Ensure that your custom templates and sample projects do notcontain any auto-populating folders.


§  Ensure that your custom templates and sample projects do notcontain any source VIs that are password-protected.


§  Make sure that all the files referenced in your source .lvproj areincluded in their respective subdirectories. Missing project files can causeproblems when developers attempt to use the Create Project dialogbox to create an instance of your template or sample project.


Creating and Storing Meta Data

Metadata defines the content that appears in the Create Project dialogbox. LabVIEW recognizes meta data in XML format. An XML file can contain metadata for one or more projects.


Completethe following steps to create and store meta data for custom projects:


1.     Create an XML file and add the <MetaData> tag. This tag encloses all meta data.


2.     Add a <ProjectTemplate> tag for each project you want to display in the CreateProject dialog box. This tag encloses meta data for eachproject.


3.     Use the following tags to define each template or sampleproject. The Example Project columnof the table lists projects that use each XML tag. Refer to the file located at <LabVIEW>\ProjectTemplates\MetaData\NILV_Core_TemplateMetaData.xml to see how the meta data for existing templates and sampleprojects is defined.


image.png

image.png


4.     Store the XML file in the ProjectTemplates\MetaData directory.


Overriding the Sorting Order forFilters

Theleft pane of the first page of the Create Project dialogbox lists all the filters you specify in the meta data XML file. By default,LabVIEW lists filters you create in alphabetical order.


Completethe following steps to override the default sorting order for the filter list:


1.     Create an XML file and add the <CategoryOverrides> tag. This tag encloses all category override data.


2.     Add a <Category> tag for each filter for which you want to specify customsorting behavior. This tag encloses the name and sorting priority of eachfilter.


3.     For each filter, create a <Name> tag and set the value to the name of the filter you usedin the meta data XML file.


4.     For each filter, create a <Priority> tag and set the value according to the behavior you want.


The value of this tag is an index number, so a value of 0 places the filter atthe top of the list. Any parent filter for which you specify a value less than100 appears above the default parent filters, such as Templates and SampleProjects. If you specify a value for any child filter, the filter appears abovethe default child filters, such as Desktop.


5.     Store the XML file in the ProjectTemplates\CategoryOverrides directory.


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

相关文章
|
缓存 Linux 虚拟化
Linux系统之lscpu命令的基本使用
【8月更文挑战第3天】Linux系统之lscpu命令的基本使用
437 19
Linux系统之lscpu命令的基本使用
|
11月前
|
数据挖掘
置信区间与预测区间:数据科学中的不确定性量化技术深度解读
本文深入探讨了统计学中两个常见但容易混淆的不确定性量化工具:置信区间和预测区间。
913 1
置信区间与预测区间:数据科学中的不确定性量化技术深度解读
|
10月前
|
算法 数据安全/隐私保护 索引
索引OFDM调制解调系统的matlab性能仿真
本文对m索引OFDM调制解调系统性能进行了仿真分析,增加了仿真图并配有语音讲解视频,使用Matlab2022a完成仿真,代码无水印。研究了OFDM-IM技术,通过激活不同子载波组合传输额外信息,提高频谱效率和降低PAPR。提出了OFDM联合子块索引调制技术(OFDM-JS-IM)和OFDM全索引方法(OFDM-AIM),并通过遗传算法优化子块查找表,有效提升系统性能。提供了核心MATLAB程序示例。
272 3
|
Java
Java实例详解
Java实例是通过类创建的对象,其核心在于将抽象的类定义转化为具体的实体。类作为对象的模板定义了属性和行为,而实例则是这些定义的具体实现。通过`new`关键字可以创建实例,并利用点运算符访问其属性和方法。实例拥有自己的生命周期,从创建到使用直至被垃圾回收机制自动清理。此外,实例变量和静态变量的区别在于前者属于单个实例,后者则为所有实例共享。理解Java实例的概念及其管理对编程至关重要。
430 15
|
人工智能 C++
【Azure Developer】上手 The Best AI Code "Cursor" : 仅仅7次对话,制作个人页面原型,效果让人惊叹!
本文介绍了使用 Cursor 这款 AI 辅助编程工具的步骤与体验。通过下载安装 Cursor 并使用 GitHub 账号登录,你可以创建 HTML 文件并借助 AI 自动生成代码。文章详细描述了如何逐步优化生成的内容,包括调整布局、增加样式及响应式设计等。此外,还展示了通过多次迭代改进后的最终效果,并提供了生成的 HTML 模板代码,便于读者直接使用或进一步修改。
439 3
|
Java 应用服务中间件 Maven
JavaWeb基础5——HTTP,Tomcat&Servlet
JavaWeb技术栈、HTTP、get和post区别、响应状态码、请求响应格数据式、IDEA使用Tomcat、报错解决、Servlet的体系结构、IDEA使用模板创建Servlet
JavaWeb基础5——HTTP,Tomcat&Servlet
|
12月前
|
前端开发 JavaScript
轻松上手:基于single-spa构建qiankun微前端项目完整教程
轻松上手:基于single-spa构建qiankun微前端项目完整教程
415 0
|
数据采集 监控 测试技术
JKI State Machine的特点与详细介绍
JKI State Machine的特点与详细介绍
327 0
JKI State Machine的特点与详细介绍
|
数据采集 机器学习/深度学习 数据挖掘
使用Python进行数据预处理与清洗的最佳实践
本文探讨了Python在数据预处理和清洗中的关键作用。预处理包括数据收集、整合、探索、转换和标准化,而清洗则涉及缺失值、重复值、异常值的处理及数据格式转换。文中提供了使用pandas库进行数据读取、缺失值(如用平均值填充)和重复值处理、异常值检测(如IQR法则)以及数据转换(如min-max缩放)的代码示例。此外,还讲解了文本数据清洗的基本步骤,包括去除标点、转换为小写和停用词移除。整体上,文章旨在帮助读者掌握数据预处理和清洗的最佳实践,以提高数据分析的准确性和效率。
1940 2
|
关系型数据库 MySQL 数据库
深入探讨MySQL分表策略与实践
深入探讨MySQL分表策略与实践
694 0