function [stat,post] = blklimramp(path,prop,bstr,bint,bflt,parent,name,catalog,ws,node)
%BLKLIMRAMP Defines signal source that generates a ramp which can be limited.
%
% See also BLKGENWAVE, BLKPULSE, BLKSTEP, BLKSQWAVE, BLKSINEGEN, BLKURAND, BLKNORMAL.
%

% Initial coding by A S Bozin, 8-6-97
% Copyright 1997-2000 The MathWorks, Inc.
% $Revision: 1.5 $ $Date: 2000/06/14 16:09:41 $

   stat = 0;			   		   % Error flag
   nInputs = bint(5);
   nOutputs = bint(6);
   %
   % Add mux and demux blocks if necessary
   %
   channels = 0;
   [post,rect] = blkio('port',channels,nOutputs,prop,path);
   %
   % Get relative start time, pulse magnitude, pulse width and frequency parameters
   %
   indInt = bint(18)+1;
   indInt = bint(indInt)+indInt;
   limRamp = bint(indInt);			   % Boolean, limited ramp
   indInt = bint(15)+1;
   indStr = bint(17)+1;
   mode = bint(indInt);
   if (limRamp)
      npar = 3;					   % Number of parameters
   else
      npar = 2;
   end
   symInd = zeros(1,npar);
   if (bitand(mode,16))
      indVar = indInt+2;
      vRange = 1:bint(indVar);
      symInd(bint(indVar+vRange)) = 1;
   end
   str = cell(npar,1);
   for (k = find(symInd))
      ind = mfindstr(bstr,indStr,'|');
      str{k} = bstr(indStr:ind-1);
      indStr = ind+1;
   end
   %
   % Get the block parameter variables
   %
   [symInd,str] = mgetscope(symInd,str,catalog,ws,node);
   indFlt = bint(19);
   pLen = zeros(npar,1)+nOutputs;
   ub = cumsum(pLen);
   lb = [0;ub(1:end-1)]+1;
   for (k = find(~symInd))
      params = zeros(1,pLen(k));
      bRange = lb(k):ub(k);
      params(:) = bflt(indFlt+bRange);
      str{k} = mat2char(params);
   end
   %
   % Limited ramp block
   %
   bh = add_block('libsb2sl/SNG/LimRamp',path,...
		  'ForegroundColor',prop.fgColor,...
		  'BackgroundColor',prop.bgColor,...
		  'Orientation',prop.orientation,...
		  'DropShadow',prop.border,...
		  'Position',rect,...
		  'T0',str{1},...
		  'RATE',str{2});
   if (limRamp)
      set_param(bh,'LMT','yes','SAT',str{3});
   else
      set_param(bh,'LMT','no','SAT','[]');
   end
   %
   % Connect the current block with the mux and demux blocks (if any)
   %
   blkio('line',channels,nOutputs,post,parent,name);
   return					   % Last card of BLKLIMRAMP
