LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I realize if an EventCallBack has finished?

Hello everybody,
    I have a programm where I'm communicating with a OCX. This OCX retruns me an event when the user press a buttom on a device. This is the first time I use the "RegisterEventCallBack function" and there's something I don't see clear. I connect the Event input into the OCX reference and I create a Callback VI. I understand this works like a interruption, everytime this event occurres the code inside this Callback VI will execute. Unfortunately this RegisterEventCallBack function doesn't return the string that my event returns. Now I've created a Global variable and copy the value of the string there. I wait in a Loop until this variable is different to "empty string" and then I can go on executing my program. In this way I can run my program but it doesn't like an elegant way to do this. Some idea? All the exemples shipped into LaVIEW 7.1 that work with events, make some stuff in Excel, like filling some rows, but no value from Excel is returned to the main appliacation. How can I get this?
 
thanks in advance,
 
Mackemann
0 Kudos
Message 1 of 3
(2,472 Views)
hi there
 
please, don't use any global variables.... really...
 
well, the most efficient way is to fire an event inside your callback - vi and catch that event somewhere else. i attached an example using the ValueChanged - event of a control and User Events. you can use occurences or any of the synchronization VIs instead.
 
 
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
Message 2 of 3
(2,464 Views)

Hi Chrisger,

     thanks a lot for youyr example, now it's working without using global variables!

Mackemann

0 Kudos
Message 3 of 3
(2,447 Views)