LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing a VI in a DLL trough VI Server

Hi all,

        I'm trying to access a VI in a DLL build with Labview trough VI Server.

 

I copied some parameter in the initialisation file of an executable that worked to the .ini file of the dll. It seems that the dll doesn't load those parameter from the .ini file. If i activate Web server to connect trough debug application or shared library, it's work but not the VI Server.

 

Is somebody have already access a VI in a DLL trough VI Server?

 

Thanks

 

B.

Benoit Séguin
Software Designer
0 Kudos
Message 1 of 7
(3,205 Views)

VI Server is started and controlled on behalve of the LabVIEW process (IDE or LabVIEW executable). A LabVIEW DLL does not have its own process context. Therefore the VI server is controlled by the LabVIEW executable ini file and barring that (because the loading application is not a LabVIEW process) not at all.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 7
(3,185 Views)

So how can I access to a VI using VI Server in a DLL?

Benoit Séguin
Software Designer
0 Kudos
Message 3 of 7
(3,176 Views)

Unless the VI in the DLL is called by a LabVIEW process, you can't in recent LabVIEW versions. Before LabVIEW 8.0 you could simply treat the DLL file like a LabVIEW Archive (LLB) and specify the path to the VI in such a way to your VI Server functions, but in LabVIEW 8.0 they disallowed such access to compiled VI resources inside exe's and dll's due to some überconscious concerns by some LabVIEW users that this allows others to steal their very precious IP out of compiled executables.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 7
(3,157 Views)

The VI is called by a labview process.

There is must be a way to activate VI Server in a VI that is inside a DLL.

Benoit Séguin
Software Designer
0 Kudos
Message 5 of 7
(3,144 Views)

No, the VI Server is activated in the LabVIEW process not in the DLL. If the LabVIEW process has loaded the DLL AND it is the same version as the the LabVIEW version used to create the DLL, the DLL function is executed in the context of the LabVIEW process, otherwise in a seperate context of the according runtime engine. Still there is no simple way to access that VI inside the DLL over normal VI Server functionality. The LabVIEW process is for the most part oblivious about the fact, if the DLL is a C created DLL (or Delphi, or VB or whatever) or a LabVIEW DLL. It simply calls the function as a C function.

 

The compiled C stub which is called to instantiate the DLL function does detect if the calling process is a LabVIEW process with a compatible version and uses in that case the according LabVIEW runtime environment to execute the VI inside the DLL to gain some performance advantages, but that is about it. The only thing you SHOULD be able to do, is to connect a LabVIEW development environment to the debug interface of the DLL but that is although similar to VI Server not at all the same as VI Server.

 

This all said, it would help if you would elaborate what you really want to do. Some people here might be able to offer alternative ways to achieve your objective then, without you having to bang your head bloody on this brick wall.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 7
(3,139 Views)

rolfk a écrit :

No, the VI Server is activated in the LabVIEW process not in the DLL. If the LabVIEW process has loaded the DLL AND it is the same version as the the LabVIEW version used to create the DLL, the DLL function is executed in the context of the LabVIEW process, otherwise in a seperate context of the according runtime engine. Still there is no simple way to access that VI inside the DLL over normal VI Server functionality. The LabVIEW process is for the most part oblivious about the fact, if the DLL is a C created DLL (or Delphi, or VB or whatever) or a LabVIEW DLL. It simply calls the function as a C function.

 

The compiled C stub which is called to instantiate the DLL function does detect if the calling process is a LabVIEW process with a compatible version and uses in that case the according LabVIEW runtime environment to execute the VI inside the DLL to gain some performance advantages, but that is about it. The only thing you SHOULD be able to do, is to connect a LabVIEW development environment to the debug interface of the DLL but that is although similar to VI Server not at all the same as VI Server.

 

This all said, it would help if you would elaborate what you really want to do. Some people here might be able to offer alternative ways to achieve your objective then, without you having to bang your head bloody on this brick wall.


The only way i found to activate it, is to add code in the dll.

 

Here is an example on what to add to activate VI-Server from .ini file.

 

Sample code.JPG

Benoit Séguin
Software Designer
0 Kudos
Message 7 of 7
(2,978 Views)