LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with properties of controls inside a cluster

Hi,

at the moment i have following problem:
I have a cluster with several slider controls. During execution i have
to set the limits of all controls referenced by the selected user
configuration. With a normal slider i've no problems to solve it. But
how can i do that with a cluster? I tried to use a property node and
selected the 'all controls' entry. There i get an array with references
to the controls. If i select one and wire it to a property node i only
see the entries which are included in every control.
How to do?
Can somebody help me?

Regards
Henrik
0 Kudos
Message 1 of 7
(2,812 Views)
I believe that you have to have a different property node for each
control in the cluster.

Regards,
Stephen

Henrik Skupin wrote:
>
> Hi,
>
> at the moment i have following problem:
> I have a cluster with several slider controls. During execution i have
> to set the limits of all controls referenced by the selected user
> configuration. With a normal slider i've no problems to solve it. But
> how can i do that with a cluster? I tried to use a property node and
> selected the 'all controls' entry. There i get an array with references
> to the controls. If i select one and wire it to a property node i only
> see the entries which are included in every control.
> How to do?
> Can somebody help me?
>
> Regards
> Henrik
0 Kudos
Message 2 of 7
(2,812 Views)
That i do...After i index the needed element i wire the reference to the
standard property node. But how can i select that all slider properties
are shown? The normal Create -> Reference won't work, cause there is no
reference in terminal.

Henrik
0 Kudos
Message 3 of 7
(2,812 Views)
> That i do...After i index the needed element i wire the reference to the
> standard property node. But how can i select that all slider properties
> are shown? The normal Create -> Reference won't work, cause there is no
> reference in terminal.
>

The problem is that the property nodes are being wired a
refnum wire that is typed to be control class, not the
more specific controls within it. The solution is to
cast the control references to the more specific type
that you need. If it succeeds without error, then you
can execute the property node. If for example, your
cluster has a Boolean in it and you try to cast it to
a slide, it will return an error. The property node
will not do nothing, and you can execute the next in the
array.

One other
point. If you really need an attribute to an
element in a cluster, go to the panel, popup on the element
within the cluster, and Create a Property node. These
elements don't have terminals, so they can't be created
from the diagram, but that just means you need to use the
panel.

Greg McKaskle
0 Kudos
Message 5 of 7
(2,812 Views)
Hi Greg,

thanks for your help, but i think that i found a better solution.
At the beginning i create references for all needed controls and pack
them into a cluster. So i can directly retrieve the reference and don't
have to cast it anyway. I have to do that cause a Sub-VI analyses the
data and have to make updates. For that way the Frontpanel of the
Main-VI couldn't help me.

Regards
Henrik


Greg McKaskle schrieb:
>
> The problem is that the property nodes are being wired a
> refnum wire that is typed to be control class, not the
> more specific controls within it. The solution is to
> cast the control references to the more specific type
> that you need. If it succeeds without error, then you
> can execute the property node. If for
example, your
> cluster has a Boolean in it and you try to cast it to
> a slide, it will return an error. The property node
> will not do nothing, and you can execute the next in the
> array.
>
> One other point. If you really need an attribute to an
> element in a cluster, go to the panel, popup on the element
> within the cluster, and Create a Property node. These
> elements don't have terminals, so they can't be created
> from the diagram, but that just means you need to use the
> panel.
>
> Greg McKaskle
0 Kudos
Message 6 of 7
(2,812 Views)
Henrik Skupin wrote:

> Hi,
>
> at the moment i have following problem:
> I have a cluster with several slider controls. During execution i have
> to set the limits of all controls referenced by the selected user
> configuration. With a normal slider i've no problems to solve it. But
> how can i do that with a cluster? I tried to use a property node and
> selected the 'all controls' entry. There i get an array with references
> to the controls. If i select one and wire it to a property node i only
> see the entries which are included in every control.
> How to do?
> Can somebody help me?
>
> Regards
> Henrik
Henrik,

I'd prefer reference instead of property node, but it it generally doesn't matter.
When you get the all control's references in the cluster
, determine
"Class ID" for each in a loop. Then inside a loop by this ID you can
"case" number 21 for slider control and get it's property "label.text".
This will help to ensure that this is desired control. Then use "to more
specific class" node and wire control for desired specific class
(numeric with slide in your case). Via property node for this modified
reference you'll get desired methods for the exact control.
If any questions, let me know and I'll send a sample.

Regards,
--
Sergey Krasnishov
____________________________________
Automated Control Systems
National Instruments Alliance Member
Moscow, Russia
sergey_acs@levsha.ru
http://acs.levsha.ru
Message 4 of 7
(2,812 Views)
Henrik,
What you can do is select a slider in the
cluster and create an attribute node.
This has the possibility to change the slider.
(scale info -> range )
I attached a small example of 2 sliders of which the range is adjustable by controls.
0 Kudos
Message 7 of 7
(2,812 Views)