Simulink and NI-Daq PCI-6251

조회 수: 4 (최근 30일)
Misha Dabaghyan
Misha Dabaghyan 2015년 6월 18일
편집: Walter Roberson 2015년 6월 18일
I can't seem to make Simulink recognize the device, while the script using the usual commands (see below) works just fine. Moreover, on another disk the same Simulink model worked great with the same version of matlab (2012b, 32-bit). But now I can't even tweak the settings in the "Analog Input" block (which is the starting block of the whole diagram and it complains that "Data acquisition device 'nidaq Dev1 (PCI-6251)' is unavailable. The 'winsound 0 (Microphone (high Definition Aud)' device will be selected"
Thanks in advance!
-Mike.
Here is the output of
devices = daq.getDevices
>> devices(1)
ans =
ni: National Instruments PCI-6251 (Device ID: 'Dev1')
Analog input subsystem supports:
7 ranges supported
Rates from 0.1 to 1250000.0 scans/sec
16 channels ('ai0' - 'ai15')
'Voltage' measurement type
Analog output subsystem supports:
-5.0 to +5.0 Volts,-10 to +10 Volts ranges
Rates from 0.1 to 2857142.9 scans/sec
2 channels ('ao0','ao1')
'Voltage' measurement type
Digital subsystem supports:
24 channels ('port0/line0' - 'port2/line7')
'InputOnly','OutputOnly','Bidirectional' measurement types
Counter input subsystem supports:
Rates from 0.1 to 80000000.0 scans/sec
2 channels ('ctr0','ctr1')
'EdgeCount','PulseWidth','Frequency','Position' measurement types
Counter output subsystem supports:
Rates from 0.1 to 80000000.0 scans/sec
2 channels ('ctr0','ctr1')
'PulseGeneration' measurement type
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The code below runs without problems.
devices = daq.getDevices
devices(1)
s = daq.createSession('ni');
s.addAnalogInputChannel('Dev1', 0, 'Voltage');
s.Rate = 8000
[data,time] = s.startForeground;
%%Plot the Acquired Data
plot(time,data);
xlabel('Time (secs)');
ylabel('Voltage')

답변 (0개)

카테고리

Help CenterFile Exchange에서 Hardware Discovery and Setup에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by