How can i use labview.tlb to control Labview from an external application?


I've been told by a labview engineer that i could use the file
labview.tlb located in the labview install folder to control labview
from an external application (in my case, a C# app). I'm using Labview
6.1 under Windows 2000. This article confirms that:

"ActiveX and LabVIEW"

But i've not been able to find out how to use this file to achieve
what i want. I just want to be able to open/close labview, open/close
a vi, start/stop a vi, hide/show a vi from a C# application. The above
web page talks about activex but i really don't see the realtion
between activex and that labview.tlb file.

Is there somebody around who knows how to use that file? Why does NI
tell us that it's possible to do what i want to do but doesn't explain
how (or hides this info very well)?

11/25/2003 4:26:58 PM
comp.lang.labview 35213 articles. 1 followers. vasusachin24 (1) is leader. Post Follow

2 Replies

Similar Articles

[PageSpeed] 12

Hi I am fighting a similar problem and so far I found this: Calling
LabVIEW from C++ Using ActiveX

x9561 (148441)
11/25/2003 4:42:25 PM

> Hi I am fighting a similar problem and so far I found this: Calling
> LabVIEW from C++ Using ActiveX
> http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?>p_guid=B45EACE3E21356A4E034080020E74861&p_node=DZ52051&p_submitted=N&p_rank=&p>_answer=&p_source=External

Thanks for the link, i actually already found this link before. I've
found yesterday how to use Labview.tlb, just add it to the references
of the project, it was probably too easy for me at that time:-) But
now, i'm still stuck as there is no doc about using the interfaces and
classes of this activex to control labview.

The example given on your link is made is C++ and for some reasons,
the wrapper generated for Labview.tlb when i added it to my c# project
doesn't seem to expose the same interfaces and classes as the one used
in the C++ example. I therefore can't use the C++ example in C#.

I've tried to do something like:
LabVIEW.ApplicationClass a = new LabVIEW.ApplicationClass();

Just this line causes labview to launch but then immediately throws an
exception: "Query interface for interface LabVIEW._IApplication

Does somebody knows how to use that control in C#/VB.NET ?
11/26/2003 12:29:53 PM