12-01-2015 07:46 AM - edited 12-01-2015 07:47 AM
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).
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.
Solved! Go to Solution.
12-01-2015 08:36 AM
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).
12-01-2015 08:52 AM - edited 12-01-2015 08:54 AM
@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).
12-01-2015 09:01 AM
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.
12-01-2015 09:44 AM
@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.
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.