LabWindows/CVI User Group Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

LabWindows/CVI Tip: Creating Arrays of User interface Controls

LabWindows/CVI 2010 introduced a new feature to create arrays of User Interface controls to perform batch operations or iterate  through controls in the array at run-time. You can also use the User Interface Browser to  interactively manipulate controls in the array. This tip demonstrates how you can interactively create an array of User Interface controls in LabWindows/CVI.

To interactively create a control array, right-click on any UI control on panel and select Create Control Array

create array.jpg

This action will add a new CTRLARRAY to the User Interface Browser.

ui browser.jpg

You can now begin to add multiple UI controls to the array in the following ways:

  1. Selecting one or multiple controls on the panel and then right-clicking to select Add to Control Array»CTRLARRAY
    add multiple controls.jpg
  2. Right-clicking a control name in the UI Browser Window to select Add to Control Array»CTRLARRAY
    add control from browser.jpg

Now that you have generated a control array, you can programmatically interact with the controls using the Control Array functions. To perform batch operations on controls, you can use functions that operate on all the controls in the array. A few examples of these functions are:

  • MoveCtrlArray - Moves all controls in the specified control array to another position.
  • SetCtrlArrayVal - Sets the value of all the controls in a control array to a value you  specify.
  • SetCtrlArrayAttribute - Sets the value of an attribute for all the controls in a control array.

For a complete list of Control Array functions and function Help, refer to the Control Array Library within the labWindows/CVI Library Tree Window.

LabWindows/CVI 2010 ships with an example that demonstrates how to work with arrays of user interface controls. This project is titled Ledctrlarray.prj and can be launched by opening newexamples.cws in the CVI 2010 Samples directory.

You can also programmatically create and interact with arrays of user interface controls using the Control Array functions. For more information on this refer to the Library Reference»User Interface Library»Control Arrays book in the LabWindows/CVI Help.


Regards,
Chris Elliott
x36772
Comments
Paul_Knight_Lockheed_Mart
Active Participant
Active Participant
on

Finally, I have been wanting this ability since I first started using LabWindows 10 years ago.

Contributors