function s=setsampleslow(port,min,sec) % SOSI-M2 V1.0 MATLAB M-file % % Set slow sample rate % % Arguments s=slowsample(spo,min,sec) % % port: 'COM2', for example % min: sample period minutes % sec: sample period seconds % valid time value range: 00:01 to 10:59 % Check input arguments errors=0; if min+sec < 1 errors = 1; elseif min>10 errors = 1; elseif sec>59 errors = 1; end if errors disp('Argument error: min or sec'); return; end try % Set up port spo=serial9600(port); wakeupsub(spo); % Set fast sample rate s=setsampleslowsub(spo,min,sec); fclose(spo); return; catch s=lasterr; disp(s); fclose(spo); return; end