LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Handling LabView events in ActiveX

Hi all,

I know most ActiveX discussion here is about getting ActiveX to work inside of LabView, but I'm trying to go the other way around.

General Question:
How to I catch or listen to events generated by LabView (in VB or whatever)? And is there some kind of library of LabView ActiveX events?

More specific:
If anyone has ever used the Jacob libraries for using ActiveX from Java, how would I create a LabView event listener from within Java? I can create a VI ActiveXComponent, but I don't know how to use it to listen to events.

Any help on either part of the question will be most appreciated!
Thanks,
Sam
0 Kudos
Message 1 of 10
(3,948 Views)
(bump --- hope that's ok)

I'm quite sure that catching ActiveX events generated by LabView is possible -- in the DevZone website they say "LabVIEW introduced support for ActiveX events via automation and ActiveX controls embedded in containers. ActiveX events allow programmers be notified of a specific occurrence and then act accordingly."

However, looking through these archives I can't find any examples of this happening. Does anyone have any ideas?

Any help still very much appreciated!

Sam

Message Edited by SamF on 03-29-2007 08:20 AM

0 Kudos
Message 2 of 10
(3,938 Views)

"SamF" <x@no.email> wrote in message news:1175175608735-499383@exchange.ni.com...
(bump --- hope that's ok)I'm quite sure that catching ActiveX events generated by LabView is possible -- in the DevZone website they say "LabVIEW introduced support for ActiveX events via automation and
ActiveX controls embedded in containers. ActiveX events allow
programmers be notified of a specific occurrence and then act
accordingly."However, looking through these archives I can't find any examples of this happening. Does anyone have any ideas?Any help still very much appreciated!SamMessage Edited by SamF on 03-29-2007 08:20 AM



The quoted text doesn't imply that LabVIEW activeX controls can communicate through events. It probably means that LabVIEW can catch ActiveX events by means of automation and embedded containers.


I don't think there is a way to build an activex control in LabVIEW that actually sends events. I am sure that LabVIEW events are something completelly different then activex events. Perhaps there is a way to get it done, but not by sending regular LabVIEW events.


Sorry, it doesn't help.


Wiebe.
0 Kudos
Message 3 of 10
(3,924 Views)

Hi Sam,

I hope you are doing well today! Here are some examples I was able to find by searching through DevZone.
Calling a LabVIEW VI from Visual Basic through ActiveX

 
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 4 of 10
(3,921 Views)
Thanks for both of your replies,

I'm pretty certain that it is possible to generate ActiveX events from LabView, but unfortunately those links don't deal with events. Those are what I used to get to where I am -- opening and running a VI from ActiveX -- but I can't find anything on generating events.

If it really seems as though there is no way for LabView to generate ActiveX events (or just catch those that are automatically generated), then I have another question: Is it possible to use LabView to catch its events internally (using it's own events methods), and write to, say, an excel file everytime an event is generated?

My thinking is that even if LabView doesn't throw events, other programs such as Excel do, and so if the events were routed through Excel I could catch *those* events.

(BTW, I know there are examples of writing to Excel, but I'm looking for something that is *event* driven).

Any help either on catching LabView events or using LabView events to write to an MS program will be much appreciated, as always!
Thanks,
Sam
0 Kudos
Message 5 of 10
(3,917 Views)

"SamF" <x@no.email> wrote in message news:1175184612989-499526@exchange.ni.com...
Thanks for both of your replies, I'm pretty certain that it is possible to generate ActiveX events from LabView, but unfortunately those links don't deal with events. Those are what I used to get to where I am -- opening and running a VI from ActiveX -- but I can't find anything on generating events.If it really seems as though there is no way for LabView to generate ActiveX events (or just catch those that are automatically generated), then I have another question: Is it possible to use LabView to catch its events internally (using it's own events methods), and write to, say, an excel file everytime an event is generated?My thinking is that even if LabView doesn't throw events, other programs such as Excel do, and so if the events were routed through Excel I could catch *those* events.(BTW, I know there are examples of writing to Excel, but I'm looking for something that is *event* driven).Any help either on catching LabView events or using LabView events to write to an MS program will be much appreciated, as always!Thanks,Sam



Sure it's possible to build an activex server. No doubt about that.


If I where to communicate events between the LabVIEW code and another language, I'd think about occurrences or windows events.


There is documentation available about occurrence communication between dll's, cin's and LabVIEW. Never used it, so I can't help you much further.


The windows events are well documented in the msdn. They should be available in any language, though relatively simple api calls.


And you can always use window messages. If you have a window handler of the main program available in LabVIEW, you can use sendmessage or postmessage to communicate to it. The other way around is more difficult, but seems not necessary.


Hope it helps,


Wiebe.
0 Kudos
Message 6 of 10
(3,909 Views)
So I'm afraid I wasn't able to use to posts above to help.

Does anyone have any examples of catching LabVIEW events in, say, VisualBasic? Or any tips on how to do this?

Any help would still be most appreciated.

Thanks!
Sam
0 Kudos
Message 7 of 10
(3,847 Views)
Have anyone managed to trigger events from LabVIEW exe which is an activex server and catch it through a call back function in vb or any other environment?
Any help is greatly appreciated.
0 Kudos
Message 8 of 10
(3,236 Views)

This is a death end. LabVIEW events are internally implemented in LabVIEW and can not be hooked externally with any documented interface. The only thing you can do is hooking the Windows messages that are sent to each window and which LabVIEW then translates into its own events, but nothing else.

 

You will have to create a deamon in LabVIEW that intercepts the events you are interested in or that your application sends them too explicitedly and have your external application subscribe to that deamon (any InterApplication Communication means is fine) so it can send those events to your external application. 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 9 of 10
(3,221 Views)

Dear Rolf Kalbermatter,

 

Thank you very much for your reply.

While I try to digest and check out the idea you suggested, let me also explain my situation briefly here:

 

I am developing a tester platform in LabVIEW (currently in LV2013 sp1). My application needs to interact with a machine handler application that is done in Visual Studio.net. In order to enable interaction between the applications, I have to create an interface in my application and open up for the other application to consume.

I have tried out the ActiveX mechanism in LabVIEW and successfully able to access the method (sub VI) within an EXE compiled in LabVIEW from a VB.net application.

 

Now in order to fulfill the requirement laidout to me I need to create events (for example 'Test End' event or 'Measurements Ready' event) from my application for which the other application can subscribe to.

If anyone has done something like this before using any method, it will be very very helpful for me as I am quite new to these advanced stuff.

 

Thank you !

Pradeep K E

0 Kudos
Message 10 of 10
(3,194 Views)