function trigScan
% Triggers the scanner.
% No inputs required. 
% It users the Printer Port USB i.e. No. 1 port on Keyspan device
%

ports = serial('ports');

numports = length(ports);

% find the Printer Port USB
for i = 1:numports
	if strcmp(ports(i).name,'Printer Port USB')
		portnum = i;
	end
end

if ~exist('portnum','var')
	fprintf(1,'WARNING : Keyspan device is not connected.. No automatic triggering\n ');
	return;
end

	
port = serial('open',ports(portnum).inputDriverName,ports(portnum).outputDriverName,9600);
params = serial('params',port);
%fprintf('Params : %g baud, %g data bits, %g stop bits, parity-%s\n',params.baudRate,params.dataBits,params.stopBits,params.parity);

params.outCTSEnable = 0;
params = serial('params',port,params);

Serial('Write',port,'\4');

serial('close',port);
fprintf('\n');
