Jump to content
Sign in to follow this  
nightdweller

Extract Elements from cluster

Recommended Posts

Hi Everyone,

I have a question. Well, I currently have a cluster containing 9 clusters with 3 of the same elements within each cluster. My question is without using loops, or extracting each cluster element individually. Is it possible to grab the first two elements of each cluster. I was trying to use some array manipulations but it did not work as planned. :wacko: Any ideas out there? Thanks in advance..

Vince

Share this post


Link to post
Share on other sites
Hi Everyone,

I have a question.  Well, I currently have a cluster containing 9 clusters with 3 of the same elements within each cluster.  My question is without using loops, or extracting each cluster element individually.  Is it possible to grab the first two elements of each cluster.  I was trying to use some array manipulations but it did not work as planned.  :wacko:   Any ideas out there? Thanks in advance..

Vince

1273[/snapback]

You can't index a cluster in a loop. You have to transform it into an array. If the 9 subclusters are of the same type, use the function Cluster to Array. It will output an array of 9 clusters of 3 elements.

Share this post


Link to post
Share on other sites

You're right, I cannot index a cluster using a loop. I was assuming that we had to use the cluster to array function. I'm fairly new to labview, and just wanted to see if there are alternative methods to solving this. I was wondering if it is possible to convert the data to variant, and stick the data to an array, and then extract the data using array functions.

Also, if it is possible to use the "to specific class" to get the data I wanted. Thanx.

Vince

Share this post


Link to post
Share on other sites
I have a question.  Well, I currently have a cluster containing 9 clusters with 3 of the same elements within each cluster.  My question is without using loops, or extracting each cluster element individually.  Is it possible to grab the first two elements of each cluster.  I was trying to use some array manipulations but it did not work as planned.  :wacko:   Any ideas out there? Thanks in advance..

Vince

1273[/snapback]

Well, as you are discovering, manipulating your data is a real pain in the ######. Correct? That's good. It's good because this is a sure sign that you have chosen the wrong data structure to store your data. Instead of trying to jump through hoops to fit the data mold, why not change the data structure to the easiest form for you to handle... an array! This is why it is a good thing to sit down and think through the data structures you will be using to pass data around your application. if I were you, I would scrap the clusters and go for an array... :yes:

Share this post


Link to post
Share on other sites
Well, as you are discovering, manipulating your data is a real pain in the ######. Correct? That's good. It's good because this is a sure sign that you have chosen the wrong data structure to store your data. Instead of trying to jump through hoops to fit the data mold, why not change the data structure to the easiest form for you to handle... an array! This is why it is a good thing to sit down and think through the data structures you will be using to pass data around your application. if I were you, I would scrap the clusters and go for an array...  :yes:

1288[/snapback]

Actually I have my application working correctly with the use clusters and converting it to arrays. And you're right about manipulating data is a real pain, I've been experimenting with variants with no luck :( I just wanted a learn more about the advance topics Labview has to offer, so I can use it implement them in future applications. Well guys, thanx again for the prompt reply.

Vince

Share this post


Link to post
Share on other sites

Hello LAVA forum,

Hate to bring up this topic again. I am ready build my executable, and I want to generate an ini file. I currently have about 21 agilent power supplies that I would like to control. I currently have a set cluster size to 21. I know that you cannot change the cluster size at run time. However, I am not sure if the systems engineering people will change their requirements, and I don't want to go in and edit the cluster size everytime. I have an alternative solution, but I think it is kinda corny.

Basically set the cluster size to be 50. And based on the address on the ini file, display the number of power supplies (hopefully less than 50).

What do you think? Is there a better solution?

One more thing. Is there a standard to building ini files that NI would recommend? I've been search for such a standard with no luck.. :headbang:

Thanks again...

Vince

Share this post


Link to post
Share on other sites

Here are some of the things I intend to put in the ini file.

1) Power Supply #.

2) Name of device power supply is connected to.

3) Grouping of Power Supplies.

4) Hardware settings ie Max Power, Max Voltage, and Max Current.

5) Over Voltage Protection

6) Current Limits.

7) GPIB address, bus, bus index, and sub.

8) Simulation Mode versus Visa Mode Selection: I think this should go with the ini file for the

executable, or should this be included in the same ini file?

Although, I don't have most of this code. I would just like to set up the basic structure because I know things will be changed later on. :( Any Suggestions are welcomed...

Thanx Again..

Vince

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
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.

Sign in to follow this  

×
×
  • Create New...

Important Information

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