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