08-13-2012 06:04 PM - edited 08-13-2012 06:09 PM
Hi All,
I am registered for several ActiveX events from a camera SDK (ActiveDcam from A&BSoft)
The problem is this: I'm moving the mouse over the control. So, MouseMove is firing.
I click, so MouseDown fires OK.
The mouse is still moving.
MouseUp should fire when I release the mouse button - it does not.
It DOES work when I make a stationary click. i.e. if the mouse is at rest, THEN I click and have MouseDown fire. Then it doesn't matter if the mouse is moving or not, mouseUp gets called.
So the problem only happens when the mouse is moving when MouseDown fires.
This isn't an SDK problem, as the same code works as expected in VB. I can't share the SDK, sadly, it costs money. But if it helps, I've attached the offending code (really simple).
Basically, I'm allowing the user to draw a rectangle on the image, using some global variables (and lets not get into a discussion about that - I've tried implementing everything by reference and it's much messier). It works fine, except if the user's moving the mouse when s/he clicks - then, since MouseUp never gets called, the rectangle never enters "persistent" mode i.e. that it displays statically on all acquired frames. My "Keep On Screen" variable controls this behavior.
Thanks for any help... Not sure if this is a LV bug or if I'm doing something silly.
08-13-2012 06:17 PM
The only thing I can think that's happening is that closely-spaced read/writes of global variables is causing internal labview confusion... but I'm not sure replacing them by calls by reference would be better...I'lll try it .
Here's the other callback VIs attached, if it helps...
08-14-2012 05:15 PM
Hi pobrepablo1,
Did replacing the global variables with Call by Reference Nodes help? Its possible that closely-spaced read/writes of global variables could cause your VI to create race conditions. Let me know if this modifaction had any impact.
Kaitlin N.
Applications Engineering
National Instruments
08-14-2012 06:32 PM - edited 08-14-2012 06:33 PM
The VIs are a good deal less readable now, but no, it did not solve the issue. MouseUp still doesn't fire when the cursor has an " initial velocity," so to speak.
08-14-2012 07:01 PM
I really feel this might be a LV bug. Even if there are race conditions, the event should still fire - it shouldn't depend on what my variables are doing.
08-15-2012 05:07 PM
Hi pobrepablo1,
Unfortunately we don't have a great way to simulate this problem, given that we don't have the Camera SDK. Although the code works as expected in VB there still could be an issue with the SDK relating with activeX.
Are you trying to draw this rectangle in LabVIEW or on an image in an external program? Also have you tried importing the image into LabVIEW and then using the event handlers from LabVIEW?