Jump to content

External code to act on a LabVIEW ActiveX event


Recommended Posts

Hi folks,

Are there any examples showing how to write a LabVIEW executable which can act as an ActiveX Automation Server and support event callbacks from other languages ? e.g. within say a C# or .NET program, I want to do the reverse of what you see in the LabVIEW example here:

C:\Program Files\National Instruments\LabVIEW 8.6\examples\comm\axevent.llb\ActiveX Event Callback for Excel.vi

I would like an external client's callback code (accessing my LabVIEW ActiveX automation server) to be executed when I programmatically initiate the event from my LabVIEW code

regards

Peter

Link to comment

OK, so rewording my situation and question.

I have a LabVIEW program with ActiveX Server enabled. Properties and methods can be accessed fine from other programming languages. (specifically a C scripting language used by Test Complete).

How do I fire an ActiveX event from the LabVIEW side which subsequently will cause some callback code to run in the other language.

Essentially I want to do the reverse of what you see in the LabVIEW example here:

C:\Program Files\National Instruments\LabVIEW 8.6\examples\comm\axevent.llb\ActiveX Event Callback for Excel.vi

So instead of the NewWorkbook event coming from Excel causing "NewWorkbookCallback.vi" to run , I will be (programatically) firing my_own_custom_event from my vi causing some code to run in the other language.

regards

Peter Badcock

Product Development

ResMed Ltd

Link to comment

Perhaps what I am trying to do is not possible.

If one opens up the example I referred to at [2] , Right Click on the Automation refnum constant and "Select ActiveX Class" "Browse" and navigate to the type library file (*.tlb) created by the LabVIEW Application Builder (for a particular EXE you create - mine is named HelloWorld), you will find it only contains properties and methods - it does NOT contain events.

post-1272-126343731431_thumb.png

Is that a limitation of LabVIEW ? Can LabVIEW not export events into type libraries ? (at least that is what is suggested in the help file [1]).

I don't want to register for events from other applications, I want to register for events from a LabVIEW application (albeit eventually from another programming environment). I cannot seem to build a LabVIEW application which exports events into its type library.

regards

Peter Badcock

Product Development

ResMed Ltd

[1]

Enable ActiveX server
—(Windows)
so the application can respond to requests from ActiveX clients. The functionality of the ActiveX server in the application is a subset of the LabVIEW ActiveX server. When you build an application myapp.exe, Application Builder also creates an ActiveX type library myapp.tlb. The type library defines an application class and a virtual instrument class and exports both Application
and
and VI
and
. When you distribute the application, include the type library with the executable file.

[2] C:\Program Files\National Instruments\LabVIEW 8.6\examples\comm\axevent.llb\ActiveX Event Callback for Excel.vi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.