diff --git a/concore_read.m b/concore_read.m index 2103255..ba32c7b 100644 --- a/concore_read.m +++ b/concore_read.m @@ -8,12 +8,21 @@ catch exc ins = inistr; end - while length(ins) == 0 + maxretries = 5; + attempts = 0; + while length(ins) == 0 && attempts < maxretries pause(concore.delay); - input1 = fopen(strcat(concore.inpath,num2str(port),'/',name)); - ins = fscanf(input1,'%c'); - fclose(input1); + try + input1 = fopen(strcat(concore.inpath,num2str(port),'/',name)); + ins = fscanf(input1,'%c'); + fclose(input1); + catch exc + end concore.retrycount = concore.retrycount + 1; + attempts = attempts + 1; + end + if length(ins) == 0 + ins = inistr; end concore.s = strcat(concore.s, ins); result = eval(ins);