LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delayed Data Acquisition

I'm using LV to control a NI myDAQ board. My proof-of-concept is to generate a sine wave on the board and then acquire it back. I have it working but there is a monster delay in the acquisition. If I use the switch (see image) to go from 8 to 14Hz, it takes a solid 10+ seconds before I see the signal change on the "Acquire" waveform chart (the change reflects immediately on the "Generate" chart).

 

Any thoughts? TIA

0 Kudos
Message 1 of 5
(1,020 Views)

Attach runnable code, and I'll try it on a myDAQ.  I can't execute the picture you attached -- heck, I can't even read it.

 

I suspect you've forgotten the Principle of Data Flow -- when a Structure (Loop, VI, Frame, etc) is entered, all of the values on "input" lines/tunnels are read, the values are used (and possibly modified) inside the Structure, and when all of the output wires have data on them, the Structure exits with those values.  Once inside the Structure, everything that is not "sequenced" by wires or sub-Structures operate effectively simultaneously, in parallel.

 

So if you have a Switch whose value you want to use inside a Loop, and the Loop takes 10 seconds to run, you cannot "see" an updated value of the Switch more often than once every 10 seconds, no matter how often you change it.

 

Bob Schor

0 Kudos
Message 2 of 5
(992 Views)

I suspect you might be right. Here's the code I'm running. Sorry - don't know why the image isn't working. Not my day apparently.

0 Kudos
Message 3 of 5
(983 Views)

Hi doc,

 

is there any reason to set the AI DAQAssistent to "finite samples" measurement mode?

Why don't you use the "continuous measurement" mode?

 

And why don't you cleanup your block diagram?

It also makes no sense to convert the AI data into a plain 1D array and create a waveform on your own when that ExpressVI (FromDDT) can do this job for you!

You forgot to implement a way to stop the second loop too…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(977 Views)

Thanks, Gerd. I tried continuous mode and that didn't change anything.

Good call about the waveform conversion. Its been a solid 15 years since I coded in LV and I'm a bit rusty.

0 Kudos
Message 5 of 5
(969 Views)