1 Star 1 Fork 0

zhyongquan/incamipdemo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mipdemo.m 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
zhyongquan 提交于 2018-05-02 14:53 . Update mipdemo.m
%% Open
% Establish the connection from MATLAB to INCA
IncaOpen;
% Connects to the currently opened experiment
IncaOpenExperiment;
%% Measure element
% Add measure element in current group
IncaAddMeasureElement('WorkbaseDevice1',[],'B_GREEN');
IncaAddMeasureElement('WorkbaseDevice1',[],'B_RED');
IncaAddMeasureElement('WorkbaseDevice1',[],'B_YELLOW');
% Start measure
data=[];
time=[];
IncaShowMessages(0);
IncaSetMeasureReadMode(0)
IncaStartMeasurement;
deltaT=0;
% Measure for 20 seconds
while(deltaT<20)
pause(0.1)
[t,d]=IncaGetRecords( 'WorkbaseDevice1','TimeC',500);
data = [data; d];
time = [time; t];
if( length(time))
% Calculate time measured
deltaT = time( length(time)) - time(1);
end
end
IncaStopMeasurement;
IncaShowMessages(1);
% Plot the results
plot(time, data);
%% Calibration element
% Add calibration element
IncaAddCalibrationElement('WorkbaseDevice1','DEMO_CONSTANT_1');
% Get calibration value
value=IncaGetCalibrationValue('WorkbaseDevice1','DEMO_CONSTANT_1');
% Set calibration value
DEMO_CONSTANT_1=10;
result=IncaSetCalibrationValue('WorkbaseDevice1','DEMO_CONSTANT_1',DEMO_CONSTANT_1);
%% Close
IncaClose;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Matlab
1
https://gitee.com/zhyongquan/incamipdemo.git
git@gitee.com:zhyongquan/incamipdemo.git
zhyongquan
incamipdemo
incamipdemo
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385