xxsimSetTimeout

PURPOSE ^

xxsimSetTimeout - change the connection and command time-out value.

SYNOPSIS ^

function retval = xxsimSetTimeout(varargin)

DESCRIPTION ^

 xxsimSetTimeout - change the connection and command time-out value.

 Syntax: 
   retval = xxsimSetTimeout(varargin)

 Inputs:
   varargin = the time-out value in seconds (optional, default = 300).

 Outputs:
   result = boolean indicating the success.

 Examples:
   
   xxsimSetTimeout(300)
       sets the connect and command time-out to 300 seconds.
 
 Author: Controllab Products B.V.
 email: info@controllab.nl
 Website: http://www.controllab.nl
 October 2015

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function retval = xxsimSetTimeout(varargin)
0002 % xxsimSetTimeout - change the connection and command time-out value.
0003 %
0004 % Syntax:
0005 %   retval = xxsimSetTimeout(varargin)
0006 %
0007 % Inputs:
0008 %   varargin = the time-out value in seconds (optional, default = 300).
0009 %
0010 % Outputs:
0011 %   result = boolean indicating the success.
0012 %
0013 % Examples:
0014 %
0015 %   xxsimSetTimeout(300)
0016 %       sets the connect and command time-out to 300 seconds.
0017 %
0018 % Author: Controllab Products B.V.
0019 % email: info@controllab.nl
0020 % Website: http://www.controllab.nl
0021 % October 2015
0022 
0023 %------------- BEGIN CODE --------------
0024 % call the interface function
0025 
0026     %check input arguments
0027     if length(varargin)> 1
0028         error('Too many input arguments.');
0029     end
0030 
0031     % if no argument is given set to true
0032     if length(varargin) < 1
0033         timeout = 300;
0034     end
0035 
0036     %check if the input is a boolean
0037     if length(varargin) == 1
0038         if isnumeric(varargin{1})
0039             timeout = varargin{1};
0040         else
0041             error('argument is not a number');  
0042         end
0043     end
0044 
0045     retval = xrlsettimeout(timeout);
0046     if ( retval == false )
0047         error('Could not modify the time-out value')
0048     end
0049 end

Generated on Thu 25-Apr-2024 10:30:24