当前位置:网站首页>Exception 0xc00000005 code occurred when LabVIEW called DLL
Exception 0xc00000005 code occurred when LabVIEW called DLL
2022-06-10 23:47:00 【LabVIEW development】
LabVIEW call DLL There is an exception in the report 0xc0000005 Code
When calling local DLL when ,LabVIEW collapse , And receive an error message , This indicates that a memory access conflict has occurred ( Exception code :0xc0000005).
take LabVIEW Version from 32 Bit change 64 position , Now the application has a random row crash , There is still abnormal code when crashing :0xc0000005.
Solution
There are some different reasons that may lead to LabVIEW Calling dll Function crash , As shown below :
1. Make sure that and are selected DLL The same call specification
If the calling specification in the calling library function node is the same as DLL The calling specification of does not match , Will lead to LabVIEW collapse . Call specification in “ Call library function ” Specify... In the lower right part of the node window , As shown below .

edit
Add picture comments , No more than 140 word ( Optional )
2. Make sure that the calling library function node is connected (Call LibraryFunction Node) All inputs and outputs of
If you do not connect all the inputs and outputs of the calling library function node ,DLL Function will overwrite unallocated memory and cause LabVIEW collapse .
Be careful : If the second input is a pointer to the first input , Then the first input does not need to be output .
3. Make sure DLL Functions do not override LabVIEW Memory
If enough memory space is allocated or DLL Function writes more than the allocated memory ,DLL Write overrides to the remaining LabVIEW Memory space and cause LabVIEW collapse . Therefore, it is necessary to transfer values and read out DLL In the array , Make sure that memory is allocated correctly before string or waveform .
4. Make sure LabVIEW The correct data type is used, such as function passing parameters
Incorrect parameter data type used ( value , quote , Handle, etc ) call DLL Function will cause the function to unexpectedly point to an incorrect memory location , This leads to data errors , Even lead to LabVIEW or Windows collapse .
5. The function call itself is illegal
If a function tries to perform an illegal operation , May lead to LabVIEW collapse . If you are not the author of this function , Please contact the author of this function .
Related information
Use C When calling the specification , The caller is responsible for emptying the stack . When using standard call specifications , The called function is responsible for emptying the stack . If the caller (LabVIEW) And called DLL Functions do not use the same call specification , That's going to happen : Either they all move the data off the stack or they don't empty the stack . In either case, when the called function returns LabVIEW collapse .
If the input is not connected ,DLL Function will overwrite unallocated memory . If no output is connected ,LabVIEW Assume DLL The function does not need to pass the allocated memory on the input side , And use it for other program execution .
many DLL The function accepts the allocated memory , Pass parameters by pointer or value , Write this memory and return it . If memory is not allocated correctly , It could lead to collapse . for example , Following functions :
double *Waveform(double*waveform,uInt32 size);
The correct way to allocate memory in this case is to initialize the array with the specified number of elements size Parameters , Instead of passing in an empty array . The following figure shows the correct method .

edit
Add picture comments , No more than 140 word ( Optional )
If in LabVIEW Built in the DLL And want to show DLL VI Front panel , The following two requirements must be followed .
The call library function node must be set (Call LibraryFunction Node), send DLL stay run in anythread Run in mode . You can set the thread radio button to Run in UI thread Mode changed to Run in any thread .
Be careful : Yes LabVIEW-build sharedlibraries All calls to should be set to Run in any thread In mode . If you use LabVIEW The built shared library configuration calls the library function node and specifies that the Run in UI thread Run in mode ,LabVIEW May terminate the operation and require a reboot . For more information , see also “ Call library function (Call Library Function Dialog)” Dialog box .
call VI Cannot run in a user interface thread . Must be checked by , Select File... From the drop-down menu (File)»VI attribute (VIProperties) , From category (Category) Select execute... From the list (Execution) And ensure that the pre selected execution system (Preferred ExecutionSystem) It's a standard. (standard) , instrument I / O (instrument I/O), Data collection (data acquisition), other 1(other 1) Or others 2(other 2) . The same option as the caller should not be selected , Because the father VI Can run in the user interface thread .
About how to LabVIEW 7.1 Or earlier LabVIEW Lieutenant general LabVIEW Reference documentation for code use with other programming languages , Please see use LabVIEW External code manual . stay LabVIEW 8.0 Or later , see also LabVIEW The basics in the help directory (Fundamentals)>> chapter (section) For more information .
Be careful : When VI You may not need to follow the above steps to still run in development mode . however , When creating an application , Please ensure that the VI Set to run in any thread , As mentioned above .
If LabVIEW It won't crash until it closes
The most likely problem is what is called DLL Function corrupted memory . If you pass an array or string to DLL, be DLL Function cannot dynamically resize an array . Writing outside the last element of an array or string can corrupt memory , This is in LabVIEW It may not be obvious before closing .
Error checking - Use “ Error checking ” Tab assignment “ Call the library function node (Call Library Function Node)” Error checking level of .
This tab contains the following components :
Error checking level - Contains the following options :
Maximum (Maximum) - The maximum error checking level allowed to call a library function node . If the maximum error checking level is enabled , When calling the library function node, an error will be returned in the following cases , That is, you select the call specification on the function tab to share the library or DLL When the calling specification of the called function does not match . And if you are in a shared library or DLL When a function called in exceeds the space allocated for the specified string or array parameter , The maximum error check level also returns a warning . The maximum error checking level allows LabVIEW When executing the called shared library or DLL Recover from unhandled exceptions that occurred during .
Be careful : stay “ Error checking (Error Checking)” On the tab, select “ Maximum (Maximum)” Control options , The program slows down execution and increases “ Call the library function node ” Memory usage of . therefore , Select... Only when debugging the calling library function node configuration “ Maximum (Maximum)” control .
The default value is - Enable calling library function nodes (Call Library Function Node) Default error checking level for . Default error checking level allowed LabVIEW From the execution of the called shared library or DLL Recover from unhandled exceptions that occurred during .
Ban - Disable error checking calling library function nodes (Call Library Function Node). Disabling error checking for calling library function nodes can improve the execution speed of calling library function nodes . however , Some errors may result in LabVIEW Abnormal shutdown of . Before disabling error checking , Make sure that calling a function referenced by a library function node does not throw any unhandled exceptions .
More details , Participate in the introduction of the following annex .
LabVIEW、LabVIEW Development 、LabVIEW Programming 、LabVIEW Program
Examples and information mentioned above , Both in word In the attachment in , Click to download . Learn more , Can you contact us .
边栏推荐
- ILRuntime热更框架 安装以及断点调试
- 细数十大信息安全原则
- 字蛛(font-spider)教学——ttf/otf字体文件压缩
- Fiddler creates an autoresponder
- 基于CenterOS7安装Redis及常见问题解决(带图讲解)
- Introduction to Wireshark capturing RTP load TS stream (UDP multicast)
- LeetCode 501 :二叉搜索树中的众数
- Openvp* integrated LDAP authentication
- 云图说|每个成功的业务系统都离不开APIG的保驾护航
- 300 questions on behalf of the first lecture on determinant
猜你喜欢
![30 frequently asked questions of 2022 latest software test interview questions [continuous update ~]](/img/43/12392286fe711c5ef15462c900e456.png)
30 frequently asked questions of 2022 latest software test interview questions [continuous update ~]

LabVIEW用高速数据流盘

MySQL table mechanism
![[Video] kmeans mean clustering and hierarchical clustering: R language analysis life happiness index visualization | data sharing](/img/d5/d544ab0c14ba22946219feafdc3392.png)
[Video] kmeans mean clustering and hierarchical clustering: R language analysis life happiness index visualization | data sharing

LabVIEW错误“内存已满 - 应用程序停止在节点”

Leetcode 501: mode in binary search tree

Yuntu says that every successful business system cannot be separated from apig

Unity 脚本无法显示C#源码的中文注释 或者VS创建的脚本没有C#源码的注释

Project training 10 - backup of specific databases

PwnTheBox,Web:hello
随机推荐
Unity 脚本无法显示C#源码的中文注释 或者VS创建的脚本没有C#源码的注释
Apple CMS collection station source code - building tutorial - attached source code - new source code - development documents
LabVIEW确定控件在显示器坐标系中的位置
Introduction to Wireshark capturing RTP load TS stream (UDP multicast)
34. find the first and last positions of elements in the sorted array - binary search, double pointer
在Oracle表中如何进行关键词搜索
[Video] kmeans mean clustering and hierarchical clustering: R language analysis life happiness index visualization | data sharing
LabVIEW获取Clamp函数找到的所有点的信息
Data and information resource sharing platform (IV)
【视频】KMEANS均值聚类和层次聚类:R语言分析生活幸福指数可视化|数据分享
Commonplace - the timetable of the great philosopher Kant
LeetCode 501 :二叉搜索樹中的眾數
改变世界的开发者丨玩转“俄罗斯方块”的瑶光少年
Usage of C tryparse
第六章——分枝限界法
MySQL learning child query
Analysis of Genesis public chain
可扩展到Max–MCU和MPU开发,使用相同的许可证
OSS stores and exports related content
The data file insurance CSV contains 1338 observations, that is, the registered beneficiaries of the insurance plan and the characteristics that represent the characteristics of patients and the total