From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Indexing a Cluster

Hello all!

I'm trying to enter control data in a cluster of clusters.

However, if the number of clusters becomes large, I expect the vertical scrollbar to allow me to work with the latter clusters.

Trying to pull the cluster to the end does not actually get me to the actual end.

 

Is there a way to Index clusters similar to Indexing arrays?

 

Thank you! 

0 Kudos
Message 1 of 6
(2,407 Views)

Actually there is no option like (Vertical Scroll bar or Indexing) for Clusters Unlike Arrays.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 6
(2,348 Views)

Palanivel is correct, Clusters do not have scroll bars.

 

My first "introduction to LabVIEW" involved a pretty large (hundreds of undocumented VIs) project controlling a behavioral experiment, written in LabVIEW 7.0 (shudder).  The original design called for the Experiment to be "driven" from an Excel Workbook, with three Worksheets holding parameters for the study.  One sheet, "Trials", had 50 or so columns with different types of parameters (target position, stimulus parameters, response variables), while the rows represented individual trials.  The mapping was very messy -- the sheet was expressed as an array of "pseudo-variants" -- very complex, very hard to comprehend, and hard to program.

 

Our students (who had to use this monstrosity) and I redesigned the Workbook and made the Trials Worksheet larger (but much more organized) -- about 160 entries.  I built a LabVIEW Cluster to represent the Trial row -- each element was named using the Column name in Row 1, and was Typed (we used I32, Dbl, String, and Boolean, as I recall) according to the values found in the Spreadsheet.

 

 As you can imagine, this thing was a monster.  I used scripting to create the TypeDef by reading the Prototype "Master" Workbook, parsing Row 1 to get all of the Cluster entry names, and parsing Row 2 to deduce the Cluster entry types.  I then built the Cluster, but kept the names "not visible" (otherwise it would be twice-as-huge!).  

Excel Cluster.png

Here is a picture of the TypeDef:

As you can see, the first Entry is a String, the next few are numeric, and there are other entries "not shown in this view" (they extend well off the bottom of the screen).  But this is what shows up on the Front Panel -- pretty compact.  When using the Cluster, I (of course) need to know the names of the items I want, but I always have the Excel Workbook to remind me of their names (hint -- spend significant time in coming up with a good, sensible, mnemonic naming system).

 

Another thing you should consider is whether you can build your Cluster out of named sub-types.  In particular, see if you can create an array of sub-clusters, which will let you put a scroll bar within your Cluster to handle the Array.

 

Good luck with your design.  We spent several weeks on the initial design of our new Master Workbook (and the design underwent a few changes as we started using the system, and as the Experiments themselves evolved -- you might notice that this Cluster is Type 2.3).

 

Bob Schor

0 Kudos
Message 3 of 6
(2,310 Views)

@Oley_Mich wrote:

I'm trying to enter control data in a cluster of clusters.

However, if the number of clusters becomes large, I expect the vertical scrollbar to allow me to work with the latter clusters.

Trying to pull the cluster to the end does not actually get me to the actual end.


I would recommend going back to the drawing board and use more suitable data structures for the task at hand.

0 Kudos
Message 4 of 6
(2,282 Views)

You could add a scroll bar control to the cluster and use its value to move controls around inside the cluster.

 

A value change event for the scroll bar could trigger the code that moves the other controls around inside the cluster.

 

These images show sub-panels that move up and down in a cluster based on the scroll bar.

 

Disimilar_array_1.png

 

Disimilar_array_2.png

I am mentioning this approach since while array elements can only differ in value, it Looks like I broke that law.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 6
(2,266 Views)

There is an old deprecated property that puts a vertical scrollbar on a cluster.  Unfortunately, in addition to being deprecated, it's also buggy: The scrollbar doesn't stay visible; you've got to force visibility on.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 6
(2,228 Views)