07-11-2017 09:27 AM
Hello,
This might be an elementary question, but I just stumpled upon the 'ledctrlarray' example in LabWindows/CVI.
My issue:
I dont' see the linkage between the 'CTRLARRAY' and all the LED controls on the panel.
The panel is populated with 29 LEDs, a numeric knob, a color control, and a timer. When you call 'GetCtrlArrayFromResourceID' you provide the panel handle and CTRLARRAY and get the control array handle. Then you call 'GetNumCtrlArrayItems' with ythe control array handle and get the number of LEDs on the panel.
How are just the LEDs linked to the CTRLARRAY resource id?
I guesss I am missing how the CTRLARRAY resource id gets into the ledctrlarray.h file to begin with.
Thank you in advance for your input.
Solved! Go to Solution.
07-11-2017 09:37 AM
Sorry just figured it out.
Highlight all the controls that you want in the control array. Right-click on the one of the highlighted controls got to control array and select new. Then name your array.
07-11-2017 09:38 AM - edited 07-11-2017 09:40 AM
Sorry I just figured it out.
Highlight all the controls that you want in the control array. Right-click on the one of the highlighted controls go to control array and select new. Then you can name your array.
07-11-2017 09:38 AM - edited 07-11-2017 09:39 AM
You can see the controll array listed in the user interface browser, to the right side of the UIR editor: after all controls are listed, a Control Arrays item is found that can be expanded to see which controls are included in the array.
This is an important issue, as the order controls are listed in the array defines which control is addressed with GetCtrlArrayItem (ctrlarray, index); Controls can be arranged in the array by simple drag and drop in the Interface browser
Controls can be added to a control array by right clicking on them and selecting Add to Control Array in the context menu.
07-11-2017 09:42 AM
OK I see you already got the answer. But keep my suggestion anyway since the order controls are listed in the array cannot be defined correctly when interactively adding controls: in my experience almost always I need to rearrange them to obtain the desired behaviour.
07-11-2017 09:42 AM
Thank you Roberto. I figured it out just before you replied.