From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
12-21-2012 07:18 AM
I have looked around on several of the other posts about this problem, and I haven't found the clue to fix my problem.
When I call my dll I get error 1097, so I have misconfigured the library call, but I can't figure out what is wrong. I know that it is something about the arrays, because if I use one of the functions that doesn't involve them (this is not included in the zip file), everything works. Everything is built and compiled by LabView 2012 (32 bit) on Windows 7 (64 bit).
Prototype: int32_t InitializeModule(uint32_t InputSourcesLength, ClusterArray *InputSources, uint32_t *OutputNamesLength, LStrHandleArray *OutputNames, uint32_t InputSourcesDependency[], LVRefNum *ConfigClusterRefnum, int32_t len)
Test.vi is a quick test of the DLL (you need to set path to the DLL yourself though). If everything works, it should come up with a dialogue (seen in dialogue.vi) asking for some input. InitializeModule.vi is the VI being called in the DLL.
12-21-2012 11:10 AM
I haven't installed LabVIEW 2012 yet, but if you either save your code back to 2011, or post a screenshot of both the Call Library Function Node configuration and the VI that uses it, I'd be happy to take a look.
Do you intend to be using the LabVIEW-specific datatypes LStrHandleArray and LVRefNum? When you say "everything is built and compiled by LabVIEW 2012" do you mean you built the DLL in LabVIEW, and you're trying to call it from LabVIEW? If so, why not just call the VIs directly?
12-22-2012 02:47 PM
12-22-2012 10:52 PM - edited 12-22-2012 10:53 PM
I don't see the attached code in LabVIEW 2011.
It is possible to load and run a VI at run-time. You can find examples of plugin architectures in the LabVIEW example finder and on the NI website. You open a reference to a VI on disk using Open VI Reference and then run it using Call By Reference. You can also use an invoke node with the method set to Run, but newer versions of LabVIEW (since 2011, I believe) include an asynchronous Call By Reference that makes the Run method mostly obsolete.
12-23-2012 09:06 AM
I have tried to reattach the zip file .. not sure what went wrong the first time, I was sure that I did attach it 🙂 Oh well ...
And thank you for mentioning Call By Reference, it makes it so much easier! As I am probably going to use that approach, debugging the attached code is no longer needed.
12-24-2012 01:36 AM
A DLL only contains the binary code of the function and no declaration of the interface at all. As such we can not really help you with only the DLL and VI at hand. We need at least the C function prototype of the DLL function too, which you would typically find in a header file. And of course any secondary header files that define types used in the function prototype declaration.