From the previous comments I am assuming that your waveforms are arrays, rather than the waveform data type. I am also assuming that the sine waves on both sides of the square wave are the same signal.
If so then I suggest a slightly different approach. 1. Generate your sine wave, rather than the empty array. The length should be the length of the entire end signal.
2. Generate the square waveform. You can either generate it at the length you need, or you can generate a much larger square wave, and then use the Array Subset VI to get the portion you need. Which method you use depends how you want to implement the whole method.
3. Use the Replace Array Subset VI to place the portion of the square wave at the location (index) of the original sine wave you ge
nerated.
The result of this method will be an array that starts with your sine wave, and then at the index you choose it will place the square wave of the length you want right into the signal, and then finish up with the sine wave for the rest of the signal.
Evan Collier
Application Engineering
National Instruments