From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI DAQ data acquisition

I am using two NI DAQ (NI 4300) and one Keysight DAQ (M9216) to acquire and monitor 20 parameters. We require one sample in each 2 milli second. So I created task in NI MAX with continuous samples and 500 samples/sec. But during data acquisition in continuous while loop (with 1 millisecond delay), from NI DAQ I am getting previous data. That is after UUT power On I have to get non zero values from DAQ. From Keysight DAQ I am getting correct values. But at the same time from NI DAQ I am getting zero values, that is values before power ON. I tried to close and restart the NI DAQ when power is ON, then also zero values are logged. Please solve my issue

0 Kudos
Message 1 of 17
(2,460 Views)

I am not sure what your problem/question is at the moment. You need to post your actual VI that you are having trouble with to get any real help.

 

I suspect that you are reading one sample at a time which I wouldn't advise (I am guessing that is why you ahve put a 1ms timer in, this isn't necessary as the DAQmx VI's will throttle the speed of your loop). I would suggest reading a big block of data, lets say 1seconds worth. It will mean less overhead.

 

If you have lots of overhead there is a chance that the loop will take longer to run than the data acquisition so you will either get buffer overflow errors if you are set up for continuous measurement or miss data/have horribly mistimed data if you are using finite samples.

 

POST YOUR VI!

Message 2 of 17
(2,450 Views)

Another point is synchronising. If your two DAQs run without a shared sampleclock and you aquire continously over a longer periode you will find that one DAQ is sligthly faster than the other.

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 3 of 17
(2,437 Views)

Expanding on Henrik's comment, sampling 20 channels at 500 Hz would be so much simpler with a 32-channel 1kHz DAQ device than with 3 independent devices.  You'd do a "N Channel, N Sample" continuous acquisition, and once a second, you'd only have to "move 10,000 points" out of your DAQ loop to a parallel processing loop and you'd have no problems keeping up.  There are a number of DAQ products from NI that might easily meet these requirements, including some on a USB bus.

 

Bob Schor

Message 4 of 17
(2,412 Views)

I want to check some auto abort functionality which needs to happen in each 2 millisecond. So I need new values for all 20 parameters in each 2 milli sec. I doubt whether I am getting old values from buffer. How to get most recent values from NI DAQ. If I use read property node whether it affect the speed of acquisition. Please reply

0 Kudos
Message 5 of 17
(2,364 Views)

Post all the VIs that you are using.  If you are using a LabVIEW Project (.lvproj extension) and the Project file and all its VIs are in a single folder, compress the folder and attach the VIs.  We can (probably) help you, but you now need to help us to help you.

 

Bob Schor

Message 6 of 17
(2,356 Views)

Please see the attached VIs. I am using PowerDataAcq VI to acquire data from DAQ cards. Please help

0 Kudos
Message 7 of 17
(2,278 Views)

There's a neat little method I use when I want to acquire continuously and retrieve only the most recent samples.  Not this this does *not* result in a continuous stream of data for my app.  I'll likely retrieve the same samples more than once or miss some samples (possibly both at different times), all depending on software timing, task timing, and quantities.

 

Here's an illustration of how to do it.   I don't know the 4300 device to guarantee that it will support the technique.  I wouldn't expect to be able to do it with the Keysight device, because it's a fairly non-standard way to collect data and I wouldn't assume other devices/drivers would support it.

 

You'll still find that you can't achieve regular, reliable 2 msec loop timing under Windows.  It's possible to go faster, but Windows won't be able to give you deterministic timing.

 

 

-Kevin P

 

[Edit: P.S.  Attempts to achieve 2 msec timing will likely benefit if you let more things happen in parallel rather than in sequence.  For example, error wire dataflow makes you access your 3 DAQ tasks in series.  You could put them in parallel and merge the error wires afterward. 

   You might also want to explore DAQmx Events.  You could configure to try to have DAQmx generate an event every N samples, and choose N to be 2 msec worth.  Then you can try to rely on driver-level timing to act as your "metronome".   I don't know for sure, but kinda expect the timing might be a little more regular than using the "Wait (msec)" primitive.]

 

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).
Message 8 of 17
(2,265 Views)

Thanks. But my another concern is if I use property node inside my contnuous while loop there is a delay. That is if I use property node my duration between two samples is 15 ms. Otherwise I am getting samples in 2,3 milliseconds. For NI DAQ only I have this issue. For NI DAQ acquisition I am using READ proprty node for accessing Relative to propery (Most Recent Sample).

0 Kudos
Message 9 of 17
(2,232 Views)
I want to check some auto abort functionality which needs to happen in each 2 millisecond. So I need new values for all 20 parameters in each 2 milli sec. I doubt whether I am getting old values from buffer. How to get most recent values from NI DAQ. If I use read property node whether it affect the speed of acquisition. Please reply
0 Kudos
Message 10 of 17
(2,223 Views)