LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

copy local variable without duplicate front panel item

Solved!
Go to solution
whenever I copy and paste a local variable in the block diagram, LV automatically duplicate the front panel which is really annoying ...is there anyway to make it stop duplicating from the front panel?  I look all over the place but maybe I missed something ...gee where could this setting be?
0 Kudos
Message 1 of 13
(13,177 Views)

One way to avoid this problem is to insert a local variable from the menus and not by right clicking on an indicator/control and creating one.

 

If you insert from the menu, then the local variable is not assigned to any control/indicator and a '?' appears in the local variable. You can copy /paste this without duplicating anything on the front panel since this local variable is not associted with any control/indicator. You can then easily left click on the copied local variable and select the indicator/control you want to associate it to.

 

I have attached a screen shot also to clarify this aspect.

 

Hope this helps.

 

Regards

 

 

Message 2 of 13
(13,169 Views)
Solution
Accepted by lavalava
There are two ways to copy objects in LabVIEW. Obviously one is the regular copy and paste. You can also hold down Ctrl and click and drag any item in LabVIEW to create a copy. It's not only quicker, but this copy mechanism can be used for Local Variables and bound Property Nodes without copying the associated control too. Check it out!
Jarrod S.
National Instruments
Message 3 of 13
(13,163 Views)

Instead of Copy-Paste, you can do a Ctrl+Mouse drag operation to make a copy of that local var without getting duplicated on the FP.

Then, if you wish to connect it to some other variable, lt-click on it & select the variable of your wish, thats all.

- Partha ( CLD until Oct 2027 🙂 )
Message 4 of 13
(13,161 Views)

Mani,

 

When you have 50 to 100 objects, not just local variable but any objects in a given panel, this method becomes obviously very cucumbersome.  And this is exactly what I have been doing.  Thanks though.  Thanks guys, Jerod's suggested trick works great.


Message Edited by lavalava on 10-23-2008 10:14 PM
Message 5 of 13
(13,121 Views)
This was reported to R&D (# 119648) for further investigation.  Jarrod's suggesting of holding down CTRL and dragging out copies is probably the best workaround in the meantime.  Thanks for the feedback!
Eric V
National Instruments
Applications Engineer
Certified LabVIEW Associate Developer


"I'm a Ramblin' Wreck from Georgia Tech and a helluva (NI Applications) Engineer!"
0 Kudos
Message 6 of 13
(12,847 Views)

I know this is an old thread, but this is something that has also been frustrating me for a long time. Has NI made any progress making actual copy and paste of local variables possible (not just CTRL-Drag)? If there is a particular group of programmers that prefer it the way it is, I think it would be better if there were a Preferences Menu option for this, to allow us to turn this feature on or off depending on preference perhaps?

0 Kudos
Message 7 of 13
(11,191 Views)

@R.Gibson wrote:

I know this is an old thread, but this is something that has also been frustrating me for a long time. Has NI made any progress making actual copy and paste of local variables possible (not just CTRL-Drag)? If there is a particular group of programmers that prefer it the way it is, I think it would be better if there were a Preferences Menu option for this, to allow us to turn this feature on or off depending on preference perhaps?



I think the current behavior is entirely sufficient. How many copies of local variables do you possibly need! 😮 Also remember that you can paste to a different VI, where the local variable would not make sense without associated control.

 

However, if you think you have a good idea for a new feature, the LabVIEW Ideas Exchange would be the right place to post it.

 

(There are already some related ideas, for example Fix Copy/Paste for property nodes, local variables, etc)

 

 

0 Kudos
Message 8 of 13
(11,186 Views)

It's not that I need a lot of copies, its simply a matter of convenience and efficiency of time utilization. When I want to copy a block of code that uses local variables from say, one state to another in a state machine, historically I have made a bunch of unassigned local variables off on the side of the page that I can drag in and asign as needed. However that required me to essentially re-invent the wheel (code block) each time (not convenient or fast).

 

After reading this thread, I tried doing the CTRL-Drag trick, which is certainly more convenient, in that I can copy the code block off page, then change states (cases) then copy (or move) the code block into the new state. However, this requires scrolling the workspace to make room for the temporary storage of the coppied code block...again, simply inconvenient and an inneficient use of my time. Not that it's a lot of time, but it all adds up. When you have limited time to complete a project, minimizing these inefficiencies can be critical. IMHO, this is what the clipboard is for. If we could simply use CTRL-C and CTRL-V, it would be much more convenient!

 

You are right about Property Nodes having the same issue...I just deal with them less frequently, so it wasn't at the top of my list. 😉

Message 9 of 13
(11,175 Views)

@altenbach wrote:

Also remember that you can paste to a different VI, where the local variable would not make sense without associated control.

  



Does a copy-pasted Property Node pastes the associated control or creates a new control/indicator in another VI, or at least in the same VI? Does that make sense? Smiley Happy

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 10 of 13
(11,162 Views)