Coloring elements in array of clusters

Hi,
I have an array of clusters.
My goal is that each element(cluster) in the array will have a different background color.
I tried to use the color property node but it changed the color of  all the clusters(not only of the desired element).
How It can be accomplished ?
(snapshot of the array is attached)
Thanks,
Leonid
Solved!
Go to Solution.
Attachments:
array.PNG ‏14 KB

See also my posts here and here.
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Drag And Drop Element Of Array Of Clusters

    I have a project that includes an array of "tests", each of which is a cluster containing an array of "part numbers", a regular expression matching string and an array of "test tasks" (each of which, is in turn, a cluster of elements).
    That is:
    Tests (array of):
    Cluster:
    Part Numbers (array of strings)
    Regex (string)
    Tasks (array of):
    Cluster:
    Task type
    Base Channel,
    Measurement Channel
    Other Channels
    I'd like to be able to drag and drop to re-order the task array within an individual test.  (It's a nice-to-have rather than an urgent request - more for my own learning than anything).  For now, I've implemented "Move Up" and "Move Down" buttons.
    The examples are fine for a single cluster that includes an array, or for an array of objects.  As soon as we have an array of clusters, it's hard to access the individual elements within a specific cluster.
    Has anybody successfully implemented drag and drop within such a setup?
    Curiously,
    Geoff
    Geoff Field, BE, CLAD, MIEAust
    Professional geek, amateur stage-levelling gauge
    Solved!
    Go to Solution.

    Hello GeoffF,
    This is definitely doable, and you can even use the standard start drag and drop methods/events, the tricky part is determining the array elements that are being selected on mouse up/mouse down and handling the swap manually.  Luckily, there are a couple decent examples of how to do this out there already, I'd suggest you take a look at this one:
    Community Example: Determine Clicked Array Element Index in LabVIEW
    https://decibel.ni.com/content/docs/DOC-22434
    That should give you the selected array indices, and then all you have to do is switch the elements around around in the drop event.  I've attached a very basic demonstrative example that uses that code I just linked (you'll need to download that as well) and the events mentioned to swap two array elements.   The attached code is just thrown together, you'll want to design something more robust and scalable for any sort of real use.
    Regards,
    Tom L.
    Attachments:
    array drag.vi ‏21 KB

  • Array of clusters and in the cluster is a bar meter, how can I change the color individually?

    Array of clusters and in the cluster is a bar meter, how can I change the color of the bar meter individually for each element of the array?  I have just figured out that you can't change properties of one element of the array without all elements changing.  For the scaling I had to make numeric indicators for each tick of the scale so that each bar meter in the clustered array would have individual scales.  I also had to do some math to scale each barmeter to display correct proportions from 0 to 100%.  Now I'm stumped on the color of the bar meter.  Basically, if the value goes over a setpoint, the bar meter needs to turn red.  It has to be in an array to be infinitely scalable.
    Thanks
    Matt
    Solved!
    Go to Solution.

    You can't do that-
    without a little trick.
    You could consider laying a custom color box over the bar graph in the cluster you can set the color based on the value of the bar graph or even make a "Pseudo"- bar graph using a series of color boxes stacked to look lie a bar and changing values of the Color boxs from empty to full to red.
    Here is an example to demonstrate
    Jeff
    Attachments:
    Pseudo bar.vi ‏12 KB

  • How to change the color of Numeric array elements (seperatel​y) programmat​ically using property node??

    For example, i have 3 numeric controls, controlling 3 numeric array elements (Numeric control is connected directly to indicator). Then if i change value in numeric control 1, then the array element No.1 of numeric array should turn red when value exceeds 5. Similarly when i change num control 2 then element 2 of array should turns red when value in num control 1 exceeds 10. Similarly for 3rd element. In other words, i want to control the property of array elements individually through seperate numeric control.
    I have done it for single numeric indicator.i.e. when i change numeric control's values then a single numeric indicator changes values and color (Numeric text BG property) but with array, the color of whole array changes but i want to change color of singles element of array.
    Please help thanks.  
    Solved!
    Go to Solution.

    ...or replace the numerics with clusters that have a numeric and a color box. make the background of the nmeric transparent and slide the color box behind the numeric. Use the color box to control the background color.
    Other alternatives would use a cluster instead of the array or if your req's are really weird "roll-your-own" with a Picture control.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Change properties of a cluster element withing an array of clusters

    Hello all,
    I have an array of cluster that is shaped as a line with different display elements.
    A list or a tree wouldn't have made it, so I had to use a cluster and make a table.
    The problem is that I want to change not only the text but also the text color.
    Individually.
    I found this :
    http://www.ni.com/example/30904/en/
    But it change the property in all the clusters in the array, not just the one I need.
    Some people have the same problem :
    http://forums.ni.com/t5/LabVIEW/Reference-to-Array-of-Clusters-with-an-array-element/td-p/1006427
    http://forums.ni.com/t5/LabVIEW/Different-set-of-values-for-two-rings-in-an-array-of-clusters/m-p/10...
    http://forums.ni.com/t5/LabVIEW/array-of-clusters-get-references-to-all-the-clusters/td-p/1079456
    http://forums.ni.com/t5/LabVIEW/How-can-I-reference-the-properties-of-a-control-in-a-cluster-in/m-p/...
    http://forums.ni.com/t5/LabVIEW/Writing-only-to-certain-cluster-elements-in-an-array-by/m-p/2200728
    http://forums.ni.com/t5/LabVIEW/Update-Properties-Of-One-Control-In-An-Array/m-p/3015501
    http://forums.ni.com/t5/LabVIEW/Array-of-clusters-and-in-the-cluster-is-a-bar-meter-how-can-I/m-p/15...
    http://forums.ni.com/t5/LabVIEW/Property-node-of-a-control-inside-of-cluster-inside-an-array/m-p/946...
    Obviously, while in a list/table or tree you can change the property of an individual
    cell (font, color) you cannot do it within an array of cluster, by some sort of magic,
    the property of a cluster element (font, color) are all linked together, hence rendering
    the use of an array worthless.
    A possible hack is proprosed by using control masking, setting one visible and the
    other invisble, swapping their position, whatever. It's a hack you have to perform,
    hence add another code to maintain.
    Is that still the case or is there now a more official way to handle individual cluster
    properties, not just its data ? After all that's a common real-life example that should
    be handled by Labview. In my opinion.
    David Koch
    Solved!
    Go to Solution.

    altenbach wrote:
    One of the elements could be a 2D picture indicator of about the same size. You can write text in any color using picture functions.
    Here's what I had in mind. Seems to work just fine (I would fine-tune the font, picture border, etc. but this should get you started).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ColorText.png ‏13 KB
    ColorText.vi ‏9 KB

  • Array of clusters TAB next element

    I have an array of clusters and I want with the TAB key, when I am at the last element of the cluster i, move to the first element of the cluster i+1.
    Jean-Marc
    Jean-Marc
    LV2009 and LV2013
    Free PDF Report with iTextSharp
    Attachments:
    Array of clusters.jpg ‏132 KB

    Thanks for they answers.
    My problem is the triple TAB (TAB -TAB -TAB) to change the array line  i to i+1.  
    Click on an element in the array and move with the TAB key.  When you  are at the element "VOC":
    - the first TAB (event "<VOC>:Key Down?" ) generate CTRL +UP (return to tabbing among front panel controls -return to CLUSTER at line i);
    - the second TAB (event "<Cluster>:Key Down?" - sequence through the array- move to the array line i to line i+1)
    - the third TAB (event "<Cluster>:Key Down?" )generate CTRL + DOWN ( move the key focus inside the array or cluster -move inside the cluster at the line 1+1);
    I try to reduce the number of TAB.
    Jean-Marc
    "Complete the following steps to
    use the <Tab> key to move through elements within a single array
    or cluster when you run a VI.
    Display the front panel. While the VI is running, press the <Tab> key until the array or cluster is highlighted.
    Press the <Ctrl> key and the down arrow key to move the key focus inside the array or cluster. (Mac OS) Press the <Command> key. (Linux) Press the <Alt> key.
    Press the <Tab> key to sequence through the array or cluster elements and the array indexes.
    To return to tabbing among front panel controls, press the <Ctrl> key and the up arrow key. (Mac OS) Press the <Command> key. (Linux) Press the <Alt> key."
    Jean-Marc
    LV2009 and LV2013
    Free PDF Report with iTextSharp
    Attachments:
    Tab Array Clusters LV8_0.vi ‏94 KB

  • Sort 1D array of clusters by the second element in the cluster

    Hello Folks,
    I need to sort 1D array of clusters [Point (X & Y)] using the second element (Y) of the Point cluster. Can anyone guide!!!!
    Thanks.
    Manu

    I see Darren is a bit faster than me.
    Here's my solution (LabVEWI 7.0), it is pretty similar.
    Message Edited by altenbach on 03-22-200602:01 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SortByElement2.png ‏4 KB
    SortByElement2.vi ‏27 KB

  • Type defined array of clusters for holding configuration data - setting default values for each array element

    Hi,
    I was wondering if I could get some information and opinions about using a type defined array of clusters to hold configuration data.  I am creating a program to test multiple DUTs and wanted to have a type defined control for each DUT containing the information needed to create the DAQmx tasks for all of the signals for that DUT.  I am wanting to do this so that the data is hard-coded and not in a file that the user could mess up.
    The type def controls are then put in a subVI that chooses the appropriate one based on the DUT Type enumeration wired to a case structure.  
    I am having problems with the type defined control.  I am seeing issues when attempting to save a unique configuration to each array element in the array of clusters.  Somehow it worked to begin with, but now clicking "Data Operations --> Make Current value default" on individual elements of the cluster or the entire cluster (array element) is not saving the data when I re-open the type def control.  What am I doing wrong?  Am I trying to do something with arrays of clusters that I should not be doing?
    I have attached one of the type defined controls for reference.  I tried changing it to Strict to see if that helped, but no luck.
    To reproduce, change the resource string for array element 0 and make the new value the default value.  Then close the type def, and re-open it.  The old value is still present in that element.  The VI is saved in LabVIEW 2012.
    Solved!
    Go to Solution.
    Attachments:
    CM_AnalogInputs.ctl ‏11 KB

    Values of a typedef are not proprigated to instances of the control. THey will pick it up if created AFTER the data values have been changed. THey will not get updated with future changes. You should either create a VI specifically for hardcoding your values or implement a file based initialization. The file based would be much better and more flexible. If you don't want users to modify the data simply encrypt it. There is a noce blowfish library you can download.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Reference to Array of Clusters with an array element

    Hi,
    I have an array of clusters CONTROL (calling it as "top level cluster array") with one of the cluster elements being a cluster array (please see attached).
    I plan to pass "Reference" of this top level cluster to different VIs (like add element VI, insert element VI, delete element VI etc) and access (add/modify delete) the elements in this array.
    In my code, how do I typecast the Array Element (cluster) to the inner cluster (as shown in the figure) ?
    I am using LV RT on PXI.
    Solved!
    Go to Solution.

    You cannot use references in the same way that you use pointers around in C. LabVIEW does not manage memory in the same way that C does. This is actually a good thing, though C programmers find it "cumbersome" or "restrictive". I have also programmed in C, and frankly I prefer LabVIEW's memory management any day of the week.
    You had not initially mentioned that this was going to be done in multiple places at (potentially) the same time. Given that, my recommendation is to look into using Action Engines. They provide a means of basically providing a one-location acccess for your data. By using a single VI to access/modify your data you preclude the generation of race conditions. You may also want to join this with the concept of using variants to provide a means to quickly find your data rather than looping to find the element you're interested in. This technique has been around for a while and it has been discussed before. There are examples floating around. Will need to check to find one. 
    As for your question regarding using the reference method which you tried to employ in your initial approach, that's simply not going to gain you anything. You will still be creating buffers when you try to access the cluster elements. But you already have this information in the array inside the outer for loop, so you're just creating unnecessary extra programming for yourself. 

  • Accessing button properties in an array of clusters ...

    I have a situation whose solution is eluding me.
    I built an array of clusters (15 of clusters in the array). Each cluster is a boolean LED control and a path control.
    The array is wired to various VIs. One of these VIs is supposed to
    select a path from the array and then change the color of the LED that
    is clustered with that path. The path part works because I am reading
    the value of that array element. The problem is that I don't know how
    to get to the associated LED properties.
    I have used several approaches, but in all cases: when I change the color of the target LED, all 15 LEDs change color.
    Inside of a while loop with indexing enabled, I have unbundled the
    current cluster and then tried to apply a property node to the LED
    element but all LEDs change color.
    So the question is - How do I access the individual LED properties in an array of clusters?

    In an array only the values can be different for different elements. The properties are the same for all elements.
    You can work around this by using a color box, which has the color as the value.
    Here is an example of a color box customized to look like a LED with an explanation of how it was created.
    Try to take over the world!

  • Programmatically changing string text color in an array of string indicators

    Hi,
    I have an array of string indicators and I'm trying to format certain values different colors.  While I'm able to do this on a single string indicator I can't figure out how to handle the indexing of the array.  I have seen several examples with array of clusters but I am unable to translate to array of string indicators.
    Any help would be appreciated.
    Regards,
    ShotSimon
    Attachments:
    Changing text color in an array of string controls.vi ‏9 KB

    Instead of a string array, where all elements have the same format, you should use a table, which basically behaves as a 2D string array. But there, you can adjust all text attributes (if you are using LV 8.x). See this thread
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Colorbox control in an array of clusters

    hi, im working on labview 6. i have an array of clusters. the cluster has eight elements. one of them is a colorbox control. I want this colorbox control to have only 4 colors i.e, the user has a choice of only 4 colors if he clicks on the colorbox control. can ihave such a control?

    Hi Pavitra,
    Use labview Help to guide you.
    Or else,
    A new picture ring control or text and picture  ring control has one item with an empty picture display. You must copy a picture to the clipboard before you can import the picture  into a ring control. LabVIEW can import all graphic files your graphics software supports.
    Complete the following steps to import pics  into ring controls.
    Copy a picture to the clipboard.
    Right-click the ring control or text and picture ring control and select Import picture from the shortcut menu.
    Copy another Pictureto the clipboard.
    Right-click the ring control or text and picture ring control and select Import picture Before or Import picture After from the shortcut menu.
    Use the Operating tool to click the picture box to view all imported pictures
    regards
    Dev

  • Control labels in an array of clusters

    Here is something that keeps coming up and now I have time to see if I can find a solution.  I often have an Array of Clusters of some sort in my LabVIEW programs.  They are super convenient, but one annoyance I have is that the labels have to be in each element of the array or have no labels at all.  Is there a way to have the labels only appear in the first element and then hidden for all other elements in the Array?  This would save a lot on front panel real estate.
    The best I have been able to come up with is turning off the labels all together and adding labels above the Array control.

    Ravens Fan wrote:
    I don't think you can change free labels.  But you could add the labels as being other elements of your cluster, using classic string controls and color them transparent.  Arrange the new strings so that they look like labels for your other cluster elements.
    How does it help solve the problem? I'm not sure if I've got the problem right. So please correct me if I'm wrong. So, the problem here is that labels come in all the elements of the array of clusters, like here:
    What I'm I think you're suggesting Raven, is to add some more labels into the cluster, like in the next pic, I have unchecked the label of numeric control "test 01" and added a free label instead.
    What I understood from the OP is that the cluster labels should be visible only in the first element and not in the rest. I think that would look kind of unbalanced. However a work around would be add free labels outside the cluster, by customizing the array. Or just adding free labels on the front panel and grouping it along with the array like this:
    So, am I barking up the wrong tree?
    Message Edited by NitinD on 30-08-2009 10:07 AM

  • Using Event Structures with Array of Clusters

    Using LabVIEW 8.5
    Hi all,
    I'm trying to convert an existing application to one that can be used
    through a touch screen. I updated the UI and added an event structure
    to listen for mouse ups on controls that require a HMI keyboard or
    numpad to show up. Although I've been programming for a while, I'm new
    to LabVIEW and am struggling with a problem:
    Is there any way to have an event case listen to an event within
    arrays? I've seen a few examples on the forums, but they all start with
    breaking up the arrays into individual variables. Using the variables,
    they build arrays. This seems pretty tedious, and I'm pretty sure I
    can't apply it to one of my arrays. Essentially, I just want to know
    which cluster in which array the user has clicked on, so I can open the
    HMI keyboard or numpad and send the text to that cluster. In my watered down app (Array of Clusters.vi), I've put 3 arrays of clusters and a few stand-alone controls to give you guys an idea of what I'm taking about.
    BTW, I'm using the HMI Keyboard and Numpad built by the Beta Community (http://decibel.ni.com/content/docs/DOC-1062) and modified it to add a "Clear" button to the keyboard and numpad. Please let me know if I implemented this in the best way.
    Thanks for the help,
    Kunal
    Message Edited by bhatiak on 08-04-2008 03:55 PM
    Attachments:
    Array of Clusters4.llb ‏274 KB

    My old tic tac toe example shows how to determine which square of a 2D array has been clicked.
    http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=247044#M247044
    You probably can adapt some of it for the arrays on the right. If the array can be scrolled, you also need to account for the "indexvals" offset.
    The Layers controls is easiest, because you only show one element. Just read the "index vals" property to get the array element and parse the coordinates to get the cluster element.
    btw: the small while loop on the right serves no purpose at all and acts just as a CPU burner. You can delete it without any change in functionality. Is there anything else to it?
    LabVIEW Champion . Do more with less code and in less time .

  • Control mouseover image does not display when contained in an array of clusters.

    I have been using system booleans (with some customization) for the ability to impement mouseover animations.  For example (default system booleans):
    The mouseover feedback works well with my UI, and for the most part everything is going great.
    However, the mouseover image does not load if the the boolean is contained within an array of clusters (a single cluster with the boolean inside or an array of booleans works as expected):
    The mouseover animation does work for a single array element in the above case (the one which was most recently clicked), but this behavior isn't desirable and it seems buggy if I were to leave this on my UI as it is.
    So I guess I'm just wondering if anybody has encountered this or has any suggested workarounds?  The few that I've thought of so far (maintain a separate array for any set of system boolean controls, check coordinates myself on mouse move event and try to update the proper element in the array, avoid using mouseover animations entirely for this set of controls) aren't all that desirable.  Even though this issue could be considered cosmetic, the UI is very important to me as this code is something shipped to customers.
    This is LV 2011 by the way, so if by some chance the behavior in 2012 is correct please let me know (this alone might be reason enough to convert the project up).  If there is a CAR ID for this behavior and an NI employee wishes to share it I would also appreciate that.
    Best Regards,  
    John Passiak
    Solved!
    Go to Solution.

    Hey Jason,
    A reproducing VI would be any VI that contains an array of clusters with a system control boolean inside.  Here's an example:
    Single Boolean, Single Cluster, and Array of Booleans all show the proper mouseover image.
    Array of Clusters always shows the mouseover effect on the last element which was clicked, but does not show the mouseover effect on other array elements (actually, it seems to be inconsistent--every now and then it does show the mouseover effect on other array elements but it is not at all reliable).
    Best Regards,
    John Passiak
    Attachments:
    MouseoverTester.vi ‏9 KB

Maybe you are looking for

  • Using local language to display a form

    I have developed an application which has a user registration form containing name, age, sex etc. As I am an indian, I want the form to be in our language i.e hindi. How can I do this? Please give some ideas.

  • UTF-8 characters in database

    Hi there, I'm having problems with UTF-8 characters displaying incorrectly. The problem seems to be that the Content-Type HTTP headers have the character set as "Windows 1252" when it should be UTF-8. There is a demonstration of the problem here: htt

  • HT203164 how do you fix burn itunes burn error code 4000?

    How do you fix the error code 4000 when burning?

  • Transaction boundary(demarcation) in Servlet

    Hello, pls provide information on this: In session bean, we can define the transaction boundary like this: UserTransaction ut = sessionContext.getUserTransaction(); ut.begin(); //some coding here....... ut.commit(); Can i do this in servlet and jsp?

  • Photo print quality from the HP EVEN 5532

    I have tried a number of times to print off a photo from my Envey 5532 printer, Using 6 x 4 sizes glossy paper. The out come is what I can only call a disaster, what comes out from the printer is a total mess, it looks as if to much ink has been spra