LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

One Button Dialog intermittently not displaying

Solved!
Go to solution

Has anyone encountered any instance where they've ran code containing a call to One Button Dialog.vi and not had the dialog box display?

I'm writing code at the moment that involves launching an actor "Example Communication Controller.lvclass". I've tried placing dialog calls in overridden instances of both "Pre Launch Init.vi" and "Actor Core.vi". In both cases, whenever I launch the actor the dialog box often does not appear. The code below shows my second attempt when I tried putting the call in "Example Communication Controller.lvclass:Actor Core.vi" (not done as a VI snippet since the VI snippet functionality is buggy).

 

Example Communication Controller Snapshot.png

I've rolled my own logging system and using that I find "Example Communication Controller starting!" is logged consistently whenever the actor is launched, whether or not the dialog box displays.

The flat sequence structure is temporary and just an attempt to see whether changing data dependencies has any effect.

 

0 Kudos
Message 1 of 5
(4,059 Views)
Solution
Accepted by topic author DavidFCannock

Bit of a long shot, but the one button dialog requires root loop. If something else is hogging the root loop, I could see this happening, although I'd expect the code to hang.

 

Easy test would be to replace the one button dialog with a three button dialog (See link for details).



CLA
https://www.prevas.se/expertis/test--regulatoriska-krav.html
Message 2 of 5
(4,032 Views)

@M_Peeker wrote:

Bit of a long shot, but the one button dialog requires root loop. If something else is hogging the root loop, I could see this happening, although I'd expect the code to hang.

 

Easy test would be to replace the one button dialog with a three button dialog (See link for details).


Thanks, you were right.

I replaced the one-button dialog with the three-button version and it works consistently. Now if only there were a one-button dialog that didn't run in the root loop... (I suppose if there's not a built-in one, I can just make a very simple non-reentrant VI to act as a dialog).

0 Kudos
Message 3 of 5
(4,028 Views)

Well, you can always create one yourself. Modifying the three button dialog for your needs would be one way, but the code is kind of messy so you might want to build your own.



CLA
https://www.prevas.se/expertis/test--regulatoriska-krav.html
0 Kudos
Message 4 of 5
(4,012 Views)

@M_Peeker wrote:

Well, you can always create one yourself. Modifying the three button dialog for your needs would be one way, but the code is kind of messy so you might want to build your own.


You weren't kidding - there's a fair bit of spaghetti in there. The logging framework I made has a few options for handling logs, one of which is to display them in a one button dialog box. Instead of trying to reverse engineer the three-button dialog code, I tried displaying the same message by sending it through the logging system.

Example Communication Controller Snapshot 2.png
In a config file, I've made it so that logs sent to "Example Communication Controller Logger" are displayed in dialog boxes. Interestingly, this works, although I'm not sure why. Internally, an actor is used to process log requests and maybe that adds enough of a delay that by the time the logging framework's call to "One Button Dialog.vi" is called, the root loop has freed up a bit more.

0 Kudos
Message 5 of 5
(3,996 Views)