LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

copy-paste puts indicators at window extents

I am pasting a tab control (with a bunch of controls/indicators inside of it) from one VI to another.  I have to repeat this several times.

 

There are 2 options I know of for doing this...copy the tab control from front panel to front panel, or copy the code from block diagram to block diagram.

 

If I go front panel to front panel, I can paste the tab control exactly where I want it, but then the block diagram code loses all of its formatting and fails completely.

 

If I go block diagram to block diagram, the block diagram code retains all of its formatting and connections, and the front panel controls/indicators retain their formatting within the tab control, but the problem is that the entire tab control is pasted at the far extents of the usable LabView front panel.  In other words I have to drag the pasted tab control for a *very* long time to get it back into the same window as the front panel I'm working on.

 

Is there a solution for this?  Thanks in advance...

0 Kudos
Message 1 of 6
(2,733 Views)

Would it be easier to copy the VI (Save As...) and then delete the parts you do not want? If there is a lot of undesired code, do the FP or BD copy and paste once then make copies of the reduced VI.

 

More Seriously, repeated copy and paste sounds like you may have a poor code structure or architecture. Have you considered whether there may be a better way to do what you want?

 

Lynn

0 Kudos
Message 2 of 6
(2,723 Views)

Sorry, I should have provided more detail.  I am using a LabView scripting program to parse a text file with register definitions and create a bunch of controls/ indicators from said file.  There are multiple files, each with a unique set of registers.  After the parser runs, I then paste the resulting controls/indicators into my main GUI.  The issue is that when I paste them in, they appear at the far extents of the LabView front panel, and I have to drag them a long way to get them where I want.

0 Kudos
Message 3 of 6
(2,718 Views)

This will not completely resolve the issue but it may help.

 

Locate the origin of the front panel. This is indicated by a darker circle and heavier grid lines. It may be a long distance from the visible part of the panel since you have been dragging things all over. Move things so the the Origin is at the upper left corner of the front panel and all of your controls and indicators are visible on the panel.

 

Next go the the block diagram and find the origin of that window. When you click and hold on the scroll bars a tip strip shows the coordinates of teh upper left corner of the BD window. Select All and move things until the upper left corner is at the origin (0,0) and everything on the BD is visible in the window.

 

Now when you copy and paste things will not be too far from the origins. When you do the copy and paste, move the objects as little as possible. You can move them farther later.

 

There appears to be some correlation between original positions on FP and BD and the positions of copied objects, although I have never seen any documentation. By keeping everything close to both origins, the "wandering into the wilderness" seems to be reduced.

 

I did not check but I think there may be some ideas on the Idea Exchange regarding this topic. You might check there to see if you want to give kudos to an idea.

 

Lynn

0 Kudos
Message 4 of 6
(2,709 Views)

A couple of comments:

 

  1. If you use Move instead of Copy-Paste, you will get better performance and you will not fill up your clipboard.  Moving multiple items can be problematic, however, since you have to select all of them.
  2. After a Move/Copy-Paste, the selected items on your FP and BD are the items you just created.  You can use this to get handles to them and move them wherever you want them.  This kind of code can get complex fast, but it is an option if you want to automatically arrange things.
0 Kudos
Message 5 of 6
(2,698 Views)

Thank you both for your helpful answers.  I moved my block diagram and FP to be at the (0,0) location, so I'll see how much that improves things.

0 Kudos
Message 6 of 6
(2,695 Views)