04-12-2013 09:26 AM
I've been perusing the Advanced Architectures course manual to refresh myself on Event handling in LabVIEW. I ran across the Register for Event Callback function. When I went to LabVIEW to write some examples, I looked at the help file and ran across what seems to be a contradiction in its use. I was hoping someone could clear up my confusion.
The LabVIEW Help explicitly says to use this function ONLY for ActiveX and .NET event callbacks. The help says to use Event structures/Register for Events for other non-ActiveX/.NET Event handling. However, the course material makes use of this function for regular VI calls in LabVIEW. Which is correct? Can I use this function for non-ActiveX/.NET Event handling? Any help is appreciated.
04-12-2013 09:34 AM
I don't know why the help says to use it only for ActiveZ and .NET; I use it for other things and it seems to work fine.
04-12-2013 03:51 PM
That's what it seems like, not sure why that's in the help.
07-22-2015 05:26 AM
I read the same thing. But what's the difference at using case structure or event callback for ActiveX applications?
07-22-2015 08:27 AM
I think it's a design recommendation rather than a strict rule? If you have an event structure it makes the diagram clearer and easier to understand if you handle the events in the event structure - if you have them handled by a callback VI it isn't as obvious what's going on (and that's the whole point of a graphical language, right?!).
07-22-2015 09:43 AM
Members of NI close to R&D have stated that the use case of callbacks with User Events is supported and is used internally in several places. Why the help states otherwise I don't know. It could be filed as a documentation bug.
07-24-2015 03:09 AM
You are so right. But I asked because I have a problem in deciding which to use in my program.
I am automatizating a laser machine. I made a program for controlling MG17 motors also for the same computer.
But now I want to make a program only for the Laser using also ActiveX control.
The problem is that I can't make it work. I have a example in C#, that works fine, and I translated to labview, but I don't know how to debugged the program because I can only create my program in another computer, and then with an stand-alone executable used it in the other isolated computer connected to the laser.
Because I have no debugging ideas, I thought on start using first manual commands instead of waiting to receive events (laser is on, laser is waiting, laser stopped).
So instead of waiting of events I want to use buttons, which I will pressed simulating the events, in that case I should use case structures.
So then I get a little confused about the control of it, if I should wait for events triggered by reg event callback, or wait until a signal is introduced in a case structure.
Any ideas or suggestions?