LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Seeming Contradiction Using Register for Event Callback...

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.

--------------------------------------------------

Nathan - Certified LabVIEW Developer
0 Kudos
Message 1 of 7
(2,894 Views)

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.

0 Kudos
Message 2 of 7
(2,892 Views)

That's what it seems like, not sure why that's in the help.

--------------------------------------------------

Nathan - Certified LabVIEW Developer
0 Kudos
Message 3 of 7
(2,874 Views)

I read the same thing. But what's the difference at using case structure or event callback for ActiveX applications?

0 Kudos
Message 4 of 7
(2,724 Views)

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?!).


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 5 of 7
(2,701 Views)

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.

0 Kudos
Message 6 of 7
(2,682 Views)

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?

0 Kudos
Message 7 of 7
(2,651 Views)