LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modify cluster without cluster

In my main VI , I have a cluster that is nested a few layers deep.  The main VI will modify the cluster and write the cluster to a file for 1000 times (the modification is different each time).  I want to give the user the ability to select which element in the cluster to modify, but I don't want to show the cluster to the user, since the cluster is confusing.  Would it be possible to ask the user to specify the name of the element?  How do I do this?  What's the best way?  Thanks! 

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 1 of 10
(2,720 Views)

I would find some other more UI friendly way of showing th einformation to the user. A table perhaps. A tree. I would avoid making the user know the names of the elements and asking them to supply that. Separate your inner processing from your UI. Make the UI easy to understand for the user. Since I have no idea what your cluster is or what you are trying to do it is difficult to give you any more concrete advice.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 2 of 10
(2,715 Views)

Try investigating XControls

 

you can make the datatype of the xcontrol your cluster and then have the freedom to make the user interface user friendly

- James

Using LV 2012 on Windows 7 64 bit
Message 3 of 10
(2,703 Views)

This program is going to be for engineering only.  At the moment, I am the only person who would use it, so supplying the element names of the cluster is not a big deal.  Attached is an approach that I thought of, but it will require me to create a lot of cases and a combo box with a lot of slection, since the real program is more complext than the example.  Is there a better way?  

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 4 of 10
(2,697 Views)

I think that what you demonstrate is the best approach.  It's boring to set up but easy to modify later if you need to add or delete an element, the intent is clear, and the code isn't complicated.  Theoretically you can flatten the cluster to a string, parse out the right section of the string, modify it, insert it back into the flattened string, and unflatten it back to a cluster, but it will take longer and be much harder to debug than the simple solution.

Message 5 of 10
(2,689 Views)

I tend to put a little effort into the UI even when I think it will only be used by me. It seems like somebody always wants to use it later.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 6 of 10
(2,684 Views)

XControl would be cool, but after I learned about it, I also learned to stay away from it :).  It is a lot of work if I don't absolutely need it. 

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 7 of 10
(2,682 Views)

Looking at the example code, what recommendation do you have on the UI?

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 8 of 10
(2,681 Views)

I would probably typedef all o fyour cluster and then use th ering control like you have. However, I would have a control for each type of cluster that you have and based on the value of th ering control show/hide the appropriate controls. Use the actual cluster type as your input.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 9 of 10
(2,673 Views)

Here is a down and dirty version of an XControl that will edit a cluster

 

there are plenty of improvements that can be made in the xcontrol itself but it demonstrates the idea

- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 10 of 10
(2,665 Views)