function s=setformat(port,tmode) % SOSI-M2 V1.0 MATLAB M-file % % Set output format % % Arguments: setformat(port,tmode) % % port: 'COM2' for example % tmode: one of 'clockT', 'indexT', 'none' % % 'clockT' sets first column data as time hh:mm:ss % data is 8 columns % 'indexT' sets first column data as integer count nnnnnnn % data is 8 columns % 'none' does not display x-axis data first column data % data is 7 columns % Setup output format and check input argument if strcmpi(tmode,'clockT') s1='#seoc'; elseif strcmpi(tmode,'indexT') s1='#seoi'; elseif strcmpi(tmode,'none') s1='#seon'; else disp('Argument error: tmode'); return; end try % Set up port spo=serial9600(port); wakeupsub(spo); s=cmd(spo,s1,0.1); fclose(spo); return; catch s=lasterr; disp(s); fclose(spo); return; end