Jump to content
Yagnik_Patel

Cluster to tree and then tree to table

Recommended Posts

Hello everyone, 

I am designing a project in which I need to variant data from cluster to tree view and then transfer name, value and tag from tree to table with drag and drop option as well as select individual cell option. I am attaching my example VI. But it needs OpenG stuff to execute so kindly take notice of it. Can anybody help me because i am not good enough with OpenG VI ?

Thanks in advance 

Cluster to Tree and Tree to Table.zip

Share this post


Link to post
Share on other sites

Your zip is all messed up, so many dependencies in the wrong place etc. Take a look at the Files tab in your project to see where all your files are. You need to include everything not in the LabVIEW directory if you want somebody else to check it out.

Also, why are your OpenG VIs not inside the LabVIEW directory?

Share this post


Link to post
Share on other sites

OK so that is better, although still I would ditch the OpenG directory and just install them properly.

So I don't really understand your question. The Tree is a representation of your cluster, the hierarchy of the tree (parent/child relationship) represents the nested clusters and values. The value column shows the actual value of each element, this appears to be working correctly.

What are you trying to achieve? Can you post a screenshot of what you would like to see?

Share this post


Link to post
Share on other sites
On 11/2/2016 at 6:44 AM, Yagnik_Patel said:

Hello everyone, 

I am designing a project in which I need to variant data from cluster to tree view and then transfer name, value and tag from tree to table with drag and drop option as well as select individual cell option. I am attaching my example VI. But it needs OpenG stuff to execute so kindly take notice of it. Can anybody help me because i am not good enough with OpenG VI ?

Thanks in advance 

Cluster to Tree and Tree to Table.zip

Just based on your description, it sounds like you should start with this:

it takes a variant and there is a function in there which converts the variant into a tree. There is a class in there (VariantTree__VP) which has a method for setting what tree the class is pointing to (property node) and then a function BrowseVariant which populates the tree with the data in the variant.

Once in tree form, its just a bunch of strings and should be easy to access in whatever way you want. This includes the built-in labview functionality for drag and drop between trees and tables. If you need more custom behavior, you can implement the drag and drop events as described here: http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/drag_and_drop_programmatic/

Edited by smithd

Share this post


Link to post
Share on other sites

smithd, Ton's variant probe is great but does not do any more than the Cluster viewer class at the OP included. His question was related to the desired to display enum values as children and not in the value column, and I am trying to understand why this is desirable as an enum is not a collection of values at runtime (like a cluster or array).

Share this post


Link to post
Share on other sites
15 hours ago, Neil Pate said:

OK so that is better, although still I would ditch the OpenG directory and just install them properly.

So I don't really understand your question. The Tree is a representation of your cluster, the hierarchy of the tree (parent/child relationship) represents the nested clusters and values. The value column shows the actual value of each element, this appears to be working correctly.

What are you trying to achieve? Can you post a screenshot of what you would like to see?

Hereby I am attaching the screenshot what I expect with little reason about why I want that !!!. Thank you xperts

demoVI 2.png

DemoVI.png

Share this post


Link to post
Share on other sites

Yes, that is what I suspected you wanted. Do you understand what the rest of the code is doing? It is displaying the value of each element in your clusters/arrays, not the possible set of values...

All you need to do is make an array or cluster with one element set to each value of the enum.

Share this post


Link to post
Share on other sites

@Neil Pate: That is my real problem that I cant change the Config Cluster (In concern of current example) so I need to display possible set of values just in case of Enum, for rest of the types follow the same rule to display just value.  Is it possible to do ? thank you!!

Share this post


Link to post
Share on other sites

@Neil Pate: Got the Enum Value in the string Array and used Index Array to get the each value but i am just able to get the last value. So question is how i do the looping to get all the value in string control. attaching the screenshot. And still the last value is displayed in the item list only.

Special changes for Enum.png

Share this post


Link to post
Share on other sites

I didn't say it was going to be easy...

Can you not iterate over the Enum strings and just insert them one by one using the Parent tag?

Share this post


Link to post
Share on other sites

@Neil Pate: I am trying to solve this problem from last 15 days and yet the confusion is same. Can you guide me little more detail, how can this problem can be solved ? 

thank you!!!

Edited by Yagnik_Patel

Share this post


Link to post
Share on other sites

I still don't get what you are trying to achieve. Why do you want to present the different enum possibilities in the tree, what do you plan on having in the value column for these elements?

 

Share this post


Link to post
Share on other sites

@Neil Pate: As the Config cluster( current example) is my Process Image of the system, so Enum values are my data channel. Thus once I get the treeview I can use them and I dont need the value column at all for treeview. 

Share this post


Link to post
Share on other sites
12 minutes ago, Yagnik_Patel said:

@Neil Pate: As the Config cluster( current example) is my Process Image of the system, so Enum values are my data channel. Thus once I get the treeview I can use them and I dont need the value column at all for treeview. 

Sorry, I still don't get it...

The Config cluster is your process data, ok that makes sense. But an Enum is only a single value, it is not multiple values, why are you trying to display it as multiple values?

Share this post


Link to post
Share on other sites
2 minutes ago, Neil Pate said:

Sorry, I still don't get it...

The Config cluster is your process data, ok that makes sense. But an Enum is only a single value, it is not multiple values, why are you trying to display it as multiple values?

Dear Neil Pate, 

As to initialize my project, I need to display all possible value of enum in treeview. Maybe my Screenshot will make it more clear. Thank you!

Just for Enum.png

Share this post


Link to post
Share on other sites

ok, I understand.

So when trying to present the enum in the tree you need two loops. Loop once over all the possible strings, and inside this loop again over all the strings and write them as simple items.

Share this post


Link to post
Share on other sites

@Neil Pate Yeah. I got the concept but I am not able to execute this looping in the VI's. Because of the large project and use of OpenG VI's recurringly. I execute the change in one OpenG VI and all the instance get changed. Thus get more confuse and also get some messed output. Really need your Powerful help. Thank you...

Share this post


Link to post
Share on other sites

Why are you changing the OpenG VIs? Those are meant as external libraries and should not normally be altered. If you really want to make some changes to one of them, make a copy, give it another name and then change that one.

Share this post


Link to post
Share on other sites

Yagnik, anything is technically possible as you have all the source code.

What you propose just removes the need for the nested loop as you then have the elements already in the cluster.

Out curiosity, what is your exposure to LabVIEW, I mean how comfortable are you with the language?

Share this post


Link to post
Share on other sites

I started Labview in my master studies in 2014 and just the basic knowledge. So I want to learn Labview thoroughly. Now doing internship in field of R&D for sensor and one part is software development for it. so Learning GUI software development using Labview. Thank you for asking.

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.


×
×
  • Create New...

Important Information

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