I have a USB-5133. Data were acquired for different elapsed time.
I have a problem about while loop iteration number. For example, While the time is 1 s, the iteration is 10.
While the time is 10 s, I expect that the iteration is 100. But it is lower than 100 (for example 80).
That is, the iteration number is not proportional with the time.
I would like they are proportional with each other. What can I do for this?
Thank you for your help.
An iteration takes as long as the slowest part of the code inside it. Often the slowest part is a wait statement, but if other parts take longer, the while loop will of course be slower. Can you show us some code?
Are you doing inefficient things, such as initializing the DAQ with each iteration?
Thank you for your reply. In the while loop, I used NI-SCOPE Initiate and Read function. How can data be acquired without the Initiate?
You need to initialize to read, but only only need to initialize once, to read many times. Put the the initialize outside of the while loop (happens before executing) put your acquire inside the loop (calls multiple times) then put the close outside of the while loop after the while loop stops executing.
I tried it. When the initialize function was outside the loop, the read function acquired data once. Data were not renewed for each iteration. If it is possible, could you send me example code.