cancelar
Mostrando los resultados de 
Buscar en lugar de 
Quiere decir: 

Accessing cluster elements from a cluster reference

I am passing a cluster reference to a subvi. In the subvi I would like get/change values of individual elements of the cluster. How do I get/change value an element by name? When I use unbundle by name I get wire error. 

girish53_0-1675975094604.png

Thank you.

Girish

0 kudos
Mensaje 1 de 8
2.198 Vistas

You can feed that reference into a property node and use the Value property to read/write data.

Matt J | National Instruments | CLA
0 kudos
Mensaje 2 de 8
2.189 Vistas

When I connect to a property node, I don't get the list of elements in the cluster. 

girish53_0-1675976906671.png

I have elements like baud rate, parity etc. which do not show up in the choice list. What is the property Value anyway? 

Girish

0 kudos
Mensaje 3 de 8
2.169 Vistas

The reference is a pointer to some cluster on a front panel. The Value property is the value of that cluster. You should be able to right-click what you have and change to read and then unbundle the Value output of the property node.

Matt J | National Instruments | CLA
0 kudos
Mensaje 4 de 8
2.160 Vistas

You need to use the type def to tell the subVI what's in your cluster.

ZYOng_0-1675981375959.png

 

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 kudos
Mensaje 5 de 8
2.128 Vistas

@ZYOng wrote:

You need to use the type def to tell the subVI what's in your cluster.

ZYOng_0-1675981375959.png

 


That's true for generalized cluster references, but not for "Strict" references.  It depends on the reference and how it was copied around.

0 kudos
Mensaje 6 de 8
2.108 Vistas

@girish53 wrote:

When I connect to a property node, I don't get the list of elements in the cluster. 

girish53_0-1675976906671.png

I have elements like baud rate, parity etc. which do not show up in the choice list. What is the property Value anyway? 

Girish


Change that Value property to "Read", then wire it to an unbundler.

"If you weren't supposed to push it, it wouldn't be a button."
0 kudos
Mensaje 7 de 8
2.049 Vistas

@Kyle97330 wrote:

@ZYOng wrote:

You need to use the type def to tell the subVI what's in your cluster.

ZYOng_0-1675981375959.png

 


That's true for generalized cluster references, but not for "Strict" references.  It depends on the reference and how it was copied around.


This is a possible race condition though, generally not 100% safe as other code accessing the cluster (read or write) can act on the data in the time period between reading and writing via property node in your diagram.

0 kudos
Mensaje 8 de 8
2.009 Vistas