我想在 LabView 中使用 C\C++ 生成的 DLL,例如 this example或 this one . 我想知道它是在我的目标机器(我的 PXIe)上部署和运行代码,还是在运行 LabView 的计算机上运行 DLL。 国家仪器,在其using external codes in LabView第 15 页,在两种调用方法的特征下,提到,
- You compile the source code and link it to form executable code. If you already have a compiled DLL, this step is not necessary.
- LabVIEW calls the executable code when the Call Library Function Node or CIN executes.
- LabVIEW passes input data from the block diagram to the executable code.
- LabVIEW returns data from the executable code to the block diagram.
我认为它没有阐明 DLL 是否在目标设备上运行,也就是实时运行。 此外,我发现this document这非常令人困惑,因为它没有直接引用任何特定方法。
旁注:我需要在 PXIe 上运行 C/C++ 代码,并且需要从我的 LabVIEW 代码实时调用它。
最佳答案
我从来没有这样做过,所以我只能尝试给出一些可能有帮助的提示:
如果要使用 dll,它必须在运行 LabVIEW 应用程序的目标上运行:如果您的应用程序在台式计算机上运行,则在台式计算机上访问 dll。如果您的应用程序在 PXI 上运行,则 dll 必须在 PXI 上运行。
看看this NI website :
If the shared library is C++-based, National Instruments strongly recommends using the MSVC 2009 or MSVC 2010 compilers.
和
If your DLL works on a Windows machine, it may work in LabVIEW Real-Time (NI PharLap ETS). However, the code will fail if it calls functions that are not included in the Real-Time operating system's subset of Win32.
在这个网站上,他们还有一个工具可以检查特定的 dll 是否可以工作。
关于c# - C\C++ 内置的 dll 是否在 LabView 中实时运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57830441/