01-30-2021 09:27 AM
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
01-30-2021 10:49 AM
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
01-30-2021 11:07 AM
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.
01-30-2021 11:24 AM - edited 01-30-2021 11:25 AM
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…
01-30-2021 11:59 AM
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.