PCIe 6535 and legacy interface

3 views (last 30 days)
Hari Patel
Hari Patel on 26 Jun 2012
I am using PCIe 6535 to get 12 Bits of digital data and 3 sync signals to my computer @ rate of 9 MHz.
I am using MATLAB 2010a (32 bit).
my code:
digital_in = digitalio ('nidaq','Dev1');
addline(digital_in,0:7,'in',{'Bit1','Bit2','Bit3','Bit4','Bit5','Bit6','Bit7','Bit8'});
addline(digital_in,0:6,1,'in',{'Bit9','Bit10','Bit11','Bit12','VD','HD','DCLK'});
digital_bits = getvalue(digital_in.Line(1:12));
digital_bits_decimal = binvec2dec(digital_bits);
VD = getvalue(digital_in.Line(13));
HD = getvalue(digital_in.Line(14));
DCLK = getvalue(digital_in.Line(15));
This is what i did so far. Now I want to get these data to my computer @ 9MHz speed. I check MATLAB help but I didn't find anything that specifies speed for legacy interface (PCIe 6535). I want to save 25 seconds of digital data @ 9 MHz rate.
My problem is how to specify speed and timing in the MATLAB using legacy interface because my device (PCIe 6535) only supports legacy interface.

Answers (1)

Rob Graessle
Rob Graessle on 26 Jun 2012
The GETVALUE function in the legacy interface is asynchronous, so it is designed to read one set of values at a time. To acquire multiple values in a row (without regard for timing), you could call GETVALUE inside of a loop. However, if you want to specify a rate at which values are acquired, you could change the TimerFcn and TimerPeriod properties of the digital IO object. For example, if you set TimerPeriod to 0.1 and include a call to GETVALUE inside the TimerFcn callback, a new sample will be acquired every 0.1 seconds. A good example is available in the documentation - just type edit demodaq_callback at the MATLAB prompt. Note, however, that since this uses software-clocked DIO and not hardware-clocked DIO, the acquisition rate will be limited by the speed of your computer and OS.
  1 Comment
Walter Roberson
Walter Roberson on 26 Jun 2012
Oooch... that's probably going to be a lot less than 9 MHz.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!