LabVIEW

cancel
Showing results forΒ 
Search instead forΒ 
Did you mean:Β 

Why we cannot copy-paste a control from a BD to a FP?

I always accepted this as a "default behavior". But really, why this cannot be done using LabVIEW? I often face the following scenario:

  1. you are looking at a BD, then you select a control here, and use "Ctrl+C" to copy.
  2. Now you cannot "Ctrl+V" this into any FP, only in BDs!

Strangely, the other direction works however: if you select and "Ctrl+C" a FP control, you get its constant version in a BD when you do "Ctrl+V".

But why we cannot copy-paste a control from BD to FP? This would be also useful when we open a Typdef cluster, and we want to paste a copied control from the BD. No, it does not work, only from the FP!

 

EDIT: oh yes, it is not only me, fire your Kudos people! πŸ˜„

https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Copy-control-from-BD-but-paste-on-FP/idi-p/1466502

Message 1 of 12
(2,529 Views)

I don't get it!  If you have a Control (or Indicator) in LabVIEW, it exists on both the FP and BD.  They look different (a Graph on the FP looks like "a graph", with axes, grid lines, etc., while on the BD it looks like an Icon or a Terminal (depending on whether Icon View is turned on), but they are merely manifestations of the same entity.

 

You copy/paste the FP representation to FPs, the BD representation to BDs, and the "other" representation will appear (at least, on my machines, and on all versions of LabVIEW I've used, from LabVIEW 7.0 through LabVIEW 2017) on the other "view".  

 

Is it possible that you are dealing with "out-of-control" Block Diagrams that span 20 screens?  I've seen situations where it appears that the "new entity" is on only one screen because it has moved "far away" from the other elements on the other screen (i.e. "copy and paste on BD, but the copy doesn't seem to be present on the FP because it's 5 screens away").  There are two solutions to this problem:

  • Use the Navigation Window to get a view of the full FP.  If you've managed to put the new Control/Indicator many screens away, you'll see something is way off in the corner -- this is your "misplaced" control.  Navigate the window there, select it, and drag it to the rest of your Front Panel.
  • Prevent this situation by keeping your Block Diagram to a single Screen.  This is easily accomplished by the judicious use of sub-VIs.  I learned this principle from Peter Blume's excellent The LabVIEW Style Book a decade ago, and have applied it ever since.

Bob Schor

Message 2 of 12
(2,492 Views)

Sorry, but I do not know why it is not clear πŸ™‚ And all my FPs and BDs fit into a single screen (edit: or in worst case, a bit larger, but maybe max 50% in one direction, vertical or horizontal)...

It is NOT the problem that I cannot locate the pasted object. The problem is that it cannot be pasted! Imagine, you work on a BD of a VI. You select a control which you want to copy-paste into another VI, but into its another VI's FP, not into its BD (if you paste it into the BD, you get it placed randomly on the FP!).

So the problem is that, you cannot do this directly. Neither you can select a control in your BD, and paste it directly into a Typdef!

 

Yes, what I do, instead of selecting the control in the BD, I double click on it, this takes me to the FP if this very VI. Then, I can copy-paste this control from this FP, into another FP or Typdef cluster. But bad! LabVIEW took away the focus from the BD where I was just working, so I have to bring the BD again to front, etc...

 

It would be just much more straightforward to be able to copy/paste from BD to any FP (or into an open Typdef cluster control)...

Message 3 of 12
(2,487 Views)

 

Copying from the block diagram and pasting onto a front panel just seems counterintuitive and I am not surprised it does not work.

 

Interestingly enough you CAN copy a Numeric Constant from a block diagram and paste it into a front panel, and it will paste a Numeric Control onto the panel.

========================
=== Engineer Ambiguously ===
========================
Message 4 of 12
(2,472 Views)

I made a short screen capture to show what is my actual problem, why I find this missing option uncomfortable:

Spoiler
By the way, did you know, you can make screen capture video using simply Powerpoint? I did not! πŸ™‚

In this video, I put the on-screen Keyboard visible, to indicate when I press either the Ctrl+C, or the Ctrl+V combos.

  1. The first part in the video, I try to copy paste a numeric control from the BD into the FP. Does not work.
  2. Then I show you can just copy paste from the BD into the BD, it works, but the control does not get where I want.
  3. I can also go to the FP, and do the copy paste there, it is ok, but for this you need to double click on the control in the BD, so you locate it in the FP, then you do a copypaste there, from FP to FP...
  4. Finally, what is the larger problem for me: I cannot insert a control from the BD into my Typdefcluster! I have to do it from the FP...

Note: these are little simple VIs, imagine when you work with a project, and many VIs are open. You lose focus from the BD where you are working because of the above issues, and it takes time to bring back the BD, etc...I do not say this is a big issue, but for sure, for me, it is not comfortable! πŸ™‚

 

0 Kudos
Message 5 of 12
(2,468 Views)

@Blokk wrote:

 

Yes, what I do, instead of selecting the control in the BD, I double click on it, this takes me to the FP if this very VI. Then, I can copy-paste this control from this FP, into another FP or Typdef cluster. But bad! LabVIEW took away the focus from the BD where I was just working, so I have to bring the BD again to front, etc...

 


NO LabVIEW did NOT take away the focus.

 

YOU changed the focus when you moved from working on a block diagram to working on a front panel.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 12
(2,463 Views)

@RTSLVU wrote:

@Blokk wrote:

 

Yes, what I do, instead of selecting the control in the BD, I double click on it, this takes me to the FP if this very VI. Then, I can copy-paste this control from this FP, into another FP or Typdef cluster. But bad! LabVIEW took away the focus from the BD where I was just working, so I have to bring the BD again to front, etc...

 


NO LabVIEW did NOT take away the focus.

 

YOU changed the focus when you moved from working on a block diagram to working on a front panel.


THAT is the point! πŸ˜„ Does not matter who took away the focus. It must be done, otherwise I cannot paste the control into my Typdef cluster. For me this is the most annoying part...

Message 7 of 12
(2,457 Views)

@RTSLVU wrote:

 

Copying from the block diagram and pasting onto a front panel just seems counterintuitive and I am not surprised it does not work.

 

Interestingly enough you CAN copy a Numeric Constant from a block diagram and paste it into a front panel, and it will paste a Numeric Control onto the panel.


I give you a Kudo, because now I realize, you actually gave me a workaround "trick"! πŸ™‚

 

When I have a Control on my BD, I just ctrl+drag it to create a new instance next to it (this is important, because this control can be another typdef, or a UserEvent Refnum carrying type, etc), then I change this into a constant! This constant now CAN BE pasted into a FP, or even into a Typdef cluster! πŸ™‚

0 Kudos
Message 8 of 12
(2,448 Views)

@Blokk wrote:

@RTSLVU wrote:

 

Copying from the block diagram and pasting onto a front panel just seems counterintuitive and I am not surprised it does not work.

 

Interestingly enough you CAN copy a Numeric Constant from a block diagram and paste it into a front panel, and it will paste a Numeric Control onto the panel.


I give you a Kudo, because now I realize, you actually gave me a workaround "trick"! πŸ™‚

 

When I have a Control on my BD, I just ctrl+drag it to create a new instance next to it (this is important, because this control can be another typdef, or a UserEvent Refnum carrying type, etc), then I change this into a constant! This constant now CAN BE pasted into a FP, or even into a Typdef cluster! πŸ™‚


But that does not keep any style changes or customizations you made on the FP control, so what's the point? The only time I would want or even need to copy an FP object from one VI to another is if that object had some customizations that I did not want to have to manually reproduce.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 12
(2,441 Views)

@RTSLVU wrote:

@Blokk wrote:

@RTSLVU wrote:

 

Copying from the block diagram and pasting onto a front panel just seems counterintuitive and I am not surprised it does not work.

 

Interestingly enough you CAN copy a Numeric Constant from a block diagram and paste it into a front panel, and it will paste a Numeric Control onto the panel.


I give you a Kudo, because now I realize, you actually gave me a workaround "trick"! πŸ™‚

 

When I have a Control on my BD, I just ctrl+drag it to create a new instance next to it (this is important, because this control can be another typdef, or a UserEvent Refnum carrying type, etc), then I change this into a constant! This constant now CAN BE pasted into a FP, or even into a Typdef cluster! πŸ™‚


But that does not it keep any style changes or customizations you made on the FP control, so what's the point? The only time I would want or even need to copy an FP object from one VI to another is if that object had some customizations that I did not want to have to manually reproduce.


It is totally correct what you say for FP to FP copies! But as i noted above, my main pain is the "BD to Typedef cluster control" copies. In this case i do not care about the style, but about the type! So i just make a temporary constant copy at the BD, ctrl+x it, and drop it into the typedef with ctrl+v πŸ™‚ Nice!

0 Kudos
Message 10 of 12
(2,432 Views)