trigger issue when synchronizing two NI-DAQ cards

Hi, I have two NI-DAQ cards. I was trying to acquire data from both cards' analog input channels, with the start trigger synchronized.
I have set up an RTSI cable and am using Matlab's data acquisition toolbox. As in the code below, I'm setting ai2's trigger type as 'HwDigital' so that it receives trigger from 'RTSI0'. However, when SamplesPerTrigger property of ai2 is set to Inf, there is an error when starting the tasks. If it's set to a finite number (less than 2^24), the program works fine.
Maybe I'm doing something silly here, but I wonder if HwDigital trigger can only evoke acquisition of finite data points. What shall I do if I need continuous recording?
I'm using Matlab 2012a and NIDAQmx driver.
Thanks!
=============================================== This is the matlab file I'm using:
% sync_cards_debug
ai = analoginput('nidaq','D1');
addchannel(ai,0);
ai.SampleRate = 10000;
ai.SamplesPerTrigger = Inf;
ai2 = analoginput('nidaq','D2');
addchannel(ai2,0);
ai2.SampleRate = 10000;
ai2.SamplesPerTrigger = Inf;
ai.TriggerType = 'Immediate';
ai.ExternalTriggerDriveLine = 'RTSI0';
ai2.TriggerType = 'HwDigital';
ai2.HwDigitalTriggerSource = 'RTSI0';
set(ai2,'TriggerCondition','PositiveEdge');
start(ai2)
start(ai)
pause(2)
[data,time] = getdata(ai,10000);
delete(ai)
delete(ai2)
=========================================================
The error in matlab is:
Error using daq.analoginput_nidaqmx_2_103/start
NIDAQmx error : Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.
Property: DAQmx_SampQuant_SampPerChan Requested Value: 0 Valid Values Begin with: 2 Valid Values End with: 33554432 Task Name: MWDAT0140 Status Code:
-200077
Error in daqdevice/start (line 62)
start( daqgetfield(obj,'uddobject') );
Error in sync_cards_debug (line 20)

Answers (0)

Categories

Asked:

on 18 Jun 2013

Community Treasure Hunt

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

Start Hunting!