Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

daqmx read loop inteval

hardware and software as follows:

win7, labview 2017, daqmx 17.0
cdaq 9185, 9201*1, 9263*1

vi for test is very simple, the same as example. for ai task, sample rate is 10k and read points are 100; for ci task, software time is used and while loop inteval is 10ms.

then question is:
when single ai task only, time of ai loop is 10ms, like this, as expected.

royceking_1-1576156316453.png


when single ci task only, time of ci loop is 10ms, like this, as expected.

royceking_2-1576156333586.png


while both ai and ci task are on, both ai and ci loop time are very unstable(30, 0, 0, 30, 0, 0 and such), like this.

royceking_3-1576156365090.png

royceking_4-1576156377680.png

 

vis for test below:

royceking_5-1576156621615.png

royceking_6-1576156664142.png

 

we test this in pcie-6341, in all situations, the time of loop is 10ms, as expected.

why is in cDAQ?  

0 Kudos
Message 1 of 8
(2,988 Views)

I do not have definite answer but when I try the VI as exe, do you see the same result?

Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
0 Kudos
Message 2 of 8
(2,920 Views)

thanks.

 we try your suggestion and the result are the same.

0 Kudos
Message 3 of 8
(2,427 Views)

No definitive answers, just trying to focus on clues.

 

The CI task pretty much alternates iterations -- 1 slow, 1 fast, 1 slow, 1 fast.  The only way to get a "fast" iteration of ~0 msec is if the previous iteration had DAQmx Read executing *after* the end of the 10 msec wait while the current iteration executes DAQmx Read immediately (as the 10 msec wait is just starting).

    This implies that in the previous iteration, at least 10 msec passed before DAQmx Read was able to execute.  Nothing in the code prevented it, so I start wondering about the driver and particularly about its attempts to negotiate access / priority to the USB bus while the AI task is also demanding access.

    Not sure if you'll get useful information from this, but I'd do trials where the 10 msec wait is moved to each of the various sequence frames in turn.  It's possible that other timing patterns will emerge that help you or someone else in the diagnosis.

 

The AI task has a more interesting pattern.  The timing pattern cycles about every 4 iterations.  I'm gonna guess that on average, in the long run, the loop is keeping up with the task.  So the sum of every 4 iterations should keep being 40 msec.

   It's clear you get long iterations that are typically about 32-33 msec, followed by 2 cycles of 0 msec.  There must be another point along the rising slope to account for the remaining 7-8 msec.   Roughly speaking, the pattern goes 32-0-0-8-32-0-0-8-32-0-0-8.

   The 0 msec iterations happen when the task has built up a little backlog in its buffer.  They're available *immediately* without waiting when DAQmx Read is called.  The 8-ish msec cycle probably means that the previous iteration almost-but-not-quite emptied out the task backlog.  So the call to DAQmx Read finds 2 msec worth of backlogged samples already present and waits 8 msec to receive the rest of the chunk it was asked for.

    That *ought* to get the reading loop back in sync with the task, so that subsequent iterations could be expected to settle back in at 10 msec each.  But it doesn't happen and I simply don't know what causes the next iteration to consistently take this extra time.

 

Have you tried connecting through a different USB port?  Have you tried connecting to a different PC?  Do you have a Windows update pending?  Have you rebooted your system to give it a fresh start?

    These are just shots in the dark, but they're among the things I'd have been experimenting with.  I've seen some occasional odd behavior from drivers and peripherals.  It has sometimes corresponded to Windows updates, sometimes cleared up after a reboot with no known root cause, and sometimes required some much more elaborate interventions.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 8
(2,417 Views)

kevin, thanks for your  reply and details analysis.

Just one thing to correct, our cdaq chassis is ethernet, not usb.

 

Have you tried connecting through a different USB port?     Yes, we tried iin another computer.

Have you tried connecting to a different PC?     Yes, actual we tried win7 and win10, with daqmx driver 17.0 and 18.6

Do you have a Windows update pending?     No.

Have you rebooted your system to give it a fresh start?    Yes, we tried this many times with pc reboot and cdaq chassis reboot.

 

also, we doubt this may be caused by hardware driver or system.

so we ' ve updated daqmx driver to 18.5. then we tried in another pc of win10. and the result is the same.

another option we have not tried is updating the firmware of the chassis, the current version is 17.1.0f5, maybe we can update to latest version and try again.

and one thing to mention, we test these vis in pcie-6341, all timing inteval values are corrected as expected.

 

Now we use queue to make sure the data is not lost and it works fine.

actually what we concerned is the applicaiton of cdaq platform. here we just have two very simple application of ai and ci task, what will be the situation  if we use much more modules or more tasks in 8 or 14 slot chassis in the future? there may be other risks, difficult programming or debug, or even much worse.

0 Kudos
Message 5 of 8
(2,405 Views)

The bulk of my DAQmx experience is with desktop boards analogous to your PCIe-6341.  I'm not at all surprised that it behaves nicely as you describe.

 

I have no experience with running multiple tasks on an ethernet cDAQ, but am surprised at what you've been observing.  If that were an standard, expected symptom, there should be a lot more complaints about ethernet cDAQs.

 

Is it possible you've got some kind of security software or policies on the PCs you've tried that might be interfering with your network connections and traffic?

 

Hopefully someone more knowledgable will join the thread as I'm pretty much out of thoughts, sorry.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 6 of 8
(2,386 Views)

No antivirus software is installed and Windows firewall is closed.

This is really weird.

0 Kudos
Message 7 of 8
(2,372 Views)

again, something update.
we found another cDAQ-9185 chassis in other product line and made a similar test.
os: win7 64bit,
labview:2019
daqmx driver:19.0.0f1
cdaq firmware:17.1.0f5
chassis: cDAQ-9185, ethernet
module: 9203*2, 9263*1
we create a ai  task and an ao task, refer to the pic below. when only one task is on, the inteval times are all expected, but both tasks are on, the intevals are unstable and the result cann't be understood as described in this topic.

It means in situation of multiple tasks, the timing is unpredictable.

Snipaste_2019-12-24_23-17-30.png

0 Kudos
Message 8 of 8
(2,340 Views)