08-09-2010 01:47 PM
I have the NI USB-6251, and I am trying to run the example "Synch AI-AO.c" to read input and generate output at the same time. Because of the USB device's limitations, I had to set the sampling type to "On Demand" and comment out the trigger command. The program reads in data just fine, but it is not outputting anythin like it should be. One thing that has confused me is that there is no "DAQmxWriteAnalogF64" command, so how would this example ever output anything? I see that there is an AOdata array, but if it's never written, how would it be outputted?
08-09-2010 03:04 PM
You're right, this example was missing the following line of code between the calls to GenSineWave() and DAQmxStartTask():
DAQmxErrChk (DAQmxWriteAnalogF64(AOtaskHandle, 1000, FALSE, 10.0, DAQmx_Val_GroupByChannel, AOdata, NULL, NULL));
It also had the wrong trigger terminal name at one point. "ai/aiStartTrigger" should be "ai/StartTrigger".
These issues were discussed in a previous forum thread (SynchAI-AO example does not work) and reported to R&D as CAR #181942. The example is fixed in DAQmx 9.1 and later.
08-09-2010 04:54 PM
Thanks for your quick reply. Sorry I missed it in the other thread.