Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

problem routing trigger to PFI0

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

 

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

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:

http://www.mathworks.com/products/daq/demos.html?file=/products/demos/shipping/daq/demosync_ai_and_a...

In your case, you'll can either route to PFI pins, or use a RTSI cable.  There's a new chapter in the documentation, " Advanced Configurations Using Analog Input and Analog Output" that talks in more detail about the new capability.

Let me know if this demo and the new documentation helpful, or any improvements you can suggest.

All the best,
-Rob
-----
Rob Purser
Manager, Test and Measurement
MathWorks
rob.purser@mathworks.com
0 Kudos
Message 2 of 2
(3,601 Views)