Showing results for 
Search instead for 
Did you mean: 

Get AvtiveX callback data to main program in LabVIEW 7.0

I just upgraded to 7.0 and am trying to use the new ActiveX event structure. I have a call-back .vi that works, but what is the best way to get the event data back to my main program so I can use it? Right now I wired in a control reference as user data and inside the callback wired value(signaling) to this control. Then in my main program I set my event to look for that control being changed. However, I noticed that the sometimes I am getting empty results in the main progam's event structure when the data is allways good inside the callback .vi. Is there a more direct way to have the callback .vi trigger an event in the main aplication?
0 Kudos
Message 1 of 3
I recommend taking a look at the ActiveX event shipping examples. ActiveX Event Callback for shows an event that passes data back into LabVIEW.

I cannot explain the occasionally empty data you are seeing. It is my gut feeling that there is a race condition and the control gets read before it is updated. You may need to add a delay or perhaps use even more fancy event coding (user events or the value(signaling) property) to update the value when it changes.

Your posted code is not executable and has a lot of extra stuff. It would be more helpful if you stripped it to the bare essentials.
0 Kudos
Message 2 of 3
To all who are interested, I have answered my own question.

Intestead of changing an control value inside the, I use wire a user event into the callback and then generate the user event. The main event handler will then handle the event (in this case the user data for the user event is a reference to the ActiveX control) and the data I am interested in can be read flawlessly.
0 Kudos
Message 3 of 3