Copying Local Variable in LabVIEW Creates Copy of Front Panel Object

Updated Mar 22, 2018

Reported In

Software

  • LabVIEW

Issue Details

How do I copy a local variable without copying the corresponding control?

Solution

There are at least three ways to copy local variables - the first noted below solves the problem:
  1. Highlight, Hold Down CTRL, LeftClick+Drag+Release - this method is also common in Windows (such as with copying files to new locations). This will also work in LabVIEW (on Windows), and using this technique to create a new copy of a local variable will NOT cause the corresponding control to be copied.
  2. Local Variable object from the Structures Palette - this method can be used to obtain an "empty" local variable (one which does not reference a control, yet). To associate that instance of a local variable object with a given control, either click on it with the operating tool (the auto-tool should choose this, the little hand with a pointing finger, by default) and select the control you want the variable to reference from the list, or right click on the local variable object, choose Select Item, and then choose the control you want the variable to reference from the list.

Additional Information

Using the traditional copy option in LabVIEW adds the local variable to the clipboard, making it available for pasting in other VIs. Because a local variable must always have a control or indicator associated with it, these objects are pasted with the local variable, regardless of whether or not they are pasted in the same VI.

CTRL+C and CTRL+V - this method is the classic copy and paste method used to perform many operations in Windows. This will work in LabVIEW (on Windows), however, using this technique to create a new copy of a local variable WILL cause the corresponding control to be copied as well.