PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 6071E

Hi everyone,
 
I just start to work with NI card and Matlab.
My problem is I tried to send a sine wave for stimulation. For simplicity, my analog output is first connected to my analog input. I want to test the delay in trigger. I got it. But I don't know how to verify the analog input function (i.e. Is it the same function that I sent?). All I can get is a straight line at -5V.
Does anyone have any idea about this?
My code is following:

ai = analoginput(

'nidaq', 4); addchannel(ai, 1);

ao = analogoutput('nidaq', 4); addchannel(ao, 0);

set ([ai ao],

'TriggerType', 'Manual');

set(ai,

'ManualTriggerHwOn', 'Trigger');

duration = 4;

set (ao, 'SampleRate', 10000);

ActualRate = get(ao,

'SampleRate');

len = ActualRate * duration;

data = sin(-pi:0.01:pi)';

putdata (ao, data);

start ([ai ao]);

trigger ([ai ao]);

% Determine the starting time for each device object...

%Acquire data from input

gData = getdata(ai);

plot (gData);

------------- Thank you very much.

0 Kudos
Message 1 of 2
(2,988 Views)
Your code looks fine.  Are you running single ended or differential?  You should double check your wiriing.  Put a known source on the input and see if you can see it in M&A Explorer and MATLAB.  Put a scope on your output and verify that the signal is being transmitted as expected.

-Rob
-----
Rob Purser
Manager, Test and Measurement
MathWorks
rob.purser@mathworks.com
0 Kudos
Message 2 of 2
(2,976 Views)