Hello Licry,
Yes, the example only shows how to acquire a fixed number of samples. One of the function calls that sets up the acquisition will allow you to set the hardware to continuously acquire...
aiNumberOfSamples(theSTC, numberOfSamples, kFalse); //false for finite, true for continuous
So you can set this to kTrue to make the acquisition continuous. In order for the task to keep running, your application needs to be able to access the data FIFO fast enough so that it does not overflow.
Secondly, every continuous acquisition must end sometime. When your loop has acquired all the data that the application want, it must issue some commands to stop the acquisition. The STC manual details the steps that can be taken to stop a continuous acquisition.
http://www.ni.com/pdf/manuals/340934b.pdf (check section 2.4.3.3)
Steven T.