LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SubPanel with different subVis

Hello guys,

 

trying ot create main VI with subpanel called Test, in which i can see different tests, depending what i select in Enum.

These tests are different SubVis.

milan87_0-1688112799908.png

 

I know that is possible to send SubVi reference to subPanel and vice versa, but then i'm not sure, how to transfer data from main Vi to test subVi and back.

Of cource i'm aware that is best to do with Actor Framework, or DQMH, but i would like to do without these frameworks, because i'm more comfortable in a moment.

 

Please for advice.

Thanks

0 Kudos
Message 1 of 14
(1,398 Views)

Hi milan,

 


@milan87 wrote:

i'm not sure, how to transfer data from main Vi to test subVi and back.


You can transfer data as you do with any subVI: using wires and the connector pane!

 

(Or any of the other methods, including notifier, queues, channels, user events, …)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 14
(1,394 Views)

@milan87 wrote:

Hello guys,

 

trying ot create main VI with subpanel called Test, in which i can see different tests, depending what i select in Enum.

These tests are different SubVis.

milan87_0-1688112799908.png

 

I know that is possible to send SubVi reference to subPanel and vice versa, but then i'm not sure, how to transfer data from main Vi to test subVi and back.

Of cource i'm aware that is best to do with Actor Framework, or DQMH, but i would like to do without these frameworks, because i'm more comfortable in a moment.

 

Please for advice.

Thanks


The subpanel is completely irrelevant for sending data. Consider it a sub-vi as any other, it's just that you show the front panel in a sub-panel instead of (typically) a pop-up, that's the only difference. If it's e.g. a request for a file path, it should wait for input and then exit and wire out the resulting path.

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 14
(1,383 Views)

I understand, thanks.

0 Kudos
Message 4 of 14
(1,328 Views)

Hello guys,

 

I manage to get working sub-panel, thanks a lot.

But i have one more question.

 

Main VI has several loops. Beside others, there is event loop for UI, and there is test loop, where tests are inserted as a separate VIs into sub-panel.

I'm sorry, but i'm not allowed to place complete code, so i took some screen shots.

milan87_1-1688374783240.pngmilan87_2-1688374798723.png

And for example test is VI which has its own qmh and events.

milan87_3-1688374921458.png

 

I managed to control the test, and that's great.

But now test VI should be able to change values in control cluster in UI loop in Main VI.

Can someone give some advice, what is good practice?

 

Thanks.

 

 

 

 

0 Kudos
Message 5 of 14
(1,293 Views)

only thing that cross my mind is to use reference of control, and property node value (signaling)

Like this:

milan87_0-1688377561373.png

 

But i'm not sure this is good practice.

 

0 Kudos
Message 6 of 14
(1,285 Views)

@milan87 wrote:

Hello guys,

 

I manage to get working sub-panel, thanks a lot.

But i have one more question.

 

Main VI has several loops. Beside others, there is event loop for UI, and there is test loop, where tests are inserted as a separate VIs into sub-panel.

I'm sorry, but i'm not allowed to place complete code, so i took some screen shots.

milan87_1-1688374783240.pngmilan87_2-1688374798723.png

And for example test is VI which has its own qmh and events.

milan87_3-1688374921458.png

 

I managed to control the test, and that's great.

But now test VI should be able to change values in control cluster in UI loop in Main VI.

Can someone give some advice, what is good practice?

 

Thanks.


Generate a user event in the sub-vi which the main vi captures and updates the control accordingly.

You can use control ref, but it's not really good style to write to front panel control from sub-vis (even though i see it fairly often).

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 14
(1,280 Views)

Thanks for fast replay.

ok, i can generate user event in subvi, which will be captured by event structure in main Vi.

But, this will be different case in event structure, which has not control cluster in it.

Control cluster is in another event case (value change).

So i'm wondering how to update this control then?

 

What i want to say...

control  in main VI

milan87_0-1688383980545.png

control from test VI

milan87_1-1688384279868.png

 

And i don't know how to 'merge' these two event cases..

0 Kudos
Message 8 of 14
(1,270 Views)

Ah...

you mean on this.

milan87_0-1688386056704.png

 

in that case, if i use two conditions, i don't have proper output.

milan87_0-1688386755036.png

should be newVal

milan87_1-1688386803623.png

 

 

 

 

0 Kudos
Message 9 of 14
(1,261 Views)

Simplified example (you'll need a while loop and so on)

UserEvent2.png

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 14
(1,247 Views)