Practical LabVIEW Details

Some LabVIEW hints

Clusters

When creating a Cluster, create it by using a strict typedef inside a control file “*.ctl”. If you change the cluster, it is sufficient to press the “apply changes” button in the “file” menu. When using the cluster, do not use the normal “bundle” and “unbundled” Vis. Instead use the “bundle/unbundle by name” Vis. This minimizes the necessary changes in the Vis using the cluster in the case you have changed the cluster. The “bundle by name” VI needs an input cluster. If you do not have a control with that cluster type, you can take the input cluster directly from the typedef. However, you have an additional control on the front panel that you can hide using (in the diagram) a right mouse click -> hide indicator on the control.

Shortcut keys

LabVIEW provides many shortcut keys. Only the most frequently used ones are listed here.

Ctrl+B removes all broken wires.

Ctrl+E lets you change between diagram and front panel.

Ctrl+H displays the on-line help.

Ctrl+I goes directly to the VI properties.

Ctrl+L displays error list window.

Ctrl+R runs a VI.

Spacebar toggles between two most common tools (if automatic tool selection is disabled).

Tab cycles through tools (if automatic tool selection is disabled. Otherwise enables automatic tool selection).

Documentation

For a VI, always write documentation in the VI properties->Documentation. For a control, always write a description (right mouse click on the control->Description and Tip). By this, the documentation becomes available in the on-line help.

Pitfalls

Save As

A VI knows by whom it is called and the callers have an explicit path to the VI they are calling. If a VI is saved with the option save as, you do no just create a copy. Instead all paths of all callers are updated to the new location of the VI where you did the “save as”. If you want to create a copy, you have to check the “save copy without updating callers” checkbox. Be careful: If you use the standard "save as" of LabVIEW, only the callers that are in memory are being updated.

Names

LabVIEW VIs must have unique names. There must never be more than one VI with the same name in memory (LabVIEW takes care about that). Problems arise, if you have given the same name to two different sub-VIs C and D. Assume, you have two main VIs A and B. VI A calles VI C and VI B calls VI D. Now you load VI A and by this sub-VI C. If you now load the VI B there is a conflict, since the sub-VI D has the same name as the already loaded sub-VI C. LabVIEW solves this conflict by automatically replacing the sub-VI D with the sub-VI C. And this is probably not what you want. Even worse: If you now save (accidentally) the VI B LabVIEW saves with a call to sub-VI C. Use unique names!

Multi-Threading in LabVIEW

Please check a dedicated How-To.

-- DietrichBeck - 06 Jul 2005

This topic: CSframework > WebHome > Documentation > CsDocMain > CsPracticalLabviewDetails
Topic revision: 2005-07-06, DietrichBeck
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback | Legal notice | Privacy Policy (german)