LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Constructing a cluster of References from Controls Array

I am trying to construct a cluster with elements that are control refs named after my front panel controls labels.  It seems rather simple to get the panel>controls[] property but then converting it from an array to a cluster you lose the names of the controls.   Does anyone know how to do this?

0 Kudos
Message 1 of 6
(5,836 Views)

@id wrote:

I am trying to construct a cluster with elements that are control refs named after my front panel controls labels.  It seems rather simple to get the panel>controls[] property but then converting it from an array to a cluster you lose the names of the controls.   Does anyone know how to do this?


Yes!

 

See this Nugget for ideas.

 

I wrote it to entertain people at all levels of LV experience so if you get to a point where you find youself saying (I am sorry I asked!" then stop. You have probably read enough.

 

This image is a tease to get you to read that thread.

 

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 6
(5,833 Views)

This will allow you to simply select the control and automatically create the code which builds the cluster. If you want to add more elements to it later, you'll need to edit the typedef.

 

 

http://decibel.ni.com/content/docs/DOC-5813

 

 

Note that you'll need to install the JKI RCF to use this. See the links in that page for details.


___________________
Try to take over the world!
0 Kudos
Message 3 of 6
(5,802 Views)

Alternatively, if you're using 2009 or later and don't want to install the RCF, you can use this, which should quickly create the references - http://decibel.ni.com/content/docs/DOC-7445


___________________
Try to take over the world!
0 Kudos
Message 4 of 6
(5,798 Views)

Thanks,  Looks like a good solution but I cant get it to work.  Installed the a.vi in my C:\Program Files\National Instruments\LabVIEW 2010\resource\dialog\QuickDrop\plugins directory and hit ctrl+spacebar I get a combo box popup but without "Ref" as one of the selctions.  I selected "VI Server Ref" and then hit ctrl+Shift+a and nothing seems to happen in the block diagram.  

 

Front Panel Controls and Indicators

1.  Select one or more front panel controls and/or indicators.

2.  Press Ctrl-Space.

3.  Type one of the following object names:  local, reference, property, invoke, control, indicator, constant.

4.  Press Ctrl-Shift-A.  The appropriate object will be created for each front panel control and/or indicator you selected, just as if you had right-clicked each object and chosen Create > [object]

 

Tried a few more selctions like local variable and property node and still got nothing.  Any ideas what is wrong here?

0 Kudos
Message 5 of 6
(5,747 Views)

I don't use QD shortcuts, but it seems to me you weren't following the instructions. It says to type "reference" and then press Ctrl+Shift+A.

 

Anyway, I would recommend the RCF plugin as it does more and is easier to use, but it has the disadvantage of requiring you to install the RCF, which itself requires installing VIPM.

 

Of course, you could also just create the cluster of references manually. Just create the references, bundle them and then create a cluster indicator. This is basically what the RCF plugin does.


___________________
Try to take over the world!
0 Kudos
Message 6 of 6
(5,740 Views)