forked from ControlCore-Project/concore-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconcore_read.m
More file actions
22 lines (22 loc) · 710 Bytes
/
concore_read.m
File metadata and controls
22 lines (22 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function [result] = concore_read(port, name, inistr)
global concore;
pause(concore.delay);
try
input1 = fopen(strcat(concore.inpath,num2str(port),'/',name));
ins = fscanf(input1,'%c');
fclose(input1);
catch exc
ins = inistr;
end
while length(ins) == 0
pause(concore.delay);
input1 = fopen(strcat(concore.inpath,num2str(port),'/',name));
ins = fscanf(input1,'%c');
fclose(input1);
concore.retrycount = concore.retrycount + 1;
end
concore.s = strcat(concore.s, ins);
result = eval(ins);
concore.simtime = max(concore.simtime,result(1));
result = result(2:length(result));
end