LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does Open VI Ref wait for One Button Dialog?

I came across this problem and made 2 simple VIs to make sure my assumptions are correct.  If I have the one VI popup a One Button Dialog and the other VI trying to do Open VI Ref, the Open VI Ref does not finish until the dialog is closed.  Why is this and what can I do to solve it?  I am using Labview 7.11.
0 Kudos
Message 1 of 7
(3,870 Views)
Hi Christie,

I am not entirely sure why this happens but I have reproduced it in LabVIEW 8.20 aswell. A simple work around though is to replace the One Button Dialog function with a subVI that opens the front panel when called and is set to look like a dialog box.

Regards

JonB
Applications Engineer
NIUK & Ireland
0 Kudos
Message 2 of 7
(3,855 Views)

Lets see if I can help out with the "WHY" part of this question.

LV support multi-threading (which allows more than one thing to happen aht the same time).

For the most part LV takes cae of all of the deatils to make that happen without effort on our parts.

THere are some things that have to be "handled delicately" (Wicked Witch of the West, Wizard of Oz)

Examples of these include the loading and unloading of VI. The "Delicate operations" that could blow-up in multi-threading are implemented in the UI Thread. IN LV the UI THread is single-threaded (only one thing can happen at a time) . This makes sure you do not have conflicts.

Opening a VI is handled in the UI thread.

Modal dialogs (like the one button dialog) also run in the UI thread.

So the previously suggested work-around is a "work-around" because the VI is not modoal.

I hope this helps,

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 7
(3,847 Views)
And moreover the one button dialog is not event driven. It just polls the GUI (watch your CPU usage go skyhigh) Smiley Sad

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 4 of 7
(3,832 Views)
Hi Ben,

I aggree with most of what you say and it's pretty much what I thought when I came across the issue. However, I'm not sure it is just to do with modality, as when I implemented the work around I set the VI Appearance to be Dialog, which sets the VI to be modal.

As to the actual problem this was reported to R&D (42B4G9OZ CAR ID) for further investigation.

Also Ton,

The One Button Dialog should not countinously poll the GUI. On an 800Mhz P3 with about 20 dialog boxes (LV 7.0)  LabVIEW.exe CPU usage only went above zero when generating and closing the dialog boxes and even then only a few percent. Do you get this when you just use the function on its own in a blank VI?

Regards

JonB
Applications Engineer
NIUK & Ireland
0 Kudos
Message 5 of 7
(3,818 Views)

Hi Jon,

If this is a bug, it is a bug that goes back to LV 6.1 or earlier.

I have had to write my own dialogs going back at least that far when I wanted to keep background stuff going.

My mention of "modal" may be wrong. (if the documentation.... don't go there Ben!) Smiley Mad

I still believe the dialogs run in the UI thread.

I hope to hear back on this issue and learn something in the process!

Thank you,

Ben

PS Jon wrote "As to the actual problem this was reported to R&D (42B4G9OZ CAR ID) for further investigation. "

What exactly is the nature of that CAR so I can post it to our bug thread?

Message Edited by Ben on 10-12-2006 09:28 AM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 7
(3,812 Views)

Thank you for the replies.

I made a VI that pops up a number of dialog boxes and my CPU usage was around 0 also.

I had a hunch that it was something in that line.  I have actually considered replacing all Labview dialogs with my own dialogs because they always pop up on the wrong screen/wrong place.  That means that they have to be reentrant, which caused me some problems.  Has anyone written a reentrant dialog?

Christie

0 Kudos
Message 7 of 7
(3,774 Views)