Jump to content

Dynamic Names and Values from Variants


Recommended Posts

Hi there!

I've played around with a piece of my Programm where I have to create an array of clusters where a cluster has two emenents: a NAME and a VALUE for the specific name.

I Would like to use something like the firt Screenshot as an Input (Bundle the Variables to a cluster).

Then, inside the SubVI I would like to generate said Array of Clusters based on the Label of the Controls that I use as Inputs to the cluster.

post-27848-0-12638800-1364997492.png

As a Result I would like to get something like this:

post-27848-0-35084800-1364997729.png

The thing is that I can't seem to get the Data out of the Variant - On the Frontpanel, the indicator for the variant shows all the information I need...

post-27848-0-85696800-1364997933.png

How do I get the Information out of there? Any Ideas?

Edited by kull3rk3ks
Link to comment

Use the Variant Attribute.  You can have an attribute named "Potato" and set the value to 100.  Then Set another attribute (on the same variant) called "Apple" with a value of 13.  Then read the attribute with the name "Potato" and you will get your 100 back.  You will need to tell the Read Attribute function what the data type of Potato is but that's the only catch.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.