-
Posts
1,189 -
Joined
-
Last visited
-
Days Won
110
Content Type
Profiles
Forums
Downloads
Gallery
Posts posted by Neil Pate
-
-
- Popular Post
- Popular Post
Normally if I have multiple 1D numeric arrays if I want to combine them into a 2D array to display as a table or write to file or whatever I used to Build Array and then transpose the 2D array, however I have discovered that the Build Matrix prim is actually configurable and defaults to assembling by columns.
Hooray!
This is probably old news to some people, but I share anyway for those that don't know
-
6
-
I would second what smithd wrote.
What is your experience with OO in LabVIEW? Certainly trying to refactor an application to OOP is not a good place to start your journey I think.
-
Ok good. Don't worry about the cluster for now. How did you generate that array, did you do it from code or manually?
-
21 minutes ago, shoneill said:
I have had a long discussion with NI over this over HERE.
Champions access only
(things like this make me sad...)
-
Ok so lets try and make this as simple as possible. Imagine all you have is a single constant value of your International thankyou enum on your block diagram. I get the feeling you would like to display this as a 2D string array with the first column listing all the possibilities of the enum and the second column has "1" in the column of the row that matches the constant value otherwise it has a 0, is this correct?
Can you describe in words how you would create this array?
-
Ignoring the fact that your array is not doing anything at all (you could just wire the Array indicator straight to the Strings[] output) you said you wanted to show the value as well, with 0 or 1.
-
I have given you my advice. Try implementing it as a 2D string array first. Leave the tree out of it.. Once you have mastered that you can think about getting it working in the tree.
As I said way earlier on in this thread I really think you are "mixing methaphors" here. The cluster viewer displays the "values" of items in the tree, not the set of all possible items. If you want that you are going to have to add it yourself and the tree API is not pleasant to work with.
-
1
-
-
16 minutes ago, Yagnik_Patel said:
But I also need to finish my project in time so I have to try this example as well.
I am trying to learn the concept and also the finish my work together.
You need to learn to crawl before you can walk... perhaps somebody in this forum will just show you the answer you are looking for (i.e. do your work for you). I am not that guy though, sorry.
-
1
-
-
Thanks Yagnik.
The tree control is not a nice thing to work with, I fear you are trying to do too much at once.
I think perhaps you need to start off a bit smaller. If you really really want to include the enum items in the table first try and get it working as a 2D string array. I mean not using any of the code you have been, just by figuring it out yourself. You can achieve what you want with a single enum and a nested for loop. Once you have that working you can figure out how to get that integrated into the cluster viewer code you have.
-
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?
-
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.
-
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.
-
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?
-
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?
-
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?
-
-
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.
-
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).
-
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?
-
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?
-
I have nothing substantial to add other than I also added my calls inside conditional disable structures which I never in the end bothered to disable as performance was way in limits. The calls themselves are quite lightweight I think.
-
Bump to this thread. I really do not like mutation history being stored.
I have a stupid LabVIEW bug where the IDE thinks I am using a class which I am not (really am not). I thought perhaps it was being referenced from the class mutation history. So I poked around in the history of some of my classes and am horrified at the history that exists! I don't know about others, but my standard framework has been adapted over time (several years for my current actor based framework). I still have references in the mutation history for application specific classes from my original project! Urgh...
I suppose I have no excuse, I have known about this "feature" for a while, but it is easy to forget about.
-
Rolf, sounds like a great idea. I love those VIs but yes they can be on the slow side.
I would happily accept the trade-off of >= LV2012.
-
1
-
-
18 minutes ago, shoneill said:
Service unavailable......
works for me.
Tip: use Build Matrix to assemble a 2D array by columns
in Development Environment (IDE)
Posted
As far as I can tell a Matrix is just a typedef to a 2D double, there is nothing at all special about it.