LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting a #7 error when dynamically loading a VI using a DLL

Problem invoking a VI dynamically in LabVIEW 7.0.

Example files are attached (simply extract the files
in one directory).

I have a VI, Invoker.vi, that dynamically invokes
another one, Basic VI.vi.

If I use Invoker.vi natively, no problem, everything
works.

Now, I build Invoker.vi as a shared library
(Invoker.dll), and call it from an executable
(CallingLabVIEW.exe, requires .Net Framework 1.1,
you can create your own by simply calling the
long Invoker(LVBoolean *status) method from the DLL).

I get an error:
Open VI Reference in Invoker.vi->Invoker.vi.ProxyCaller

Anyone knows what I may be doing wrong?

I've tried putting the full path name of Basic VI.vi,
same result
.

Thanks in advance,

phil
0 Kudos
Message 1 of 6
(3,360 Views)
Phil,
The problem resides in the procedure when the application was built. Application Builder requires you to use the "Add Dynamic VI" button to specify dynamically-loaded VIs (e.g., VIs that you load using VI Server), if these VI's are being used and they were not specified in the building process then you are going to receive this error.
Zvezdana S.
0 Kudos
Message 2 of 6
(3,360 Views)
Zvezdana,

Thanks for the help, but... ...I had forgotten to mention that I *had* tried adding the VI in the build process. It didn't solve the issue, and in any case having to build with all the dynamic VIs would not be practical for what I'm trying to achieve.

Another note on this matter: I have an application (an EXE) built that calls dynamic VIs without having them included in the build, and that works. I believe adding dynamic VIs to the build is only useful if the dynamic VIs are not going to be deployed with the application otherwise. But, if they are available on the target host at the path specified when you run the application, it should work even if you didn't include them in the build.

Thanks again,

phil
0 Kudos
Message 3 of 6
(3,360 Views)
I noticed that your subVI is set to be reentrant. I don't think you can have a reentrant VI and also show it's front panel.
0 Kudos
Message 4 of 6
(3,360 Views)
Phil,
I built an exe from your Invoker.vi. If I do not inlclude Basic VI.vi as dynamic VI, I get error 7 on Open Reference.vi in Invoker.exe.
When I include Basic VI.vi as dynamic, there is not error in the executable.
Make sure you add this VI as dynamic, not support file.
Zvezdana S.
0 Kudos
Message 5 of 6
(3,360 Views)
Zvezdana,

Thanks, it works. And I finally got it to work without including the VI dynamically: I just had to use the
path ..\Basic VI.vi, as when a VI is included in a library, its path takes the library name as well.

Thanks again for the help.

phil
0 Kudos
Message 6 of 6
(3,360 Views)