Data in the Analog Output buffer vanishe before generation

4 views (last 30 days)
Luc Gendre
Luc Gendre on 4 Jan 2012
Closed: MATLAB Answer Bot on 20 Aug 2021
Hello folks!
I wish a happy new year to every one!
I'm using a National Instrument PCI-6120 (Driver NIDAQmx 9.4) with a BNC-2120, with MatLab 2010a. I'm trying to synchronize the generation of a signal with an acquisition. Easy peasy... as it should be...!! But I have an issue with the analog output (AO)! Here is how I configured AI and AO so that they are synchronized:
set(ai,'TriggerType','HwDigital')
set(ai,'HwDigitalTriggerSource','PFI0')
set(ai,'TriggerCondition','NegativeEdge')
set(ao,'TriggerType','HwDigital');
set(ao,'HwDigitalTriggerSource','PFI0');
set(ao,'TriggerCondition','NegativeEdge')
So theoretically, on a negative edge of PFI0, both AI and AO should start running, right?!
So I put some data into the AO buffer (using "pudata" function), and I execute start(ai) and start(ao) so that they get ready and wait for a trigger. But then, after having executed start(ao), and before any trigger happens, the AO returns to the initial state: no data in the buffer and AO waiting for start. I don't understand. And the most impressive thing is that if I plug a scope at the output of the AO, I don't see any signal being generated! It's like I didn't do anything! The data in the AO buffer simply vanished.
Does anybody have a clue...?
Thanks a lot in advance.
Luc
  2 Comments
Walter Roberson
Walter Roberson on 4 Jan 2012
It appears you would need R2011b to use the PCI-6120 with the session-based interface, so no point in trying to work around the problem with the session-based facilities. Ah well.

Sign in to comment.

Answers (1)

Manisha
Manisha on 9 Jan 2012
Hi Luc,
Any chance you can upgrade to R2011b or R2012a pre-release? With session-based interface, starting 11b, your analog input and analog output channels on the same device will be synchronized automatically if added to the same session.
Thanks,
Manisha

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!