11-22-2007 02:08 AM
Hi,
I am an undegraduate and tried accomplish my Project .
Actually, I just started my initial part that confirm my laptop can detect the input and output data through the NI-USB 6009.
When the analog signal reaches a value , then I want send the data out.
BUT I have some problems trying to generate a anolog output code using MATLAB software only (have no LabVIEW).
Can you give suggestion how send the output data and provide code?
I directly use the MATALB Code for Output data
chan = addchannel(AO,0);
duration = 1;
set(AO,'SampleRate',150) %Output Parameters: 150 samples per second on each channel.
set(AO,'TriggerType','Manual')
ActualRate = get(AO,'SampleRate');
len = ActualRate*duration;
data = sin(linspace(0,2*pi*500,len))';
putdata(AO,data)
start(AO) % CANNOT RUN STARTING HERE
trigger(AO)
wait(AO,1)
delete(AO)
clear AO
11-26-2007 01:37 PM
Hi ptiamming,
Thank you for posting to NI Discussion Forums. I understand that you are using the NI-USB 6009 and trying to program an analog output operation using Matlab. Since Matlab is made by a different company (The Mathworks), we only support the use of our boards with our own software (LabVIEW) and not with Matlab. You might have better luck going to The Mathworks support in order to get your questions answered. Here is a link to the documentation on using the data acquisition toolbox in Matlab with different operations like analog output. Hopefully this will help you in your application!
11-26-2007 02:04 PM
12-05-2007 01:11 PM
Hi ptiamming,
I would like to provide you with some additional resources for your project. This first link is to another NI discussion forum thread about using M-series cards with DAQmx in Matlab. This has some very useful general information. Also for more information about the Data Acquisition toolbox purchased through the Mathworks, please visit this link. Hopefully this will help!