09-27-2017 11:15 AM
Hi Everybody,
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.
09-27-2017 11:34 AM - edited 09-28-2017 05:34 PM
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?
09-28-2017 12:26 PM
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?
09-28-2017 03:10 PM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-01-2017 05:43 AM
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.
Thank you.
10-01-2017 01:05 PM
@star-123 wrote:
If it is possible, could you send me example code.
Why don't you show us what you did instead.