Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronization AI/AO

Hi,

 

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?

Thanks,

Tim

0 Kudos
Message 1 of 3
(2,672 Views)

Hi Tim,

 

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.

 

Brad

---
Brad Keryan
NI R&D
Message 2 of 3
(2,669 Views)

Hi Brad,

 

Thanks for your quick reply.  Sorry I missed it in the other thread.

 

Tim

0 Kudos
Message 3 of 3
(2,658 Views)