existing_sp = instrfind('Port','COM7');  % Find,close, and delete existing serial port instrument interfaces
if(~isempty(existing_sp))
  fclose(existing_sp);
  delete(existing_sp);
end

clear all;
close all;


sp = serial('COM7');
sp.BaudRate=115200;

%sp.BytesAvailableFcnMode = 'terminator';
%sp.Terminator = 'CR/LF';
%sp.BytesAvailableFcn = @SerialPortCallBack;


fopen(sp);
