LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Initializing array of clusters

I have a cluster, named graphmap, of strings and 4 text rings as shown below. The text rings have not items.

girish53_0-1677165562099.png

I set the Strings and Values property of the rings programmatically, and initialize an array of clusters with the initialized cluster. The block diagram is shown below. 

girish53_1-1677165895144.png

In the first frame I setup an array of strings and values pairs as required for Strings and Values property of a ring. In the first frame of the second frame I initialize graphmap cluster and set the strings and values of the 4 rings in the second frame. After initialization of the graphmap cluster is correct as shown below with ring items set to correct values.

girish53_2-1677166228155.png

However, the rings in the clusters in the intialized array grdefarray are empty as shown below

girish53_3-1677166444493.png

What am i doing wrong? 

Thank you. 
Girish

 

 

 

0 Kudos
Message 1 of 5
(766 Views)

Hi Girish,

 


@girish53 wrote:

What am i doing wrong? 


You forgot to attach real code.

You use too many locals and frames.

You don't clean up the code.

You initialize the cluster with apparently empty ring, then you create an array of that cluster...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(756 Views)

The contents of the rings are based on the selections made by the user in the other parts of the vi. That is why I assemble the latest list in the first frame, and then initialize the the graphmap cluster using the current state. Unfortunately I cannot send the code because it is part of a much larger vi. I am trying figure why the graphmap cluster gets correctly set, but the clusters in the array created using graphmap are not correctly set.

Thank you for your help. 

Girish

0 Kudos
Message 3 of 5
(736 Views)

@girish53 wrote:

What am i doing wrong? 

 


Everything!!!!

 

As has been said, you need to attach your code and explain in detail what it should do. Make sure all controls have reasonable default values.

 

In terms of LabVIEW, start with a few simple tutorials. There are just way too many glaring Rube Goldberg constructs in your code.

 

  • blatant overuse of local variables everywhere
  • pointless sequence structures
  • index array is resizable
  • questionable array operations and loops.
  • all that duplicate code!

 

0 Kudos
Message 4 of 5
(726 Views)

@altenbach wrote:

@girish53 wrote:

What am i doing wrong? 

 


Everything!!!!

 

As has been said, you need to attach your code and explain in detail what it should do. Make sure all controls have reasonable default values.

 

In terms of LabVIEW, start with a few simple tutorials. There are just way too many glaring Rube Goldberg constructs in your code.

 

  • blatant overuse of local variables everywhere
  • pointless sequence structures
  • index array is resizable
  • questionable array operations and loops.
  • all that duplicate code!

 


Nice bullet points.  If only I had a way of hammering them into my cow-orkers’ little heads.

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