Labview 2011中的DLL加载错误 [英] DLL Load Error in Labview 2011

查看:483
本文介绍了Labview 2011中的DLL加载错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在LabVIEW中加载DLL遇到问题。

我正在使用LabVIEW连接到流量计,为此,制造流量计的公司足够好让我子VI图书馆。每个子VI都从公司提供的两个DLL库中的一个调用一个函数。

I have encountered a problem with loading a DLL in LabVIEW.
I am using LabVIEW to connect to a flow meter, and for this purpose the company that makes the flow meter was nice enough to give me a library of subVIs. Each of those subVIs calls a function from one of two DLL libraries also provided by the company.

所以这些子VI中的一半依赖于一个DLL,另一半依赖于另一个DLL。
使用第一个DLL的那些工作效率很好,并没有问题。
但是使用第二个DLL的那些DLL有一些错误:每当我打开这些子VI之一时,我会看到一个弹出窗口:

So half of these subVIs are dependent on one DLL, and the other half are dependent on the other DLL. Those that use the first DLL work prefectly well, and there is no issue with them. But those that use the second DLL have some sort of bug : every time I open one of these subVIs, I get a popup window that says:


加载absolute path\\\
ame.dll时出错。 DLL库初始化程序失败。

Error loading "absolute path\name.dll". A DLL Library initialization routine has failed.

然后,子VI不可执行,并且运行按钮显示为破解。但有一个扭曲。如果我右键单击配置库功能节点,然后选择配置,然后在相应的字段中重新选择完全相同的 dll绝对路径,然后单击确定,子VI运行得很好,并且完全正确它应该做。我实际上没有改变任何节点配置窗口,我只是重新选择相同的路径。即使陌生人也是这样一个事实:这个奇怪的诡计只能在大约75%的时间里工作。另外25%的时间,我需要实际关闭VI和引用它的任何其他VI,然后重新打开它。

The subVI is then not executable, and the run button is displayed as cracked. But there is a twist. If I right-click on the "configure library function node" and select Configure, then reselect the exact same dll absolute path in the appropriate field, then click OK, the subVI runs perfectly well and does exactly what it is supposed to do. I don't actually change anything in the node configuration window, I merely reselect the same path. Even stranger is the fact that this weird "trick" only works about 75% of the time. The other 25% of the time, I need to actually close the VI and any other VIs that reference it, then reopen it.

然后还有另一个扭曲,对我来说更不感兴趣:公司还给了我几个示例VI,显示如何使用不同的子VI彼此之间的关系。这些例子运行得很好!但是后来我写了我自己的VI,这是一个更简单的示例VI版本,我不断收到DLL加载错误。

And then there is another twist that makes even less sense to me: the company also sent me a couple "example VIs" that show how the different subVIs should be used in relation to each other. These examples run perfectly well! But then I wrote my own VI that is a simpler version of the "example VI", and I keep getting the DLL load error.

我做错了什么,如何确保VI是可执行的,而不必每次重新配置库函数节点?你认为是什么导致问题?

What am I doing wrong, and how do I make sure that the VI is executable without having to reconfigure the Library function node every time ? What do you think is causing the problem ?

注意:问题的一部分是,我不太明白在labview中阅读DLL的工作原理,所以任何有关这方面的信息也将不胜感激。 p>

N.B: Part of the problem is that I don't really understand how reading a DLL works in labview, so any information on that would also be greatly appreciated.

推荐答案

当您在labview中调用函数(在dll中)时,.dll必须位于此处,可以方便地访问链接到位置(或者我相信与VI /可执行文件相同的位置)。

When you call a function (within a dll) in labview the .dll has to be in a location here it is readily accessible in the linked to the location (or I believe in the same location as the VI/executable).

例如,如果我写一个称为stdout的子VI来写入命令提示符会调用windows dll。这个dll应该是在Windows计算机以来每一次都在同一个地方,因为很多Windows程序需要它们的日常使用,所以它将永远被定位。

For example if I write a subVI that say calls stdout to write to the command prompt it will call a windows dll. This dll should be in the same place in every since windows computer since a lot of windows program need it for their day to day use so it will always be locaed.

c:\windows\system32\stdout.dll //note this is and example

现在,当您使用新的流量计VI时,期望动态链接库位于原始作者(或至少最后编辑器)机器上的任何位置。如果他们不在那里,LabView会出现恶作剧。

Now when you used your new flowmeter VI's it was expecting the dynamic link libraries to be located where ever they were on the orginal author (or at least last editors) machine. If they are not there, LabView freaks out.

您可以重新链接并重新设计VI的困难。抱歉,它可能是最简单的方式来重新制作。

You can relink, and remake the VI's the hard way. Sorry but its likely the easiest way to remake them.

这篇关于Labview 2011中的DLL加载错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆