LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Swapping Ui's dynamically

Hello,

So now the Vis are switching when i use the ring, but they are not running. 

Julsbng_0-1709571027511.png

 

 

Julsbng_1-1709570737534.pngJulsbng_2-1709570749516.png

If i use a Run vi now it is not working. It shows nothing then...

0 Kudos
Message 11 of 20
(495 Views)

@Julsbng wrote:

Hello,

So now the Vis are switching when i use the ring, but they are not running.

If i use a Run vi now it is not working. It shows nothing then...


You need to remove, then reinsert on change, something like that:

subpanels.png

0 Kudos
Message 12 of 20
(475 Views)

Hello,

thank you i will try this.

You don’t have a connection to the N of the for loop, isn’t it needed or it won’t run?

0 Kudos
Message 13 of 20
(459 Views)

Its working perfectly thank you very much. 

But i still got one issue. The size of the front panels of the Vis are the same size as the subpanel but its not fitting correct when i start the programm. i need to adjust the subpanel with the slider so i can see the whole front panel and not some empty space. How can i fix this? I know that i can do some setting with window size etc but this didnt work maby  i did somethign wrong. I will attach some pictures tomorrow.

Thank you very much for your help so far. !

best regards

0 Kudos
Message 14 of 20
(441 Views)

@Julsbng wrote:

Its working perfectly thank you very much. 

But i still got one issue. The size of the front panels of the Vis are the same size as the subpanel but its not fitting correct when i start the programm. i need to adjust the subpanel with the slider so i can see the whole front panel and not some empty space. How can i fix this?


The trick which I using time to time is to set properties as shown below:

Screenshot 2024-03-04 21.54.20.png

Just set the size equal to the size of your subpanel, you will see gray border which can be used as guide to control that all UI elements placed on the BD are fit with visible area (this border will be not displayed in runtime). Don't forget to set Origin to 0,0 - this will move it to left upper corner  and disable scrollbars if you don't need. That is.

Message 15 of 20
(435 Views)

Hello, Thank you very much this is working aswell but i got a problem now that i expected to happen... 

The Vis share similar output and so the DAQ is reserved when starting them simultaneously. 

Julsbng_0-1709637167154.png

Julsbng_1-1709637184408.png

When i say stop, the one Vis is working but when i use the Switch to the other Vi its not running. 

Any idea how to avoid this to happen?

I think in need to Start the applications one by one and quit the other before opening the new one.... but i dont know how to do this

 

 

0 Kudos
Message 16 of 20
(421 Views)

I got it run now. 

Julsbng_0-1709639420004.png

Thanks for all the help! Really appreciate. 

 

0 Kudos
Message 17 of 20
(394 Views)

Using Abort to stop a VI is like using a tree to stop the car. It works, but might have some consequences.

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 18 of 20
(391 Views)

I would love to get a better solution here! I appreciate any tips to get better and improve. 

0 Kudos
Message 19 of 20
(386 Views)

You mentioned the two VI's use similar DAQ? I assume they don't use the same channels though, right? If so, you can create and start the DAQ task first in the main VI (that reads all channels) and just use the task in the two VI's and grab the relevant ones.  

 

That way both subVIs can keep running even when they're not shown.

 

I'd also create a way of stopping the VI's gracefully. Send in (or obtain through name, it's less recommended but might fine in this case) a User event or queue so you can for starters signal a Shut down command, that way it can easily expand later on if you need more functionality.

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 20 of 20
(381 Views)