Data output generation on NI PXIe-6358

4 views (last 30 days)
Ninad
Ninad on 18 Sep 2014
Hi,
I am trying to use the NI PXIe-6358 card to generate a simple sine wave for starters.
My hardware configuration is as follows NI chasis - NI-PXIe 1082 This has the following NI cards configured on it NI PXIe-8135 which is an embedded controller and runs a Win7 OS. Matlab 2013a is installed onto this controller. The PXIe-6358 card is configured onto this chasis.
I am using the following code to generate a sine wave:
if true
% code
Fc = 5000;
A = 2; % Volts
Fs_o = 250000; % Samples per second
dt = 1/Fs_o; % seconds per sample
StopTime = 10; % seconds
t = (0:dt:StopTime-dt)'; % seconds
ai=daq.createSession('ni'); ai.addAnalogOutputChannel('PXI1Slot2','ai0','Voltage'); ai.Rate = Fs_o;
x = A*cos(2*pi*Fc*t);
ai.queueOutputData (x);
% THERE IS NO ERROR TILL THIS POINT
ai.startForeground();
end
When I start the foreground process I get the following error.
"NI Error -89136: Specified route cannot be satisfied because the hardware does not support it. To see information about supported device routes, consult the Device Routes tab in Measurement and Automation Explorer (Windows only) or the User Manual and Specifications documents for your device. Property: DAQmx_RefClk_Src Requested Value: /PXI1Slot2/PXI_CLK10
Task Name: _unnamedTask<2F>
Status Code: -89136"
I am not sure what the problem is here. I have tried using the NI MAX utility and using it I am able to generate a sine wave.
I think the problem might be that the clock source should be configured as "external" or "onboardclock" but I am not sure how to.
I tried the following but it gave me the following error -
if true
% code
set(ai, 'ClockSource','External')
end
ERROR - "The name 'ClockSource' is not an accessible property for an instance of class 'daq.ni.Session'.
Error in internal.SetGetRenderer/set (line 47) obj.set@hgsetget(varargin{:})"
I am not sure where the problem is arising.
Thanks,

Answers (0)

Categories

Find more on Analog Input and Output in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!