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         timeout = varargin{1};
0039         if isnumeric(varargin{1})
0040             set = varargin{1};
0041         else
0042            error('argument is not a number');  
0043         end
0044     end
0045 
0046     retval = xrlsettimeout(timeout);
0047     if ( retval == false )
0048         error('Could not modify the time-out value')
0049     end
0050 end

Generated on Sun 10-Dec-2017 19:24:51