LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Library of Custom Controls

I stumbled upon creating custom controls, and they seem perfect for putting together a library of commonly used, but not CVI standard controls for use by my team and I.  I have been able to create a custom control, but I had to make a .uir containing the control, and manually add it to the list of custom controls from the .uir.  I'm wondering if there is a way to share custom controls between multiple machines, without having to manually add the control from the .uir, and include the path to the source, header and template.

 

I want to essentially be able to build my own library of controls, much like the controls that already exist in toolslib\custctrl, and be able to have other people use those controls easily.

 

Thanks,

0 Kudos
Message 1 of 2
(2,677 Views)

It will take a few manual steps first, but you can share your custom controls. The custom controls that you've created for yourself are now saved alongside the ones that are predefined in CVI, so you'll need to remove them from that list and put them in a separate file.

 

You'd need to do the following:

 

  1. Find the file that contains the custom controls that you created for yourself. If you went through the Edit>>Edit Custom Controls dialog, that file should be in C:\Program Data\National Instruments\<your CVI version>\bin\customCtrls.tui.
  2. Find in that file each custom control that you created, then cut that section (the entire section that is named [Panel001_Controlxxx]), and paste it into a new .tui file. You can name that file whatever you like, as long as it has the .tui extension.
  3. In the new file, manually fix up the ATTR_CTRL_TAB_POSITION value of that section, so that each control that you have pasted has a unique number, from a sequence that starts at 0. For example, if you are pasting 3 custom controls, their respective tab positions should be: 0, 1 and 2. It doesn't really matter which has which.
  4. Also copy the header section ([TUI File Header]) and the panel section ([Panel0001]) to the new file.
  5. Save the new file to the following path: C:\Program Data\National Instruments\CVI\toolslib\custctrl\<your file>

After you restart CVI, it should pick up your custom controls, even though you've removed them from the original customCtrls.tui. Assuming that works, you can then ask your colleagues to put that same file in their respective folders, and it should do the same.

 

Unfortunately, whenever someone needs to make a change to a custom control, they'd have to repeat the steps above.

 

A simpler alternative would be to simply share the original customCtrls.tui file with your custom controls already in it, but that would have to be repeated each time someone reinstalls CVI or makes a change to a custom control.

 

Luis

0 Kudos
Message 2 of 2
(2,563 Views)