04-30-2019 11:10 AM
Hi, all,
I'm an experienced software engineer but 6-months new to LabVIEW, and I'm stumped on how to set up an array or list of controls.
The individual control looks like this:
Each control has behavior associated with it -- the button may be disabled, for example, depending on its data store. The data comes from a remote process. The value of the button and the numeric control (the other is an indicator) will be relayed to the remote process if changed. Thus, one could imagine this gizmo as an XControl.
But, I need to present a vertical array of ~15 of them, manage their contents, and communicate with the remote process in terms of the index into the array. So, for example, if the user turns on on the button in the 6th control, I need to send a message to the remote process like "Enable the 6th alarm". Similarly, if the remote process decides the 11th alarm has triggered, it will send a message that signifies "turn the 11th boolean indicator red".
LabVIEW (2014) appears to reject populating an array with XControls or VIs. If I use a simple cluster, I don't get the events necessary to manage the individual alarm state, both on the UI and in the remote process.
I think I'm missing some basic "handle" on configuring this UI. Assistance or pointers to examples would be most welcome.
--Mark
Solved! Go to Solution.
04-30-2019 11:17 AM - edited 04-30-2019 11:38 AM
So you have an array of clusters. All you need is a single event case for the value change of the array. In it you can figure from the new vs. old what changed and what needs to be done. Since it is operated, it needs to be a control overall, but you can only disable elements that are disabled in all array elements at the same time, so they act like an indicator. You don't necessarily need to disable anything else, but just reset it to the existing value if the user attempt to change or press it while it should not be operated.
Can you attach a small example and explain in more details how things should react to the user actions? (old example)
04-30-2019 12:15 PM
That was the "handle" I was looking for! As a recovering Java programmer, I find it a little strange to iterate over an entire array to find the one value that changed, but the UI cpu has nothing better to do at the time :-).
Thanks for the help!
-- m
05-01-2019 03:38 PM
For reference, here are two of my fancier controls for some complicated 3D optimization code. Event code is remarkably simple (not shown). Some elements are controls (white background, operable), some disabled controls (grey background, act as indicators), some are calculated based on other elements, some filled in after optimization calculations, etc. The number of array elements is variable and can be large, thus the scrollbars.