function [ok] = MDO_SingleTrigger(h)
% function [ok] = MDO_SingleTrigger(h)
%  equivalent to hitting the single key on the oscilloscope's panel: at the
%  next trigger event only a single recording is done and then the
%  acquisition stops. Usefull if you then want to download synchronized 
% traces from multiple channels.
% Author: Philipp Häfliger, 2-Mar-2025
ok=0;
stderror=2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Checking input variables for validity
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if ~isobject(h)
    fprintf(stderror,"Error: parameter h is not a valid object handle\n");
    return;
end; %if
if isempty(strfind(h.Address,"mdo"))
    fprintf(stderror,"Error: device handle is not associated with a TCP client oscilloscope\n");
    return;
end; %if

h.writeline(':SING');

ok=1;

end

