08-10-2010 04:18 PM
Hi everyone,
I wrote a little VI that is supposed to write thorugh the AO a square pulse, at the same time the AI collects data. In order to test the VI I directly connected the AO into the AI, this is a NI USB-6211 board, so I should be reading a square pulse. I pretty much copied the diagrams from the "M Series Synchronization with LabVIEW and NI-DAQmx" page (I tried both the trigger and shared clock method) but I am including the VI just in case.
I am working at 10KHz, I send a 10 ms pulse (14 ms total, 140 points) and it works perfectly, I see the pulse in the graph. However if I increase the duration of the pulse to 20ms (28 ms total, 280 points) things get funky, the signal the AI collects is not the waveform but a variation of it, if I increase it even further to 100 ms (140 ms total, 1400 points) I just get a bunch of noise around zero.
Now, I know the problem is with the AO part because if I connect the AO to an oscilloscope I get the bad waveform, which matches what the AI is acquiring. I tried with both AOs and the same thing.
What am I doing wrong? or not doing?
Thanks in advance.
08-11-2010 06:51 PM - edited 08-11-2010 06:53 PM
08-12-2010 02:23 PM
Thanks for those examples I'm sure they'll be very useful.
I actually solved the problem myself. I think the main difference between the program I wrote and the example in the web page I took it from is that mine is set in a while loop, so it has to write and overwrite as ooposed to running just once.
In my program I put a Wait.VI (from the measuremnt I/O) right after the sequential frames and before the Task Completed?.VI and that made it work perfectly. I don't know exactly why there (labview voodoo prgramming) I tried it in a couple of other places to certain degrees of success, I think it has to do with how the buffer is written. It seems it wasn't giving it enough time.