LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change programmatically the front pannel

Hi,

 

in my VI I need to show a command like this:

Zuc_lab2_0-1758551589653.png

 

So the aim is: I close the connection of one or more switches and I get the confirmation of their status.

I need to configure in the main front panel a flexible number of controls (like the one in the picture) each one related to its particular channel so that the switch can be crontrolled indipendedntly from the others. Since the number of those controls can be varied based on the test, I’m curious to understand if there is a way to control the front panel. Maybe with an array of cluster can be a good idea? Do anyone has any example?

Thank you for the help,

 

Best Regards,

Zuc

0 Kudos
Message 1 of 18
(300 Views)

An array of cluster is a good way to have dynamic size, yes. You can use a property node to set how many elements are shown so it matches the real number.

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

Qestit Systems
Certified-LabVIEW-Developer
Message 2 of 18
(288 Views)

Hi Yamaeda,

 

thank you for the help. I think so too, but i'm concerned on the fact that eac time to the device (an Agilent 34980a) will arrive all the values of all the switch channels to rewrite. But i need to command only the channel related to the particular element of the array.

Is there any combination of for loop and/or event struct to achive that?

 

Best Regards,

Zuc

 
0 Kudos
Message 3 of 18
(282 Views)

Yamaeda_0-1758553973261.png

 

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

Qestit Systems
Certified-LabVIEW-Developer
Message 4 of 18
(260 Views)

Hi Yamaeda,

 

thank you for the help, but this solution is applicable also for the Front pannel? I try to be more precise: the 3 boolean in the previous post are the controls for a switch, a contact that can be open or close. The Switch status is controlled by the user who manually change it. With your solution i can't resize the cluster on the front panel to manage all the desired command dinamically. Am i missing something in your answer?

 

i'm using labview 2019.

 

Vest Regrads,

Zuc

0 Kudos
Message 5 of 18
(187 Views)

Hi Zuc,

 


@Zuc_lab2 wrote:

but this solution is applicable also for the Front pannel?

I try to be more precise: the 3 boolean in the previous post are the controls for a switch, a contact that can be open or close. The Switch status is controlled by the user who manually change it.

With your solution i can't resize the cluster on the front panel to manage all the desired command dinamically. Am i missing something in your answer?


  • In your image I see two controls and one indicator: buttons/switches are considered as controls, while (an array of) LEDs are considered as indicators…
  • You can resize any cluster, but changing its size will not help you much I guess…
  • Maybe you want to use an array of clusters? You can change the number of visible array elements at runtime using property nodes!
  • What are "desired commands"?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 18
(179 Views)

Hi Gerdw,

 

yes sorry two boolean as input and one boolean as output, the others I/O are hiden. So my aim is: once i received and parsed a table of data i have to create on the front panel the array (can be 1 or 2D array) of cluster that mange those 3 boolean. So if my data table present 5 rows or 100 rows (each one is a switch control) i need the same ammount of elements in the cluster and in the Output boolean array. Each time the user change the value of the close button of one or more switches the Boolean Led will change accordingly.

 

Zuc_lab2_0-1758621137084.png

 

I have found hold posts that set create a big array and then uses only the active subset, but i need something more adattable and flexible.

 

Thank you for the help,

 

Best Regards,

Zuc 

0 Kudos
Message 7 of 18
(174 Views)

Hi Zuc,

 


@Zuc_lab2 wrote:

my aim is: once i received and parsed a table of data i have to create on the front panel the array (can be 1 or 2D array) of cluster that mange those 3 boolean. So if my data table present 5 rows or 100 rows (each one is a switch control) i need the same ammount of elements in the cluster and in the Output boolean array.

 

I have found hold posts that set create a big array and then uses only the active subset, but i need something more adattable and flexible.


Use an array of clusters to hold the "user control" elements and an array of booleans to hold all output data.

Arrays are resizable in LabVIEW: how much more "flexibility" do you need?

 

(I don't understand your problem from reading your description. What exactly is your problem with using arrays?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 18
(161 Views)

Hi GerdW,

 

essentially two issues:

1. how can i manage the front pannel to fit a possibile high number of element

2. how i can resize it and show runtime in the front pannel before the user use? Meaning that my array have to remain an input. I can use initialize array but i get an indicator in that way

Zuc_lab2_0-1758629902354.png

 

 

3. assign a name to each element

4. present the input with the string alredy filled so that OP can't use it

 

I have found something like this, but i struggle in adapting it to my cluster case:

 

Zuc_lab2_0-1758628805290.png

 

 

I'm with Labview 2019

 

Best Regards,

Zuc

0 Kudos
Message 9 of 18
(152 Views)

Hi Zuc,

 


@Zuc_lab2 wrote:

essentially two issues:

1. how can i manage the front pannel to fit a possibile high number of element

2. how i can resize it and show runtime in the front pannel before the user use? Meaning that my array have to remain an input. I can use initialize array but i get an indicator in that way

3. assign a name to each element

4. present the input with the string alredy filled so that OP can't use it


So there are 4 bullet points for your "two issues"? 😄

 

  1. There are property nodes to set the number of visible array elements and the change the frontpanel window size…
  2. Basic LabVIEW knowledge: to set values in a control you can use a local variable of that control (or a "value" property node")…
  3. You can set the string value for each cluster element in your array. What's the problem?
  4. You can set cluster items to "disable", either using its property dialog or by using a property node. Again basic LabVIEW knowledge!

To give you another idea to think about:

Depending on the requirements I prefer to use a MultiColumnListbox (MCLB) to show a variable number of items to the user.

The user can select a row in this MCLB and you can show settings for that item in separate controls/indicators. When the user operates those separate controls you just update their values in your data storage and in the MCLB display…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 18
(116 Views)