ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

return from subVI

I have a main VI that calls a subVI we'll call A, A in turn calls another subVI lets call B.  My problem is that after B is closed upon return to A, It does not have control, no buttons work.  I have mocked this up in a stripped down version of Main, A, and  B and it works just fine, but in my functioning VI's it will not work. B will close just fine but somewhere A no longer has control.
 
I am using the ICONs of the subVI's in an event structure, have set the subVI Node Setup to "Show front panel when called" and "Close afterwards if originally closed".
 
I have also tried the more arduous task of using the VI methods FP.OPEN and Run Vi.  This doesn't seem to work either, I get the same results.
 
Anyone have any ideas of what to check?  I have done this numerous times with a main calling a subVI and had no problems.  I have recently changed to LV 8.5 and wondering if there is something I'm missing.  Will having VI B Modal effect things?
 
LV 8.5 on XP SP2
 
Thanks,
goldie
 
I've attached the stripped down versions to explain what I'm doing, as I said they work fine, I just cant get my production versions to cooperate.
 
 
0 Kudos
Message 1 of 14
(3,945 Views)
Goldie,

i haven't checked your attachement but i hope i already have the correct suspicion 🙂
I asume that you are talking about "focus" when saying "control". You can, at the end of B, set the property "FP.Open" from B to false and therefore, the OS will automatically focus the last active window.

hope this helps,
Norbert

Message Edited by Norbert B on 11-29-2007 10:06 AM
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 14
(3,935 Views)

Norbert,

Thanks

0 Kudos
Message 3 of 14
(3,929 Views)

Norbert,

Thanks for

0 Kudos
Message 4 of 14
(3,929 Views)

Internet explorer just freaked on me....

Norbert,

Thanks for the reply.  I have tried both the FP.open = false and Abort VI at the close of B with the same results.  Subvi "A" will NOT regain focus/control, very frusterpating.  Especially when I can get a prototype to work.

 

0 Kudos
Message 5 of 14
(3,921 Views)
A short example.....


hope this helps,
Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 14
(3,915 Views)
Not really!   I understand what you have done, I have tried the FP.OPEN = FALSE but it doesn't affect my problem.   I am guessing that the VI settings have something to do with it, but I am grasping for straws.  I need the subVI (B) to be modal to avoid being hidden behind the main VI, but when I tried making my prototype modal it didn't cause any havoc with it.
 
Still searching...
 
~goldie
0 Kudos
Message 7 of 14
(3,909 Views)
Goldie,


in your application, SubVI A should get the focus when B finishes, but it does not. Is that correct?
So, as i understand it, the attached example from does what it should. Correct?

Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 8 of 14
(3,901 Views)
I believe that I had a similar problem with my latest program.  I discovered that if I had a modal, or floating with hide window when LabView not frontmost selected; dialog open, and I used the time/date button on my timestamp control, when the timestamp window was closed, my program would no longer have focus, even though the dialog was still opened.  In the end I needed to just use the dialog with the normal window settings.  I think it might have to do with the hiding modals and floatings confusing LabView as to what has focus really.  Similar to how if you accidently have a modal dialog open when you start your VI, you can't do anything because the modal pulls focus to itself even when not running.
Jon D
Certified LabVIEW Developer.
0 Kudos
Message 9 of 14
(3,894 Views)

Yes thats exactly right.  My posted example works just as I desire my production version (as did yours).  However, for some reason which I have failed to discover, when subVI B closes, the focus appears to return to A (it does visually) but not functionally, none of the front panel buttons are selectable.

I have tried a FP.OPEN of A when I close B.

I have tried a FP.open of A  when B completes

I have tried a combination of the two.

I have tried a VI.ABORT at the finish of B.

I must be missing some small detail.  I have no problem in my scaled down prototype but my production version will just not cooperate.  The Joy of programming !!

Thanks again for your time

~Goldie

0 Kudos
Message 10 of 14
(3,890 Views)