LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Logic within an array of clusters

Solved!
Go to solution

Hello,

 

I'm trying to create an array of clusters where each cluster would have indicators and controls. When moving the cluster to an array I lose all the connections between the cluster indicators and the controls. The image shows a dummy example of the type of cluster I would like to put on an array. 

 

Untitled.png

 

Whats the "best" way to accomplish this? 

 

Thanks

 

0 Kudos
Message 1 of 12
(3,463 Views)

Hi Neuro,

 

When moving the cluster to an array I lose all the connections between the cluster indicators and the controls.

Whats the "best" way to accomplish this? 

Just rewire the lost connections!

(I guess this is not the real answer but you didn't explain your problem with an example…)

 

create an array of clusters where each cluster would have indicators and controls.

A cluster is either a control or an indicator, but you cannot mix controls and indicators in one cluster!

(You can make all cluster elements as controls, but set some of them "disabled" to use them as an indicator…)

Best regards,
GerdW


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

Not quite sure what you are trying to achieve.  Since you're not sure how to code it, maybe you could tell, in words, what the goal of this exercise is.  Concentrate on the "why" not the "how".  You supply the "why" and we can probably supply the "how".

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 12
(3,433 Views)

I'm not sure how you "rewire" it so that it works within an array. Yeah I was using them  as control with one being disabled.

 

It might be easier to explain  what I'm trying to do. I need to quickly setup an arbitrary number of "channels", with each channel having associated outputs (meters/values/etc) and inputs (values/buttons/etc). For that reason I thought an array would be a simple solution to accomplish something like this (which is an example problem used for illustration purpose):

 

Array.png


On my first post there is block diagram showing how these are connected, how could replicate the same logic for each element of the array?

Or, is there a better approach to accomplish what I'm trying to do? I would expect that there is a way to create a set of dashboard with its logic that I could use anywhere I need, but just drag-and-dropping the cluster into the array didn't kept the block logic of the cluster.

I hope it was clearer now, if not, I could refer you to the real problem, but I feel that would bring up some unnecessary (for the discussion) details...

0 Kudos
Message 4 of 12
(3,415 Views)

I think you just want a for loop, handling each element in the array one at a time in the same way you were handling just one cluster.  

 

Also you maybe interested in an example I made here, which shows how to make and handle a grid which is really just an array of clusters.  That example had a few extras like being able to set the background color of any element by using a color box as the background, and having multiple rows where each row is its own 1D array of a cluster.  Still that example should show you how to detect control value changes by looking at what element in the array had a value change.

Message 5 of 12
(3,412 Views)

I need to set up a variable amount of "channels" in the field. Each channel needs to display output values and allow to enter input values. Some input values modify some aspects of the output panels, for instance they could set the range of values of a gauge (say between -80 to - 20 dB) and the range where the value would be dangerous (say, amplitude > -40 dB), which I would do by using a color ramp or maybe an alarm LED. As all channels are identical and independent, I though an array would allow me to quickly and easily setup an arbitrary number of channels. In the 2 previous posts I showed a dummy example which is not exactly what I'm doing, but illustrates the exact problem I'm trying to solve.

Hope this is clearer, but if required I can get into further detail...

0 Kudos
Message 6 of 12
(3,411 Views)
Solution
Accepted by topic author Neuromodulator

You're running into a common problem with array properties.  Every element in the array must have the same properties with very few exceptions! such as, cluster.numeric knob.value may change for each element but, cluster.numeric knob.scale.visible cannot be set on each element.

 

An array of knobs just doesn't work!  Spitballing. ... try a Chart.  You could stack the plots and use horizontal cursors and plot color / background color for limits on the individual plot scales. Some interesting ideas are setting the history length to 1 and messing around with point size and axis rotation....... maybe that will fire some other synopses...


"Should be" isn't "Is" -Jay
Message 7 of 12
(3,404 Views)

I didn't expect Labview to have such limitation, specially because I would think that what I'm trying to achieve is a very common. Is that what you suggest the usual way it is approached?

0 Kudos
Message 8 of 12
(3,372 Views)

It is the array that has that nature not clusters.

 

If you can put an upper limit on the number of THNGIES, you need you can create a cluster with more than enough of the clusters you wanted to put in the array and hide the clusters you are not using.

 

Beyond that it does involve a bit of effort.

 

One approach is use a picture control and "invoke node get image" to make it look like you have a collection of similar but different elements but that will require logic to make sure each image show in the right place and then when you want to poke at one of those things, you can detect the mouse down, move an off-screen prototype of the thingie over the picture and let the user poke at the protype.

 

Then there is a possibility of a XControl that has multiple sub-panels and a scroll bar. With the appropriate logic you can make it look like you have an array with different data types in it.

 

Post an image of the dream screen you want to develop and someone maybe able to offer a quick solution.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 9 of 12
(3,364 Views)

@Neuromodulator wrote:

I didn't expect Labview to have such limitation, specially because I would think that what I'm trying to achieve is a very common.


An array is a collection of elements that can only differ in value, each is addressable by its index. All share the same properties.

 

This lean-ness makes arrays so efficient! Imagine you have an array of 100M DBL values. Would you really expect LabVIEW to carry font(color size, style), input range, format, background color, etc. etc. for each array elements. That would easily increase the size of the data structure by several orders of magnitude!

 

What you want, can easily be achieved, just not by using arrays. 😄

Message 10 of 12
(3,358 Views)