From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controls and indicators combined in the same array of clusters

Solved!
Go to solution

Hi, all.

In the attached picture you can see an indicator (or maybe, control) that I want to use with the following behaviour:

- It's an array of clusters. Every cluster has a string, a path, and two booleans (a button "Asignar secuencia" and a checkbox).


- I want the first two components to be indicators (the string and the path). I mean, they contain data that it's introduced previously in the application, and I want those indicators only to show that information.


- I want to have a button ("Asignar secuencia") associated to each cluster of the array. When I push the button, I want to perform an action (different for each cluster of the array), so the button must be a control.


- The checkbox has a similar behaviour than the button.

I know there's no way to combine controls and indicators in the same cluster or array. I've tried also with local variables and "value" methods, but I can't solve my problem.

Please, any suggestion?

Thanks,
Francisco

0 Kudos
Message 1 of 9
(5,745 Views)
if you know you can't than you need to split the array to have controls and indicators
Message Edited by Harold Timmis on 11-15-2009 09:32 PM
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 2 of 9
(5,735 Views)

Have a look at the event structure.

If I'm reading your thread right, that's what you can use to get what you want.

 

So for instance, when you mouse-up on a specific button, it will run what's in the associated structure case.

You can wire things in and out as with other structures, have multiple event cases (different button presses etc)

 

Edit:

Alternatively, if you want to keep the clusters etc, you can set the even so it triggers on a mouse down/up etc on the respective indicator.

Message Edited by Hornless.Rhino on 16-11-2009 01:36 PM
0 Kudos
Message 3 of 9
(5,732 Views)

You need to make the cluster a control so the desired controls in it can be operated at all times.

 

Now simply disable the cluster elements that should act as indicators (right-click...advanced...enable stated...disabled) . You can even color and decorate them like an indicator would look (grey instead of white background, hide increment buttons for numerics, etc.)

 

To write to the "indicators", update a local variable of the cluster control.

0 Kudos
Message 4 of 9
(5,707 Views)
Hi, all.

Thanks for your support.

I tried before what you both suggested, but without success. I think the main problem here is that every cluster is an element of an array.

Hornless.Rhino, how can I refer to the different elements of an array in an event structure?

Altenbach, I think I'm not doing it properly, because the control always imposes its value over the one that is indicated to it, because it works in a loop. I attach an example code (LabView v8.6) and a screenshot.

Thanks,
Francisco.

Download All
0 Kudos
Message 5 of 9
(5,685 Views)

Porras wrote:
Altenbach, I think I'm not doing it properly, because the control always imposes its value over the one that is indicated to it, because it works in a loop.

You are approaching this way too complicated. Here's a simple draft, see if it works for you. 🙂

0 Kudos
Message 6 of 9
(5,664 Views)

The code I have attached is actually still too complicated for your purpose. You can move the local variable before the loop and get the same effect.

 

The shown solution is more general: I typically need to recalculate some of the "fake indicators" based on the new controls, so I need to rewrite the cluster control after I substitute the new values in the cluster contained in the shift regsiter.

 

Modify as needed. 🙂

0 Kudos
Message 7 of 9
(5,655 Views)
Solution
Accepted by topic author Porras

Here's a trivially simple example how you would rewrite some of the fake indicators based on changes of the controls.

 

 

Message 8 of 9
(5,650 Views)

Hey, Altenbach, that is very helpful and really cool!

 

Thank you very much!

0 Kudos
Message 9 of 9
(5,640 Views)