Hi nadeemalikpda,
I'm assuming you mean when the motor stops turning?
I looked at your code and I did find a possible issue: You are taking continuous measurements at 6 kHz, but only reading 2 samples at a time. Under those conditions, your loop will have to run at 3 kHz in order to keep up with the data coming in and not overflow the buffer. We usually recommend reading about 1/10th as many samples as you are taking in a second. This allows your loop to run at 10 Hz.
To get the information you want (a single value) you can either average the values you get back (as an array) or you can simply use the latest sample.
One last thing to note: that data type that is coming out of the DAQ Assistant is Dynmaic Data. You will need to use a Convert From Dynamic Data VI to convert that data to an array of doubles that you can manipulate.
Have a great day,
Chris
Applications Engineer
National Instruments