My Loops Resize When I Copy Code into Them

Updated Mar 28, 2018

Reported In


  • LabVIEW

Issue Details

Why do my loops automatically grow and shrink when I drag code into them? How do I reduce the size of my loops and structures when they contain subVIs?


Auto Grow is a feature that will change the size of a structure, such as a while loop, case structure, etc., when you paste code inside of it. If auto grow is not enabled code could be hidden inside the while loop that cannot be seen. 

Auto Grow is enabled by default so the code can all be seen when code is pasted or placed in a structure. When making a while loop for example smaller, it will only go as small as possible so that all the code inside it will be seen when Auto Grow is enabled. If disabled, the while loop can be made as small as possible. Code in while loop will be hidden from sight. To enable or disable Auto Grow, 

When you have a loop or a structure that contains subVIs, you should make sure the Auto Grow option is unchecked before trying to reduce its size. You can right click on the loop or the structure to make sure Auto Grow is unchecked.

For example, the following cases outline methods to minimize a while loop containing an event structure and a number of subVIs:

Case 1: Auto Grow is checked in both the while loop and event structure.
  1. You can continue to reduce the size of the while loop or the event structure as long as subVIs do not come into contact with one another.
  2. Once this happens you will no longer be able to reduce the size of the while loop or event structure.
  3. You will have to uncheck the Auto Grow property of the while loop or event structure or both based on your need to reduce the size further.

Case 2: Auto Grow is unchecked for the while loop.
  1. You can continue to reduce the size of the while loop even after it comes into contact with subVIs or the event structure.
  2. You will be able to see the while loop even though all the subVIs are no longer visible in the block diagram.
  3. You can reduce the size of the while loop until it is adjacent to the event structure within it regardless of whether the Auto Grow of the event structure is checked or unchecked.

When you have nested loops or structures the Auto Grow property of the outermost loop or structure should be unchecked to allow you to reduce the overall size. If you want to reduce the size of a specific loop or structure then the Auto Grow of that particular loop or structure should be unchecked.


Not Helpful