From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

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

paste option to group copy/paste of variables to new vi

Status: Declined

Any idea that has received less than 3 kudos within 3 years after posting will be automatically declined.

The current setup in Labview maintains the original spatial layout of front panel and back panel controls/indicators when copying and pasting to a new vi.  Although this behavior might be useful for some, I would prefer that all controls/indicators be grouped together on copying and pasting, as I am going to rearrange them anyways, and I would prefer them to be closer together.  To compromise, it would be nice to have a special paste option (not to just get rid of the current behavior) that would group the controls and indicators together with the copied code.

 

The first picture below shows the result of copying and pasting some code into a new vi.  The back panel controls/indicators weren't too far from the code, however the front panel objects were very far away from each other as seen in the navigator window. 


The second picture shows the result of the new pasting option.  As a secondary point, having an option that would attempt to convert local variables to controls/indicators based on the current connection direction would also be useful. In this case the result of that operation would remove both local variables, and switch the direction of both the indicator and control.

 

 

CURRENT BEHAVIOR 

 

CopyToNew1.PNG
 
BEHAVIOR WITH NEW PASTE OPTION

 

CopyToNew2.PNG 

3 Comments
RavensFan
Knight of NI

I agree that the locations of the controls/indicators can be kind of odd when doing a copy/paste.  Even within the same VI.  I don't know what is the underlying logic that determines there location on the other panel.  There is no reason for them to be so far away.  Yet I do sometimes like them somewhat separated.  For example, I don't like it when the corresponding terminal gets lost in other code on the block diagram.  It is easy enough to find by a doing a "Find terminal".  But having to drag a terminal on the block diagram (or the control/indicator on the fron panels) across several screens is annoying.

 

I don't understand what you are asking for in your second point about reversing the direction of controls and indicators.  I wouldn't want LabVIEW changing controls to indicators and vice versa unless I explicitly tell it to.

JimboH
Member

I think the positions relative to each other is fixed, but I'm not sure what drives the absolute location. This pasting would group the controls/indicators in such a way that is close to the code that you are pasting, so if you have room where you are pasting your code, then hopefully you wouldn't lose your controls/indicators amongst other code.

 

To clarify the second point, since you are already specifying an alternate paste option (than the default), a third one might be to try and force removal of local variables (this would be user determined, not automatic).  In my case above, SYScontrol is being written to, which would make it an indicator, not a control as it currently is.  UserEvent Cluster is being read from, which would make this indicator a control.  The local variables would then be replaced with the indicator and control.  This would only work on variables in which only one instance (local variable or control/indicator) was being read from or written to.

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 3 kudos within 3 years after posting will be automatically declined.