LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to change attributes of controls inside an array of clusters

Here is the source of your problems - a color box's color isn't a property, but its value, so if you do have colorboxes, you can place the color box as your color field and wire a different numeric value into each one. That should solve your problem.
There are other properties which can't be so easily simulated - disabled, blinking, NumRows and a million others, and for those it would be nice if there was also an array where we could manipulate the properties for individual elements. Obviously, it would need to be done smartly in order to save on memory.

___________________
Try to take over the world!
0 Kudos
Message 11 of 17
(1,846 Views)
Message 12 of 17
(1,831 Views)
Hi All,

If you take Uncle Bumps example and slide the color box behind the text box AND make the text box background transparent you can use his method to control the background color of the text fileds.


JP,

I do not get this comment.

"
Now you are in fuzzy logic, Ben?
"

It seems nobody was reading my mind so the attached illustrates how to manipulate the elements of a cluster using a for loop.

It uses a initial step that gets the control references of the text fields inside all of the inner clusters. This array of text control references is proccessed inside a for loop to set the colors.

My talepathy is not working as well as it used to. Must be getting old.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 13 of 17
(1,820 Views)
Hello mr. Freijen,

Maybe the blelow attached VI gives you a hint how to do this. I created a cluster with a string input and a colorbox. From this cluster I created a custom control and saved it as a type definition. With the Replace array subset function I replace one element pointed by its row and column index (I used a 2D array to make it fit on the frontpanel) on a button click which ofcourse can be made programmaticaly. In the blokdiagram I can now use a bundle by name function to only access the color box inside of the array element without changing the serial number by using the type definition as type input of the bundle by name. Now you can set a color, give the correct index numbers and the value will be changed inside of the array.

Hope this helps,

Best regards,

RikP
Applications Engineering
National Instruments.
Rik Prins, CLA, CLED
Software Development Engineer
0 Kudos
Message 14 of 17
(1,806 Views)
Rik, I don't think you need to use "type defs".

I've built on your example, something along the lines of what I think freijen's original objective.

(run the example and press the big start button).

Mark H.
0 Kudos
Message 15 of 17
(1,791 Views)
I believe I have an application that does approximately what you want. I didn't use an array though. My test runs up to 6 devices, so I used 6 clusters on the front panel. Each cluster passes through a state machine that manipulates its data (values and colors) and returns the modified cluster to the front panel. Any test station can be active or inactive at any time. Each test is totally independent, but the data acquisition runs continuously as a background task.
0 Kudos
Message 16 of 17
(1,742 Views)
 

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

0 Kudos
Message 17 of 17
(1,647 Views)