LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Invoke node behaving as Reference Node when built as DLL

I'm having a problem with a DLL built in LabVIEW Application Builder (7.1). I'm using an Invoke Node to call another VI but get error 7 using the DLL when the VI is not present on the system.

Let's refer to the NI example 2JJFDDJT because it is simple. I download the 3 files related to the Invoke Node example. I set the "default data" for the VI path control to the absolute path of SubVI.vi. Now:

1a. I build the executable as per downloaded build file. It runs fine.
1b. I delete SubVI.vi and my executable runs fine.
2a. I use the same build file, but change it to build a DLL. I write
another VI (test_dll.vi) to call my DLL
2b. test_dll.vi executes as expected
2c. I delete SubVI.vi and now test_dll.vi throws up an Error 7 - SubVI.vi not found. But surely this should be within the DLL as it was in the Executable?

What am I doing wrong?

Thanks!

Andrew.
0 Kudos
Message 1 of 5
(2,951 Views)
Hi Andrew,
I've attached a zip file with an example call to both a dll, and an .exe.
I called the dll from cvi, and as pure .c code it shoudl be a simple call.
I also called the dll from a labview .vi (caller.vi), and this works fine. Hope you can see something different in your build process. (I used 7.1 aswell)
Thanks
Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 5
(2,951 Views)
Hi Sacha,

Your files do not work for the behaviour I expect:

1. Extract the files and run caller.vi to use the DLL - it works fine.
2. Now delete sub.vi.
3. Re-run caller.vi - I get a file not found message.

Did you try steps 2 & 3?

The same does not happen when compiled as an executable. How do I get sub.vi called from within the DLL?

Andrew.
0 Kudos
Message 3 of 5
(2,951 Views)
Hi Andrew,
run caller.vi - all OK
Shutdown Labview.
Renamed, moved, and deleted sub.vi
Open up LabVIEW and run caller.vi - works fine for me.
Also ran up the cvi caller executable and that works fine too with just the dll and the .exe in a separate directory.
Can you please attach just the dll and the .exe you're calling, or the .dll and the caller.vi from your computer, and I'll try them on a clean machine here.
Alternatively, do you have another computer there you could try?

Thanks

Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 4 of 5
(2,951 Views)
My sequence of steps was to use your files and:
1. Open and Run Main.vi
2. Stop sub.vi
3. Rename sub.vi
3a. The file is not locked by LabVIEW and does not appear in the LabVIEW's window list, so the rename works okay.
4. Open and Run Caller.vi
5. Error 1003.

However, shutting down LabVIEW and then starting at Step 4 all is well. So I guess LabVIEW must somehow "remember" Sub.vi once it has been opened in a session.

So I compiled my original application as a DLL and tried to call this from my colleague's PC using his Visual C++. No joy - Error 1003. I then tried his compiled application calling my DLL on my LabVIEW PC - it worked fine. I then installed the LVRTE on a fresh PC and once again the C++ application runs fine ca
lling the LV DLL. Back to his PC and I either get error 1003 (VI server can't find the file) or error 7 (VI server loads the VI, but that VI file is not executable because it can't find one or more subVIs). Bizzare! I've tried re-installing the LVRTE on his PC to no effect - do you have any suggestions? We're all running Win2K at the same patch level.

Andrew.
0 Kudos
Message 5 of 5
(2,951 Views)