LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Keep Focus between subpanel & Main without using Mouse

Hello,

 

In my application, I have an arrangement of One VI as main & subpanel on it to dynamically call other vis onto the subpanel by using hot keys F2-F7 or by using mouse on the button.

 

Main VI have One event structure to dynamically call other vis, & loading onto subpanel of this main.secondly have Timed loop to do some other functionalities.

 

The VI loaded onto the subpanel have tab control with four pages each having list box control with set of options to handle. Without using mouse (I need to use only keyboard for operations.) I can do maneuvering between tab pages & controls inside it. But when I try to come back to the main vi by using Hot key (e.g. F7 ), no event is fired (where I have a coding to remove the current vi on the subpanel & show main).

but timed loop is functioning. I can see by probing.

 

Regards,

Kousy

0 Kudos
Message 1 of 17
(4,223 Views)

Hi Kousy,

It sounds like maybe your event structure is not setup appropriately.  I have attached an 8.2 example VI that shows the scan codes when keys are pressed.  If you press F7 you indeed get an event along with the correct scan code.  Hope that helps.

Brian K.
Message 2 of 17
(4,200 Views)

Hello Brian,

I could not open your attachment. I have LV 8 version. Why dont you save it in LV 8 & send back.

 

Thanks

Kousy

 

0 Kudos
Message 3 of 17
(4,197 Views)
Hi Kousy,
Here is the example in LabVIEW 8.0.
Brian K.
Message 4 of 17
(4,184 Views)

Hello Brian,

 

I checked my event structure code introducing scan code functionality. It is working ok only.

 

But I have a doubt.

I used Pageselvisible property of tab control, to make  the tab pages  active or the controls inside it. Also I used the keyfocus property of the control inside the tab page to make it active as long as I was there in the page. Is there any problem by keeping focus of the control inside the active tab page of subpanel vi while pressing F7 (i.e. When I try to come out of this mode and back to Main)  hotkey to remove subpanel vi & come to Main?

 

Regards,

Kousy

0 Kudos
Message 5 of 17
(4,143 Views)

Hi Kousy,

I have not seen any documentation about that subject.  When you say that it works OK, what do you mean (does it simulate a F7 stroke)?

Brian K.
Message 6 of 17
(4,127 Views)

Hi,

That means when I press F7, scan code value is changing. I understand then Event structure is working. But the code relevant to the value change event of F7 button is not firing. What I suspect is forcibly I only tried to keep the focus inside the controls of the subpanel vi prevents it firing.

Regards,

Kousy

0 Kudos
Message 7 of 17
(4,118 Views)

hi Kousy,

If U mean to say that, when U press F7 & that Event is getting fired, U really mean that it is perfectly working. Why not try using the VKey instead of the ScanCode variable ?

See my att VI n put Ur code into the F7 case to work properly.

Maybe the problem lies in the VI having the sub-panel, if it is having another Event Structure inside it to execute some other code, ve I unserstood Ur query correctly... ?! Smiley Wink

- Partha ( CLD until Oct 2027 🙂 )
Message 8 of 17
(4,113 Views)

Another quick example...

Choose the VI thro' the path control before running the att VI !

I think that this VI fits Ur requirement like a T Smiley Wink

In LV 7.1

- Partha ( CLD until Oct 2027 🙂 )
Message 9 of 17
(4,110 Views)
 
Hello Partha,
 
Great. This works fine.
 
In Main vi I used F2 thru F10 function keys to call different vis to load onto subpanel. But I never thought to place the code inside keydown functionality in Event structure of Main vi. I used to put the code inside the value change event for Each button. Leant to code better way. Thanks once again.
 
Regards,
Kousy
0 Kudos
Message 10 of 17
(4,094 Views)