LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I pilote an .exe from an external application (VB)

Hi !
I've got a problem, I want to create a Labview Application (.exe) an to run some methodes of this application from Visual Basic. I think it's possible to create an exe and a dll, and then to create a data socket between the dll and the .exe, and finally use this dll from Visual Basic...

Hmm... i hope you understand what i mean... anyway i'm not sure that's the best way to do this.. if someone has another idea, i would really appreciate it...

Thanks a lot !
0 Kudos
Message 1 of 9
(3,821 Views)
I haven't done any inter-language communication, but your way sounds viable to me. You can also use TCP functions to communicate between the programs or call a VB dll from LV to recieve instructions. Hopefully some other people have better answers. I'd like to know about this as well.

___________________
Try to take over the world!
0 Kudos
Message 2 of 9
(3,802 Views)
There are several possibilities. Here are a few:
1. Build the LV and VB apps to run autonomously, with TCP or similar communication between the two. You can create your own message-based command language such that one app can "control" the other.
2. Build a DLL in LV, and call it from VB as you would any DLL. Or vice versa.
3. Build an EXE in LV, and enable it as an ActiveX server. VB can then access this ActiveX server and its properties/methods.

Steven H.
0 Kudos
Message 3 of 9
(3,794 Views)
Thanks steven, the last solution sounds good! But i still have a question.. if i build an exe (and enabled it as server active X), how can i access to its methods and properties?

From VB, i can load a vi reference, but in order to do this, i have to indicate the path of the vi (if i enter the path of the exe it doesn't work...)!

So your solution works perfectly with VB and vis...But, the problem is we want to deliver a exe to our customer, not all vi ans sub vi we develloped...

Hmm.. i think i miss something...
0 Kudos
Message 4 of 9
(3,786 Views)

Hi,

There some useful links for creating DLL's, activeX in LabVIEW.

Regards
Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 5 of 9
(3,779 Views)
Your executable's methods and properties will essentially mirror those available for labview.exe. This includes all the methods and properties for the application and virtual instrument classes. The ActiveX interface to these classes is almost identical to the VI Server interface that is accessible through the block diagram.

To use these methods and properties from VB, you'll need to register the executable as an ActiveX server. If memory serves, you can do this either by running the executable once, or calling regsvr32.exe.

Steven H.
0 Kudos
Message 6 of 9
(3,767 Views)
I'm really sorry, but i still don't understand...
that's what i've done:

1) I created a program setValue.vi (which fill a array of clusters, each cluster contain a name and a corresponding value). The array is saved as a global variable.
2) I created a program getValue.vi which allow me to get one of this value (i give the name, and this program return me the corresponding value).
3) I created an exe (containing these two vi), i enabled the option server active x

I included the tlb in VB. But the only way of accessing the fonction getvalue from VB is to give the path of the corresponding vi...and this don't return me the correct value!

Do you have any example ?
0 Kudos
Message 7 of 9
(3,761 Views)
I think the key is to provide the correct path to the VI "inside" the executable. Take a look at this thread.

Steven H.
0 Kudos
Message 8 of 9
(3,747 Views)
YESSSSS!! Thanks a lot Steven, it works perfectly and that was exactly what i wanted to do....
(I think i didn't register the server properly yesterday) !

Thanks again....
0 Kudos
Message 9 of 9
(3,737 Views)