06-30-2023 03:16 AM
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.
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
06-30-2023 03:22 AM
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, …)
06-30-2023 03:27 AM
@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.
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.
06-30-2023 07:36 AM
I understand, thanks.
07-03-2023 04:06 AM - edited 07-03-2023 04:07 AM
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.
And for example test is VI which has its own qmh and events.
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.
07-03-2023 04:46 AM
only thing that cross my mind is to use reference of control, and property node value (signaling)
Like this:
But i'm not sure this is good practice.
07-03-2023 05:55 AM
@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.
And for example test is VI which has its own qmh and events.
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).
07-03-2023 06:38 AM
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
control from test VI
And i don't know how to 'merge' these two event cases..
07-03-2023 07:07 AM - edited 07-03-2023 07:20 AM
Ah...
you mean on this.
in that case, if i use two conditions, i don't have proper output.
should be newVal
07-03-2023 10:49 AM
Simplified example (you'll need a while loop and so on)