Yagnik_Patel Posted November 2, 2016 Report Share Posted November 2, 2016 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 Quote Link to comment
Yagnik_Patel Posted November 9, 2016 Author Report Share Posted November 9, 2016 Another help from same example, I want the Enum unsigned values to be displayed as a children and not in value column. I am attaching my VI. Kindly direct me the suggestion. Thanks in advance xperts... ClusterView 2011 (1).zip Quote Link to comment
Neil Pate Posted November 9, 2016 Report Share Posted November 9, 2016 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? Quote Link to comment
Yagnik_Patel Posted November 9, 2016 Author Report Share Posted November 9, 2016 @ Neil Pate: Thank you for looking at my difficulties. Sorry for the messed file. I attach another file. ClusterView 2011.zip Quote Link to comment
Neil Pate Posted November 9, 2016 Report Share Posted November 9, 2016 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? Quote Link to comment
smithd Posted November 10, 2016 Report Share Posted November 10, 2016 (edited) 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 November 10, 2016 by smithd Quote Link to comment
Neil Pate Posted November 10, 2016 Report Share Posted November 10, 2016 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). Quote Link to comment
Yagnik_Patel Posted November 10, 2016 Author Report Share Posted November 10, 2016 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 Quote Link to comment
Neil Pate Posted November 10, 2016 Report Share Posted November 10, 2016 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. Quote Link to comment
Yagnik_Patel Posted November 10, 2016 Author Report Share Posted November 10, 2016 @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!! Quote Link to comment
Neil Pate Posted November 10, 2016 Report Share Posted November 10, 2016 Yes sure it is possible, you need to modify the case structure and handle an enum slightly differently to other types. Quote Link to comment
Yagnik_Patel Posted November 10, 2016 Author Report Share Posted November 10, 2016 @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. Quote Link to comment
Neil Pate Posted November 10, 2016 Report Share Posted November 10, 2016 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? Quote Link to comment
Yagnik_Patel Posted November 10, 2016 Author Report Share Posted November 10, 2016 (edited) @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 November 10, 2016 by Yagnik_Patel Quote Link to comment
Neil Pate Posted November 10, 2016 Report Share Posted November 10, 2016 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? Quote Link to comment
Yagnik_Patel Posted November 10, 2016 Author Report Share Posted November 10, 2016 @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. Quote Link to comment
Yagnik_Patel Posted November 10, 2016 Author Report Share Posted November 10, 2016 @smithd: I tried your suggestion about built-in function of labview for drag and drop operation. I am attaching the my example VI. Kindly have look over it and suggest me my mistake over it. Thank you Tree to Table.vi Quote Link to comment
Neil Pate Posted November 10, 2016 Report Share Posted November 10, 2016 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? Quote Link to comment
Yagnik_Patel Posted November 10, 2016 Author Report Share Posted November 10, 2016 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! Quote Link to comment
Neil Pate Posted November 10, 2016 Report Share Posted November 10, 2016 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. Quote Link to comment
Yagnik_Patel Posted November 10, 2016 Author Report Share Posted November 10, 2016 @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... Quote Link to comment
Neil Pate Posted November 10, 2016 Report Share Posted November 10, 2016 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. Quote Link to comment
Yagnik_Patel Posted November 11, 2016 Author Report Share Posted November 11, 2016 @Neil Pate: I am presenting New Idea. Should I try to implement it or not? Is It technically possible? I am trying to explain my idea through Screenshot. Kindly guide me. Quote Link to comment
Neil Pate Posted November 11, 2016 Report Share Posted November 11, 2016 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? Quote Link to comment
Yagnik_Patel Posted November 13, 2016 Author Report Share Posted November 13, 2016 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.