You can use the DAQmx Create Virtual Channel vi to add Virtual channels to a task. In you case, you want to programmatically control how many times that vi is called. If you call it twice, you would have 2 channels in your task, 3 times -> three channels. The easiest way would be to put this VI in a FOR loop in LabVIEW. The User input can be tied to the N (loop count) of the FOR loop.
Hope this helps & let me know if you need further clarification,
Regards,
Anuj d.