05-27-2020 03:29 AM
Dear LabView Community,
I have an issue regarding the opening of the SubVi from my frontpanel. I searched for online solution but could not find any.
My issue is that if I want to open the Subvi front panel with a button on the main Front panel, it activates the button but does not open the front panel. However, if I activate the button before I start the Programm, it opens perfectly fine as soon as I start the programm.
Does anyone know how to solve this issue with that brief description? I am sure it is only a small setup problem but I can't find it myself.
Thank you in advance,
-P
Solved! Go to Solution.
05-27-2020 07:27 AM
05-27-2020 08:59 AM
Here is the Code. I had to shorten it a bit, but the issue is still the same. Thanks for your help.
Best
-P
05-27-2020 09:44 AM
05-27-2020 10:17 AM
You'd be far better off with an Event Structure for handling the button push events. That way you know you'll only ever be dealing with one event at a time. With your code as it is, both the button push case structures could be running in parallel. You can then share information (for example, a "module is operational" flag) between the cases using shift registers.
PsyenceFact
05-28-2020 03:29 AM
Thanks for your quick response.
The VI I uploaded has the VIs included and shows the exact problem I have when running it. Does it not work for you?
I can not upload everything because it consists partly of a bought software, so this must do...
The options you show are the same I have in the code.
05-28-2020 04:03 AM
@Rehp wrote:
Thanks for your quick response.
The VI I uploaded has the VIs included and shows the exact problem I have when running it. Does it not work for you?
I can not upload everything because it consists partly of a bought software, so this must do...
The options you show are the same I have in the code.
No, it does not work, because (I guess) nobody else has the SubVIs that You want to open in Your code.
I guess You are trying to dynamically open the Frontpanel of another VI from within Your VI. This can be done using the VI Server. Static VI references have a method that does exactly what You want: https://labviewwiki.org/wiki/VI_class/Front_Panel.Open_method . It is even named exactly like You would expect.
I want to stress the advice given to use event structures. There are still a few days left on the free introductory courses at https://learn.ni.com/training if You are not comfortable with using them.
05-28-2020 04:14 AM
Hi,
The test.vi calls two sub-vis (Initialize and SLpro_CTA-P7) but their code is not included. It is not possible to open them if we don't have all the [file].vi .
Which VI do you want to open when called ? Which button do you push to do so ?
Without touching the VI properties, this should work. It opens a VI front panel and runs it. It stops the main.vi until the subvi is finished.
PsyenceFact is right about the event structure. This code should go inside an event (without the case structure).
Yddet
05-28-2020 04:51 AM
I will give it a try with the dynamic structures. I had trouble finding it but have it now. Thanks for your help.
Best
-P
05-28-2020 04:56 AM
Like the other responders, I see that the subVIs SLpro_CTA - P7 - Status for OPERATE.vi and SubVI_Initialize.vi are missing. However, I've managed to modify your Test.vi to show the use of an Event Structure to handle the button push events and shift registers the module address and automation refnum.
Can you provide a link to a website for the bought software or provide some documentation? That way we could at least have a look at how it is supposed to work.
PsyenceFact