function [ok] = MDO_TimebaseScale(h,scale)
% function [ok] = MDO_TimebaseScale(h,scale)
%  Sets the timescale per division to 'scale'
% Author: Philipp Häfliger, 20-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(":TIM:SCAL "+string(scale));

ok=1;

end

