LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open subVI with F- button

Solved!
Go to solution

Hello All,

 

I need to open subVi in VI with F- button on keybord.

This subVi will be some settings, so it should be opened on F- command.

 

Can someone advise how to do this?

 

Thank you.

0 Kudos
Message 1 of 8
(2,413 Views)
Solution
Accepted by topic author milan87

Hi milan,

 

are you talking about the <F> key on your keyboard? Or are you talking about any of those F1-F12 "function" keys?

 

Options:

- for function keys you can set a key navigation for a button on your frontpanel to toggle. Then use an event structure or a simple case structure when the button is toggled…

- for any (other) key you can use an event structure to catch all key press events in the front panel: just check if the <F> key is pressed, then call your subVI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(2,382 Views)

Thanks Gerd, that works.

 

But now I have problem to open subVI… Button react, but VI is not opened.1.PNG

0 Kudos
Message 3 of 8
(2,356 Views)

Hi milan,

 


@milan87 wrote:

Thanks Gerd, that works.

But now I have problem to open subVI… Button react, but VI is not opened.


So there is a problem in your VIs. Did you try to debug your VIs?

Do you get any error on the RunVI method? Is the subVI started? Did you set the VI properties of the subVI to show its frontpanel when called?

 

General advice:

We cannot debug images with LabVIEW. When you have problems with your VI(s) then you should attach them!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(2,349 Views)

Hello again,

 

i manage to open VI by clicking on button, but in development environment. Problem is when I create .exe, then VI cannot open that ''config'' VI from main VI. 

I changed path for VI, to find application reference, but still unable to open...

In attachment there are all subVIs...

If someone could advise, how to solve this?

 

''Config'' VI is used to read and write data in ''config1.ini''...

 

 

 

0 Kudos
Message 5 of 8
(2,303 Views)

@milan87 wrote:

Hello again,

 

i manage to open VI by clicking on button, but in development environment. Problem is when I create .exe, then VI cannot open that ''config'' VI from main VI. 

 

 

When you compile into an .exe the compiler doesn't know that you're referencing that file, and you need to include it in the "always include" section. Also, the path changes, so that path constant needs to be handled. A better alternative is to use a VI ref constant to that file and use the name or path property. That way the compiler know you need it in the .exe and the path is automatically corrected.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 8
(2,274 Views)

Hello All, 

 

one more question regarding this topic...

 

Button works normaly by pressing F5 on keyboard.

 

Next, I would like to hide that button, but to keep command on F5.

When I hide button, I cannot call it by pressing F5.

Can antone sugest solution for this?

 

Thank you.

 

 

0 Kudos
Message 7 of 8
(2,253 Views)

Hi milan,

 

instead of hiding the button you could disable it…

 

Other option: catch all key press events for the frontpanel and check if it was F5…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(2,245 Views)