function s=cmdb(spo,command,delayt) % SOSI-M2 V1.0 MATLAB M-file % % Send command, wait delay, return response % % Args: s=scmdb(spo,command,delayt) % % spo: serial port object % command: text string, see SOSI manual % delayt: delay in milliseconds between sending command and reading reply % % s: reply string from SOSI s=''; fprintf(spo,command); pause(delayt); %i=0; while spo.BytesAvailable > 5 s=fgetl(spo); % s=strcat(s,s1); % i=i+1; % sprintf('%d: %s',i,s) end