LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clusters last stand?

Hi All,

First of all I'm fairly new to LabView (ver. 5.1) so please forgive my
fumbling around.

I have a vi that takes in a 2 dimensional array. One of the dimensions is a
series of clusters (one per element) that contain the settings for
individual hardware boards. The cluster is bundled and unbundled by name.
I would like to have this vi display the current values in each cluster on
the front panel and allow them to be changed (from the front panel). The
rub seems to be that to extract the cluster from the array and display its
current contents requires that the cluster is displayed as an indicator.
This part works well and I have not problem here. Yet to change any values
in the cluster (directly on the front panel display) i
t has to be a control.
When I change the indicator to a control I get the error "Wire has multiple
sources" since the cluster has been extracted from the array (the first
source) and the front panel control is acting as the second.

So, it would seem that it is not possible to load the front panel control
with the currently assigned values.

Is there some way of displaying the contents of the cluster and allowing the
contents to be modified?

If anyone would like to look at my humble collection of vi's that surround
this little problem, let me know and I'll send them to you (only about
300K).


Cameron.
0 Kudos
Message 1 of 2
(2,399 Views)
Cameron Skinner wrote:

> Hi All,
>
> I have a vi that takes in a 2 dimensional array. One of the dimensions is a
> series of clusters (one per element) that contain the settings for
> individual hardware boards. The cluster is bundled and unbundled by name.
> I would like to have this vi display the current values in each cluster on
> the front panel and allow them to be changed (from the front panel). The
> rub seems to be that to extract the cluster from the array and display its
> current contents requires that the cluster is displayed as an indicator.
> This part works well and I have not problem here. Yet to change any values
> in the cluster (directly on the front panel display) it has to be a control.
> When I change the indicator to a control I get the error "Wire has multiple
> sources" since the cluster has been extracted from the array (the first
> source) and the front panel control is acting as the second.
>
> So, it would seem that it is not possible to load the front panel control
> with the currently assigned values.
>
> Is there some way of displaying the contents of the cluster and allowing the
> contents to be modified?
>
> If anyone would like to look at my humble collection of vi's that surround
> this little problem, let me know and I'll send them to you (only about
> 300K).
>
> Cameron.

Cameron,
There are a couple of three ways (maybe more) of solving the problem.
1) Display the entire cluster , one array element at a time
2) Use the index array to get a cluster, use the unbundle to
get a cluster element. Create a control of the correct type.
Create a local variable of the control (write local) fed the
unbundle to the local. Modify the control and reassemble
(bundle cluster, replace array element.)

As you can see #2 is highly complex. You could split the operation
across some subVIs and get around the excessive use of locals.
It would look like this:

2a) Sub1 takes the array and breaks it into the cluster elements (as
indicators)
Sub2 takes the indicators into controls (this is the normal dataflow of subvis)

Modify the controls, bundle and index the array.


I used #1 above since it seemed easier. I read a file that contains the data
this goes into a write local of the array. In a while loop I pick which array
element
to display, modify it , etc, etc till I am done. Hit the boolean to stop the
loop
and write the file back out.

If you want to send me the vis you have I will try to take a look at them.
Kevin Kent
By the way : If you have a 2D array then BOTH dimensions have the exact
same cluster type. All elements of all dimensions of arrays must have the
same data type.
0 Kudos
Message 2 of 2
(2,399 Views)