当前位置:网站首页>LabVIEW code generation error 61056
LabVIEW code generation error 61056
2022-08-03 22:10:00 【LabVIEW development】
LabVIEW code generation error 61056
During the code generation process, the following error message "Error 61056: Sub VI is non-reentrant, is in a Single-cycle TimedLoop, and has more than one caller" appears.I'm not calling the non-reentrant subVI multiple times in the loop, why am I getting this error?
Answer: This problem does not depend solely on whether a subVI is called multiple times in a single-cycle Timed Loop.A subVI becomes a "shared resource" if it is called from multiple places in a program.A shared resource is anything that is used by multiple places.From an implementation perspective, sharing resources requires additional circuit logic—arbitration.The execution time of the arbitration circuit is usually more than one clock cycle, so it cannot appear in a single-cycle timed loop (SCTL).To solve this problem, you need to enable the VI's reentrant property in VIProperties>>Execution>>Reentrant Execution.This will generate multiple instances of the VI - placing a copy of the VI at each call, and the VI with the reentrant property is called multiple times, but is not a shared resource.It's important to remember that you cannot use functional global variables in a VI that is thus reentrant because new storage space is generated for them at each call site
Refer to the screenshot below:
Edit
Add image comment, no more than 140 characters (optional)
When should reentrant VIs, template VIs, and dynamic calling VIs be used?What is the difference between these three types?
Solution
Reentrant VI
Reentrant VIs are used when you want to run multiple instances of the same VI at the same time.When a VI is not reentrant, the VI has only one data space.Therefore, only one caller can run the VI at a time, so the caller may have to "wait for its turn" before using the VI.This is the default option for VIs, but VIs can be made reentrant.There are two types of reentrancy: shared and preallocated.
Shared reentrant VI
If the Shared Clone Reentrant Execution option is selected, the VI has a pool of data space (same as the clone pool).Initially only two clones are created at the beginning of the calling VI.The caller will use one of the data spaces, but it does not know which data space is used, and it may be a different instance in subsequent calls.When there is not enough data space (clone) in the pool for a certain number of callers to call simultaneously, new data space (clone) is created and added to the pool.Here the word "shared" in "shared clones between instances" means that the data space can be used by multiple callers over time.If there are 20 calls to the SubVI, but at most two of those calls happen at the same time, there will only be two data spaces in the pool, and they will be "shared" among the 20 calls.Memory usage is optimized because only the necessary number of clones are created based on current needs.This option is recommended for fastest execution rate and best memory optimization.
Pre-allocated reentrant VIs
If the preallocated clone reentrant execution option is selected, each caller has its own private data space (and clone).If there are 20 calls to the VI, 20 clones will be created and added to the pool when the calling VI starts.If the calling pattern is similar to the one above, it is possible that only two are busy at the same time.Use this type of reentrant VI if you want to use the same clone for each invocation of a given instance of the SubVI (for example, if the SubVI needs to persist data from one invocation to the next).Shared clones won't work in this case because it's never known which instance of the SubVI last used the clone that was going to be used, and the stored information will "crosstalk" unpredictably between the SubVIs."Preallocated" means that for each call, the data space and clone for that call are created.Preallocation occurs before the VI runs.If you are opening multiple front panels of the same VI, the reentrant SubVI option will not work.
If the VI to be opened multiple times is a top-level VI, you can copy the top-level VI on disk to a temporary directory with a unique name and open the new file instance, it is not necessary to copy any SubVIs.Simply copy the top-level VI, and you can open and run the copy with VI Server.
Template VI
You can make a multi-instance panel into a template VI and open the file from the template each time.VI templates are VIs with a .vit extension.You can create a new VI from a template under File»New»Start From Template.This creates a new instance of the VI with its own memory space.They are created with different storage locations and are only used as a starting point for making another VI.Then, you need to configure whether the newly created VI is reentrant.
Dynamic VI
You can use VI Server to open VIs and VI templates.VI Server is used to dynamically load and run VIs.When using a SubVI, the code and data space of the SubVI is loaded when the top-level VI is loaded.When dynamically loading a VI, its code is not loaded until the VI Server calls the SubVI, instead of using it as a SubVI and loading the code when the main program is called.This saves memory at startup.
LabVIEW, LabVIEW development, LabVIEW programming, LabVIEW programming
The examples and materials mentioned above are in the attachments in word, which can be clicked to download.For more information, please contact us.
LabVIEW code generation error 61056 - Beijing Hanwen Netstar Technology Co., Ltd. (bjcyck.com)
边栏推荐
- 376. Wiggle Subsequence
- UVa 10003 - Cutting Sticks(白书,区间DP)
- [N1CTF 2018]eating_cms
- 如何基于WPF写一款数据库文档管理工具(二)
- JPA Native Query(本地查询)及查询结果转换
- Unification of east-west and north-south communications
- 基于支持向量机的网络⼊侵检测系统的全面调查和分类
- 386. Lexicographical Numbers
- 【云原生实用技巧】使用 skopeo 批量同步 helm chart 依赖镜像
- 软件测试人员必备的60个测试工具清单,建议收藏一波~
猜你喜欢
中国企业构建边缘计算解决方案的最佳实践
[3D检测系列-PV-RCNN] PV-RCNN论文详解、PV-RCNN代码复现、包含官网PV-RCNN预训练权重及报错问题
电商数仓ODS层-----日志数据装载
[N1CTF 2018]eating_cms
[kali-vulnerability exploitation] (3.2) Metasploit basics (on): basic knowledge
数据一致性:双删为什么要延时?
pikachu Over permission
What is Adobe?
[b01lers2020]Life on Mars
nxp官方uboot移植到野火开发板PRO(无任何代码逻辑的修改)
随机推荐
CAS:1260586-88-6_生物素-C5-叠氮_Biotin-C5-Azide
CAS:1620523-64-9_Azide-SS-biotin_biotin-disulfide-azide
【云原生实用技巧】使用 skopeo 批量同步 helm chart 依赖镜像
老板:公司系统太多,能不能实现账号互通?
线程池的高级应用技巧核心解读
如何设计 DAO 的 PoW 评判标准 并平衡不可能三角
2019年10月SQL注入的两倍
Android build error: Plugin with id 'kotlin-android' not found.
21天打卡挑战学习MySQL——《MySQL工具的使用》第一周 第二篇
函数,递归以及dom简单操作
Causes of Mysql Disk Holes and Several Ways to Rebuild Tables
斩获双奖|易知微荣获“2021中国数字孪生解决方案优秀供应商”“中国智能制造优秀推荐产品”双奖项!
授人以渔 - 如何自行查询任意 SAP UI5 控件属性的文档和技术实现细节试读版
October 2019 Twice SQL Injection
113. Teach a Man how to fish - How to query the documentation and technical implementation details of any SAP UI5 control property by yourself
Teach a Man How to Fish - How to Query the Properties of Any SAP UI5 Control by Yourself Documentation and Technical Implementation Details Demo
2022-08-02 mysql/stonedb慢SQL-Q18-内存使用暴涨分析
关于GPIO你真的懂了吗?这篇文章都给你整理好了
聚焦开源与联合共创|麒麟软件出席开源峰会欧拉分论坛
什么密码,永远无法被黑客攻破?