LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create and save custom functions and controls

Hi,

I was previously using LV 6.1 (PDS) but have now moved to LV 7.1 (FDS).
One of the active projects requires me to program in 6.1.

I found some basic functions (e.g. trim white space) and controls (e.g. string combo-box) missing in 6.1
To speed my job, I have either built sub-vis (in LV 6.1) for the missing functions and also had the controls converted to 6.1

My question:
How do I include them into my Functions and Controls palette (in LV 6.1) for easy accessibility while coding?

Thanks for yor help.

- Gurdas
gurdas@qagetech.com
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 1 of 6
(4,412 Views)
you can place them in your user.lib folder and then have access to them under the functions pallette>>user library. Hope this helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 2 of 6
(4,400 Views)
Hi BJD,

Thanks. It worked partially.
I placed the sub-vi created for trim whitespace in user.lib and it showed up in my functions palette.

1) How do I make it showup in the same place as in LV 7.1? That will help others look for and find the function in the obvious place.

2) How do I add the control to the controls palette? The control ins question is "string combo-box" in the attached vi.

Thanks,
Gurdas
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 3 of 6
(4,387 Views)
Hi Gurdas,

To add your control or VI to your palette in LabVIEW 6.1 is a little bit different than in LabVIEW 7.1. Instead of editing the palettes through the "Tools >> Advanced >> Edit Palette Views...", in 6.1 you will have to attach the Functions or Controls palette with the pin and then click on the Options button. Choose the palette you want to edit and click "Edit Palettes...". You should then go to the sub-palette that you want to add the VI or control in, right-click and choose "Insert >> Custom Control(s)..." or "Insert >> VI(s)". After selecting the control or VI that you want to insert, save all changes and restart LabVIEW. Your custom control/VI will now show up in the palette where you selected it:



Have fun!

Message Edited by Philip C. on 06-16-2005 01:33 AM

- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 4 of 6
(4,368 Views)
Hello Phillip,

Heres the update:

1) I am unable to insert functions/controls to any of the existing LV palettes. I did manage to insert (and successfully use) functions into the user palette for block diagram.

2) The control (see attached) I inserted into the user palette shows on screen but I am unable to select and drop it onto my front panel. Is there something additional I need to do?

Thanks,
Gurdas
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 5 of 6
(4,335 Views)
Hi Gurdas,

I apologize for not specifying everything necessary to add the custom control to the palette. Here are the reasons for your two issues (notice that they are answered in reverse order):

2: The reason that you can't drag and drop your "control" when it's in the palette is that it's not a custom control! Yes, the name has the extension "*.ctl", but the way you created it was not the way you are supposed to create a custom control. My guess is that you took a VI and saved it with the *.ctl extension, because there's a block diagram associated with it ("Window >> Show Diagram"). Custom controls do NOT have a diagram and they are created using the following procedure:

In any VI, select a default control on the front panel that you want to customize. Right-click and choose "Advanced >> Customize...". This will open the Control Editor, and you can now do all the customization you want to the control. Click the "wrench" tool to perform advanced edits of the control. When you are satisfied with the customization and want to save the control, just close the Control Editor and click "Yes" when prompted to save the control. Congratulations - you have now successfully created your first real custom control.

1: When editing palettes, you can't edit any of the default palettes. Therefore you have to create your own palette first. To create a custom palette, follow the steps in the previous post until you have clicked the "Edit Palettes..." button. Choose the palette that you want to use as a starting point for your customized palette (e.g. "default") from the "Palette View" ring. Then choose "new setup...", enter the name of your new palette and hit "OK". You can now insert your control anywhere in the Controls Palette or VIs anywhere in your Functions Palette.

I sincerely hope that this thorough explanation makes it possible for you to conquer the LabVIEW palettes...

Have fun!
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 6 of 6
(4,317 Views)