LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cluster to manage long wires

Hello,

 

I have a conceptual question. Is it in general a good practice to use clusters to avoid a crowded block diagram with very long wires? Is there anything to be careful with? such as increased memory usage, computational time, wrong evaluations, etc.?

For example, previously I had 5 outputs of a for loop going somewhere (far!) in the block diagram, creating many long wires.

rpicazof_0-1718709191849.png

Alternatively, I thought of immediately clustering the outputs together so that everything is tidy, as here:

rpicazof_1-1718709402068.png

I would be grateful for any insights, thanks!



0 Kudos
Message 1 of 5
(339 Views)

Hi rpicazof,

 


@rpicazof wrote:

I would be grateful for any insights, thanks!


When you would split your very large block diagram into several (logical organized) subVIs then you wouldn't have to worry about long wires!

Best regards,
GerdW


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

Hi GerdW, 

 

I agree subVI is the way to go, I am actually using a subVI that has 5 outputs

rpicazof_0-1718712794385.png

but even if the wires are not long too many of them are cumbersome, that is why I think my question still remains :D, but thank you for the tip

Best,

 

0 Kudos
Message 3 of 5
(307 Views)

What I would do:

raphschru_1-1718716945012.png

 

In this way, your cluster array will be modified in place without unnecessary memory copy.

Also, you have the least possible wires coming in and out of your subVI and the code is scalable through the use of the cluster type definitions.

 

Regards,

Raphaël.

0 Kudos
Message 4 of 5
(288 Views)

Hi rpicazof,

 


@rpicazof wrote:

but even if the wires are not long too many of them are cumbersome, that is why I think my question still remains


Those wires are "cumbersome" because:

  • the connector pattern of your subVI is choosen badly
  • the connections to the pane are choosen badly (ever seen all those NI functions like VISA or DAQmx where related inputs/outputs are located in the corresponding connectors on left/right side of the connector pane?)
  • the subVI icon was drawn badly (borderless, with only a smaller glyph, but a connector pane using the full 32×32 pixel size!)
  • (as raphschru wrote) you should use the cluster already inside the subVI!
  • the local variables belong outside of the FOR loop!
Best regards,
GerdW


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