Hi Pat
Is the number of channels known before this code is executed? If so, you could use a For loop to efficiently build an array out of the waveform constants and then use your code inside another For loop to index the elements for processing.
A While loop could be used but you will have to be careful how you build your array. I would recommend staying away from this if you can.
The other option is to use a Producer/Consumer Framework for Data. There is a template that is shipped with LabVIEW and you can find it in the popup window that appears when you click File>>New.. Use the top loop to work on acquiring your waveform and queuing the data and the bottom loop to process your information.