It works when you wire a constant to the terminal because labVIEW can determine at compile time how big that array is going to be. So, if you know the largest array size you are going to support, then statically initialize the array and use Replcae Array element in your for loop, then keep track of how many elements are actually being used. You may also try just wireing the max size to the loop counter and see if LabVIEW will take that. At compile time, LabVIEW should know that there will be no more than X elements, and if your indexing elements don't go to the max size, then the loop will stop.