LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

rename cluster

This should be pretty easy, but I can't seem to figure it out.  

I need to rename an element inside the existing cluster, for instance 'cnvyr spd' should be labeled 'dstnc btwn' rows The cluster I have has elements that I need to rename.  Do I need to remove each element and add an element?




metzler CLAD
0 Kudos
Message 1 of 8
(2,403 Views)

Without the cluster being a type def you are going to have to update all instances of that cluster.

 

Sounds like you want a type def This will create a control that the cluster can reference back to and you can change the control to change all instances of the cluster.

 

 

Message 2 of 8
(2,366 Views)

No.  Just pick the element in the cluster, right click, properties and rename it.

 

You may want to create a constant of that indicator and temporarily connect it to the uninitialized shift register on the loop so it will automatically update the names on the wires.

Message 3 of 8
(2,361 Views)

As a general rule, clusters and enums should be type defs.  This allows for them to be defined in a single location and all instances will be updated together.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 8
(2,333 Views)

@RavensFan wrote:

You may want to create a constant of that indicator and temporarily connect it to the uninitialized shift register on the loop so it will automatically update the names on the wires.


Exactly. You are apparently interested in changing the names in the bundle/unbundle node.

Your current indicator cluster is a data sink and there is currently no data source on the diagram where the names are defined.

 

Some possibilities:

 

  1. (As ravens already said), initialize the shift register with a cluster constant containing the correct element labels. Once the names have changed, you can delete the constant if the SR need to be uninitialized.
  2. I assume you also want to change the label in the current indicator, of course. A faster solution would be to change the label in the cluster indicator first, create a local variable(read) of it, initialize the SR with it, then delete the local again.

But yes, make it a typedef and things will automatically fall in place.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 5 of 8
(2,322 Views)

Wow, I am getting to be sorry that I included clusters in the VI.  

 

I did end up making the cluster a type def., but still had the problem.  The problem was/is associated with the datalog file VIs. 

It seemed every time I connected the cluster to the datalog read, my elements reverted back to the original labels.

 

I am now struggling with the datalog read VI.  In the included VI, I would like to save all the parameters for the part numbers in the enum.  The operator will then be able to select the part number and the parameters will be displayed and loaded.  The cluster shows the parameters were saved, but the read data does not show the parameters, and the datalog read VI doesn't show any errors. 

Am I using datalog VIs wrong?  Is there some better way to save the parameter data?

Thanks.

 




metzler CLAD
0 Kudos
Message 6 of 8
(2,313 Views)

You should never be sorry to have used clusters, or typedefs.  They are the correct thing to use.

 

If you create a typedef, and connect a constant of that typedef to your datalog Open functions, you should never have any problems.  I'm wonder if the fact you connected it to the shift register is what is complicating the updating of the datatype.

You may very well be using the datalog VI's wrong.  It is very odd that you are essentially writing and reading from the same file, and never really adding data to it.

 

0 Kudos
Message 7 of 8
(2,290 Views)

Some hints that could make your code easier:

1. You can use the Format Into String to convert your enum into a string.  The resulting string will be the text for the value of the enum.

2. This exact VI should really be done with an Event Structure so that you only mess with the file when the Write or the Read is selected instead of hammering it every 100ms.

3. I have never used the Datalog VIs.  But you may want to consider just using the normal File IO functions, specifically the Write Binary File and the Read Binary File.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 8
(2,138 Views)