LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why does "open vi reference" wait for "mouse up"?

Hello,

I need to dynamically load a reentrant subvi as soon as the user hit's a button. I'm using an event structure which I dynamically register for processing a "value change" event. Inside the even structure I placed an "open vi reference" vi. I set it's options to "8" to prepare the subvi for reentrant run and the program steps into the event case as expected. The problem is, that "open vi reference" doesn't execute before the mouse button is released.

Is there any possibility to get "open vi reference" to execute while the mouse button is still pressed? (lock front panel... is disabled, "mouse down" event doesn't work either, static vi reference is not possible because I need several instances of the subvi).

Any idea would be welcome.

Thanks in advance,
C. Halbgewachs
Message 1 of 21
(3,260 Views)
Check the mechanical action of your button. Possibly, it is set to "switch/latch when released" instead of "...when pressed". 🙂
0 Kudos
Message 2 of 21
(3,249 Views)
Thanks for the fast response!

The switch is set to "switch until released" because I need to process the release as well. And I don't think this is the problem because the program enters the event case and starts waiting when reaching the "open vi reference" vi. Please let me know in case I'm wrong.

Kind regards
C. Halbgewachs
0 Kudos
Message 3 of 21
(3,252 Views)
Your problem has nothing to do with open vi reference. As Altenbach says, the problem is the mechanical action of the switch. The event will not process a value change event until it actually sees a value change and the mechanical action of the switch does not send a value change until it is released.
0 Kudos
Message 4 of 21
(3,242 Views)
is there a loop in the sub vi?
is there an event case in the sub vi?

when you use the run VI method, make sure the "Wait Until Done" is false.

-Joe
0 Kudos
Message 5 of 21
(3,230 Views)
There is something strange here, that has the smell of a bug...
The mouse down event is detected as soon as the event occurs, but the corresponding case is NOT processed entirely if the mouse button is kept pressed.
Most operations are immediately executed, EXCEPT the Open vi ref, or the File dialog vi, and probably some others...
For the File Dialog, this is normal, since a dialog window has to be opened (interaction with the operator) while the operator is still acting on the button.
But that's not normal for the Open vi ref.
First I thought that this hads something to do with file management or disk access. Wrong : Files are opened and read immediately.

The attached vi demonstrate this strange behaviour.

Enjoy !
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 6 of 21
(3,226 Views)
I just forgot to tell you that before running the vi, you have to feed the file path controls with 2 valid file paths: one vi for the open vi ref, and one txt file. Otherwise you will get annoying dialog boxes

CC
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 7 of 21
(3,217 Views)
Open VI Reference doesn't work when the UI thread is busy e.g. modal window, menu drop, etc. I think you can add "mouse down" to the list. That's annoying. For some internal reasons, Open VI Reference must be done in the UI thread.


LabVIEW, C'est LabVIEW

Message 8 of 21
(3,197 Views)
Hi, thanks you all for replying!

No, there are no event cases or loops inside the subvi, and "wait until done" is set to "false" for the "runvi" method. The only thing the subvi does is obtain an existing queue, wait for data in this queue (with timeout) and reset some controls by reference afterwards.

My vi shows exactly the behavior that the "Event Bug ?.vi" from chilly charly shows. I thought of a bug too, but if Jean-Pierre's right..

Does anybody have an idea for a workaround? Is there another possibility to get a vi reference (static vi reference isn't possible as I said before)?

Thanks in advance,
Clemens
0 Kudos
Message 9 of 21
(3,079 Views)
I did not try this method myself, but it may work.

Do not use the event structure to capture the mouse clicks. You can get a mouse.vi from here . put this vi in the timeout case in the event structure (make sure wire a number to the timeout value). Compare the mouse state when the cursor is whithin the control boundary.

-Joe
0 Kudos
Message 10 of 21
(3,051 Views)