01-14-2011 03:01 PM
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?
01-14-2011 03:06 PM
@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
01-15-2011 10:23 AM
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.
01-15-2011 10:28 AM
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
01-17-2011 09:00 AM
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?
01-17-2011 09:21 AM
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.