Hello Aniket,
I worked on this alteration of your code while Kevin posted. I think his idea to generate the entire PN sequence is a great suggestion.
However, your 6259 has about 2047 samples in its FIFO, so you have about 100 seconds at 20 Hz. You might need to stream some data and that exactly what the posted VI is doing. You can then modify your SubVI to give you more data every time you need it.
By the way, you had the buffer error since the number of samples that goes to the Timing VI, allocates the buffer. You had '1' and therefore, it was too small. I made it 100 which should be enough for the 20 MHz rate.
Hope this helps,
Gerardo O.
RF SW Engineering R&D
National Instruments