LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Community Nugget 03/25/2007

On occasion, you might wish to have a reuseable piece of code, but one where the piece of code itself is available and not the code as a subVI.
 
LabVIEW has a useful feature for doing this - you can place a VI in your palette and configure LabVIEW to place the VI code in your diagram when you click the VI in the palette.
 
The easiest way to do this is to place your VI in the LabVIEW\user.lib folder where it should be available in the user.lib palette after you restart LV.
Then, go to Options>>Advanced>>Edit Palette Views. This should bring up the functions palette. You can not edit the built-in palettes, but if you go into the user libraries palette you can add VIs and folders from any place you wish. You can also right click any VI and select the Merge VI option. Once you do that, each time you select that VI in the palette, it will allow you to place its code directly in the diagram of the VI you are editing.
 
 
Note - there is a way to edit the built-in palettes, but as far as I know it is not officially supported by NI. If you go into the LabVIEW\Menus directory, you should see a list of directories of your configured views (often this will be "Default" or "Dynamic"). If you go into the folder of the view you are using, you should find a file called "readonly.txt". Renaming this file will allow you to edit the built-in palettes.
 
I have used this, for example, to add some useful VIs to the structures palette or the .net palette. Attached are a couple of examples of code which are useful to make some quick VIs for testing things. I placed these in my structures palette for easy access. The VIs themselves are saved in a directory called "_Structures" inside the user.lib directory (the underscore tells LV not to display the folder in the palette).
If anyone has any examples they think will be useful, they are also welcom to upload them.
 
For a list of past nuggets, see here.
If you want to write a nugget yourself, see here.

Message Edited by tst on 03-25-2007 09:32 PM


___________________
Try to take over the world!
Download All
Message 1 of 21
(10,150 Views)

Hi tst,

Very useful one indeed... !

I think the att VI in LV 7.1 will be useful for trimming the empty spaces of a Str or Str Array, and getting both Str & Str Array outputs at a time... Smiley Happy

Why not even a single reply yet, after a whole day... ?! Smiley Surprised

- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 2 of 21
(10,073 Views)
Great post tst,
 
Once again another nugget has shed light on a region of LabVIEW I was not aware of.
 
After finishing a few tests today I'll be sure to take a look at this and try and apply it some way for an example Smiley Tongue
 
 
 
I am also amazed at the lack of activity on this nugget...hmmm Smiley Indifferent
0 Kudos
Message 3 of 21
(10,063 Views)
Cool!  Thanks.  Always thought 'there oughta be a way to...'.

Matt
0 Kudos
Message 4 of 21
(10,031 Views)
Great nugget TST! thanks for the info.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 21
(9,972 Views)

As of version 8.5 (not sure about 8.2.1), the Merge VI text has been replaced with Place VI Contents.

Richard

 

 

Richard






Message 6 of 21
(8,787 Views)

Richard,

Can you tell me where the Place VI Contents option is present?

- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 7 of 21
(8,353 Views)

Richard,

Found it! Smiley Happy Sorry to have bothered you.

- Partha ( CLD until Oct 2024 🙂 )
Message 8 of 21
(8,347 Views)
By the way, for anyone wondering - the option was renamed because in 8.5 NI added a tool for merging VIs.

___________________
Try to take over the world!
0 Kudos
Message 9 of 21
(8,327 Views)

I am having a little bit of trouble with installing this library.

 

I have a library that I got a while back for a Thermocouple Input Device, and I installed that no problem.

The only issue is, I forgot how I did it before.

 

Now I am trying to install the following driver from NI's website:
http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=1FB66B354ED149C7E0440003BA230E...

 

 

This is what I am doing, correct me if I am wrong:

1) Copy the ENTIRE folder into :  ......\program files.......\LabVIEW\user.lib

2) Go to LabVIEW >> tools >> advanced >> edit palette set

3) In Palette, i go to user libraries

4) right click and press "insert _________"

 

step 4 is where I am stuck.

could i get some help? 

Cory K
0 Kudos
Message 10 of 21
(7,405 Views)