DAQ Toolbox and Calibration
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,
I've calibrated my NI-DAQ using Measurement and Automation and now I want to use this saved task in Matlab so that I can ensure it's recording at the correct range etc. I can't figure out how to call this task from Matlab.
Any help would be greatly appreciated. I have gone through many of the DAQ toolbox guides but they don't mention calibration or how to call a task in Matlab.
I'd prefer to use the legacy interface since I have Matlab R2010a but I can upgrade and use the session interface if it's easier to work with.
kind regards,
Alan
댓글 수: 0
답변 (1개)
Manisha
2012년 8월 24일
Hi Alan,
Currently there is no way to use a saved Measurement and Automation task in MATLAB. Measurement and Automation does not give a way to access the task outside their software.
The Data Acquisition Toolbox currently does not have any in built calibration features. However having said that, you could always use MATLAB's interpolation functions.
So for example if you wanted to perform a 5 step calibration for a channel with range -10 to 10 Volts.
1. Supply -10V,-5V,0V ,5V,10V to your channel one by one and measure the actual voltage using the Data Acquisition Toolbox functions. You can run a clocked acquisition and average the results over some number of samples using the mean function
2. Now say your measured values were [ -9.1, -5.3, 0.1, 5.4, 9.8 ]
3. Now you can write your own calibrate function
function calibrated_values = calibrate(raw_values)
measured_values = [ -9.1, -5.3, 0.1 ,5.4, 9.8 ];
reference_values = [ -10 ,-5 , 0, 5 ,10 ];
calibrated_values = ...
interp1(measured_values,reference_values,raw_values);
end
interp1 by default uses Liner interpolation. There are many different ways in which you can interpolate your data, you can look at other options provided by the interp1 function .
4. Now after acquiring data, you can use your calibrate function.
Hope this helps,
Manisha
참고 항목
카테고리
Help Center 및 File Exchange에서 National Instruments Frame Grabbers에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!