LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Working with array of cluster


I am trying to provide a test specifier user interface. The number of tabs to be displayed needs to be configurable (maximum 16)
Channels are also configurable, but here they can vary and will come from configuration file. Depending on how many readings user wants (configurable), those many array elements needs to be displayed.

  • I have tried to build it as attached vi. Issues I am facing are:
    If tried to run Vi more than once, the number of rows for array remains constant(5 in this case) but 2 rows become active (random behavior)- default I want only one to become active
  • I am unable to increment the Sr. automatically (in this case 0 to 4) should be the values.

Appreciate any suggestions/ help in this regards. I hope I explained the requirement correctly.

0 Kudos
Message 1 of 5
(2,357 Views)

Hi,

 

unfortunately, pages can only be added to or removed from a tab control at design time. I think the easiest way for you, since you don't need an excessive amount of pages is to add 16 pages to your tab control and then make them visible as needed, like so:Tab Control.png

 

 

As for the number of displayed array element, there's a property for that called "Number of Rows" or "Number of Columns" respectively.



Remember Cunningham's Law
Message 2 of 5
(2,331 Views)

Thank you for the reply. But Issues I am facing are:

  • If tried to run Vi more than once, the number of rows for array remains constant(5 in this case) but 2 rows become active (random behavior)- default I want only one to become active
  • I am unable to increment the Sr. automatically (in this case 0 to 4) should be the values.
0 Kudos
Message 3 of 5
(2,287 Views)

If you're talking about your VI, I haven't seen it, since I only have 2015 installed.

 

Without looking at it, I'd say that any sort of random behavior most likely comes from an uninitialized shift register/variable.

What do you mean by Sr.?



Remember Cunningham's Law
0 Kudos
Message 4 of 5
(2,260 Views)

Hi Gusre,

 

I can see the problem now. In your VI you use the "i" control to set the value of the "Sr. No", but this doesn't happen quite how you expect. If you probe the wire leading into the second For loop, you'll see that the "Controls on Page" only has one item - this is the Array.

 

When you get the "Array Elem" reference, this is to the datatype of the array - not the value of the array. You can provide what I think the functionality you want is by adding an additional For loop inside your 2nd loop, with the N value wired to the number of values you want (perhaps 5 in this example) then using Bundle by Name combined with the cluster constant and the "i" value in the new loop and outputting an array of these clusters to a "Value" property node of the array.

 

See the messy picture below:

BBN_ValueforArray.png

 

Let me know if this is what you were looking for, and good luck.


GCentral
Message 5 of 5
(2,239 Views)