06-14-2011 06:10 AM
I have an annoying bug with dynamically opening and running a VI.
The VI below is compiled to a DLL:
With this I open a secondary VI to display results. That VI is called repeatedly in a loop. It works fine, but I was annoyed with the flickering of the menu bar and toolbar. Therefore I added the "FP.ShowMenuBar" and "TB.Visible" to hide those. This causes the front panel window to jump up and down on my screen. Is this a known bug (I presume it is) and is there a work-around?
Another minor annoyance is that opening the front panel, closing it, and then opening it again causes the front panel to be opened in the background, and I have to manually move it to the foreground. I thought it could be remedied by adding "FP.IsFrontmost", but it does nothing.
Solved! Go to Solution.
06-20-2011 12:08 PM
OK, I made the VI reentrant and added the "Prepare for reentrant run" option to the "Open VI Reference" box. That made the VI open as a clone and stopped the flickering of menu and toolbar.
As an added bonus the CPU load dropped significantly. (But I don't see why.)
Haven't figured out the front panel positioning annoyance yet, though.
06-20-2011 12:14 PM
Why would you repeatedly open a VI in a loop?
Why would compile that code into a .dll?
06-20-2011 12:26 PM
I open it once, then I call it repeatedly, using this VI:
(I'm not using a global variable for the reference anymore, I send the reference in the function call.)
I compile this to a DLL because that's the only way (that I know of) I can open and execute a VI from an external programme.