1. Place DAQmx Start, DAQmx Read and DAQmx Stop inside the loop.
2. For Finite Sampling, the number of samples input to the DAQmx Timing VI is the total number of samples you want to read.
Please note that the approach using finite sampling will have a slight delay (probably around 100ms) between the time user presses the button and the data is acquired, as it takes some time for the cDAQ to start the acquisition. You can minimize the delay by using continuous sampling, then polling the data repeatedly. This might need a different slightly more complicated coding.