Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-6259 and Matlab's Data Acquisition Toolbox

I am trying to use Matlab's Data Acquisition Toolbox to control a PCI-6259 card, but am having trouble with analog output. What I'd like to do is create an output in Matlab (a complex waveform, not just a sinewave or a step) and send it out through the analog output. With my old NI card (PCI-6052E), I did this from Matlab like this:

ao=analogoutput('nidaq','dev1')
addchannel(ao,0)
set(ao,'SampleRate',1000)
data=ones(1000,1)    %% Obviously this isn't a "complicated waveform" -- I'm just using something simple for illustration
putdata(ao,data)
start(ao)
stop(ao)

With the PCI-6052E, this works. But when I try it with the PCI-6259, I get the following error after the start(ao) command:

<< ??? The analog output subsystem of this device does not
<< support clocked generation.
<< You must use PUTSAMPLE to output data.

Is this right? It seems unlikely that an M-Series board can't do something an E-Series board did easily, and so I'm wondering if this is a Matlab problem. I should mention I'm using Windows XP, NidaqMX 8.6, Matlab R2007a, and DAQ Toolbox 2.10.

-- Niraj

0 Kudos
Message 1 of 5
(4,210 Views)
Hi,

Your intuition is correct.  An M-series card should do what you expect.  I don't have one in my machine, but I simulated one.  In R2007b, Data Acquisition Toolbox 2.11.  I'll go back and check the R2007a version later today:

>> ao = analogoutput('nidaq','Dev3')

Display Summary of Analog Output (AO) Object Using 'PCI-6259'.

       Output Parameters:  1000 samples per second on each channel.

      Trigger Parameters:  1 'Immediate' trigger on START.

           Engine status:  Waiting for START.
                           0 total sec. of data currently queued for START.
                           0 samples currently queued by PUTDATA.
                           0 samples sent to output device since START.

AO object contains no channels.

>> addchannel(ao,0)

   Index:  ChannelName:  HwChannel:  OutputRange:  UnitsRange:  Units:  
   1       ''            0           [-10 10]      [-10 10]     'Volts' 

>> putdata(ao,zeros(1000,1))
>> start(ao)
>>

One thing is to double check that your device ID is correct.  Would you be willing to post the results of the command DAQSUPPORT, or email them to me?

Thanks,
-Rob
-----
Rob Purser
Manager, Test and Measurement
MathWorks
rob.purser@mathworks.com
0 Kudos
Message 2 of 5
(4,190 Views)
I tried 7a as well, with similar results.  DAQSUPPORT might help pin down the issue.

-Rob
-----
Rob Purser
Manager, Test and Measurement
MathWorks
rob.purser@mathworks.com
0 Kudos
Message 3 of 5
(4,181 Views)
Hi Rob,

I e-mailed you the results of DAQSUPPORT. I didn't post it here because it exceeded the 10000-character-limit for posting on this board.

Thanks for your help,
Niraj


0 Kudos
Message 4 of 5
(4,169 Views)
Well, now everything works fine. That is, the same code I entered earlier does work with my PCI-6259.\
I'm not sure why it works now. The only thing I did was cycle the power a couple of times. But apparently, that was enough.

0 Kudos
Message 5 of 5
(4,149 Views)