LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Block Programming style interface for inputs

Solved!
Go to solution

So, im new to Labview and i want to know is if its possible to make an interface that has several "stages", each taking some values as inputs, one of them being a time duration, and that has an option to add another stage, so that the user can program as many "stages" as they want, so that, when the program runs, it uses the values from each stage for their duration, something like this:

 

Model.png

 

Specifically, i want to know if there's a way to do this stage-creating button or if its gonna have to be a fixed predefined number of stages that i manually add while designing the interface.

 

Thanks for the help.

0 Kudos
Message 1 of 11
(1,438 Views)
Solution
Accepted by Baldred

@Baldred wrote:

interface that has several "stages", each taking some values as inputs, one of them being a time duration, and that has an option to add another stage, so that the user can program as many "stages" as they want,


Technically you can't create UI controls programmatically, but as workaround I would like to suggest template-based solution and linked list of the subpanels, where you will insert your panel as *.vit, then wrapped into XControl. The only problem that you're new in LabVIEW..., but this is a good exercise.

Anyway, example in the attachment - its arranged vertically, but should be not a big deal to rearrange horizontally as you needed:

Screenshot 2024-02-16 22.19.10.png

Use it as starting point.

Andrey.

Message 2 of 11
(1,404 Views)

The visuals are the least of my worries, thanks for the help and the example!

0 Kudos
Message 3 of 11
(1,367 Views)

I have done something similar to what you're describing by using an array of clusters. You can then add and remove elements from the array programmatically and change the number of array elements shown via property nodes. The attached code is a very simple example of how this works.

Message 4 of 11
(1,346 Views)

Sorry for replying after marking it as solved, but i havent had much time to work on this much until now.

 

I've played around with this and have tried to make some changes, like having the stop button reset the stages instead of just deleting them, but my main concern now is how do i get the user inputs from the panels?

0 Kudos
Message 5 of 11
(766 Views)

@Baldred wrote:

now is how do i get the user inputs from the panels?


Internally you have it in Event structure as normal OnChange events. If you need to collect these changes externally, you can use Queues, for example.

0 Kudos
Message 6 of 11
(738 Views)

So, from what i've seen those inputs come through an "on-Change" event in the "facade", but the input boxes are on the "Panel" VI, while the "facade" is empty. I dont see how to take the values from the "Panel" VI or how to reference the boxes in the "facade".

 

I was also looking at the data in the "facade" wires to see if i could reference them somehow, as they seemed to have some kind of id reference to the input boxes, but again i dont know how to reference that data across VIs.

0 Kudos
Message 7 of 11
(618 Views)

@Baldred wrote:

So, from what i've seen those inputs come through an "on-Change" event in the "facade", but the input boxes are on the "Panel" VI, while the "facade" is empty. I dont see how to take the values from the "Panel" VI or how to reference the boxes in the "facade".

 

I was also looking at the data in the "facade" wires to see if i could reference them somehow, as they seemed to have some kind of id reference to the input boxes, but again i dont know how to reference that data across VIs.


Do you need to get this statically and programmatically? Then via references as shown in attachment. Or, alternatively, use trivial Functional Global to set and get values.

 

0 Kudos
Message 8 of 11
(595 Views)

I need to get the the inputs from the user when they press a "start button" or as they are changed, either one would work for me, so that i can use it to control some other components.

 

From what i can see you made a loop that iterates between all elements visible and you select the ones that are the input boxes of each type, saving their values, is that correct? If so i think i could run that when the user presses a "Start button" to get those values, since they shouldn't change after it starts.

0 Kudos
Message 9 of 11
(567 Views)

Now that's some AI generated botting.

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 11
(352 Views)