10-15-2008 10:12 AM
Hi there,
I'm trying to acquire data synchronously from two NI PCI-6259 cards using Matlab data acquisition toolbox.
First I output a previously recorded signal:
AO = analogoutput('nidaq','Dev1')
chan = addchannel(AO,0)
set(AO,'SampleRate',1000)
set(AO,'TriggerType','Manual')
putdata(AO,eeg);start(AO);trigger(AO)
OK, that works...
then connect the out signal to the cards, and set up a continuous acquisition (only the important part here):
aIn1 = analoginput('nidaq', 'dev1');
chan1 = addchannel(aIn1,7)
... etc etc ...
set(aIn1, 'TriggerRepeat', Inf);
set(aIn1, 'LoggingMode', 'Memory');
set(aIn1, 'TriggerFcn', @updateFig);
start(aIn1);
OK, this one works too, for both cards, but they are not synchronized.
So I'm trying to rout the internal trigger to Dev1\PFI0, connect it to Dev2\PFI0, and use it as a hardware trigger there
loadlibrary('nicaiu.dll','C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\nidaqmx.h');
calllib('nicaiu','DAQmxConnectTerms','/Dev1/ai/startTrigger','/Dev1/PFI0',0);
I get a 0, meaning Ok, but I see no signal on PFI0.
I also tried connecting /Dev1/startTrigger, /Dev1/referenceTrigger, /Dev1/ai/SampleClock and various other things. Only when I connect '/Dev1/ao/SampleClock' do I see a continuous high signal (still not what I want).
PLS HEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEELP!!!!!
P
10-15-2008 01:28 PM
Hi,
The current version (2.13) of Data Acquisition Toolbox, part of R2008b, which we released just days ago, adds the ability to do exactly what you want. There's a new demo on the website: