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.
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.
11-15-2009 07:59 PM
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
Solved! Go to Solution.
11-15-2009 08:30 PM - edited 11-15-2009 08:32 PM
11-15-2009 08:33 PM - edited 11-15-2009 08:36 PM
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.
11-15-2009 11:29 PM
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.
11-16-2009 05:45 AM
11-16-2009 10:25 AM
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. 🙂
11-16-2009 10:41 AM
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. 🙂
11-16-2009 10:50 AM
Here's a trivially simple example how you would rewrite some of the fake indicators based on changes of the controls.
11-16-2009 11:15 AM
Hey, Altenbach, that is very helpful and really cool!
Thank you very much!