function [stat,post] = blkstep(path,prop,bstr,bint,bflt,parent,name,catalog,ws,node,sbSample)
%BLKSTEP Describes a signal source that generates a step function.
%
% See also BLKGENWAVE, BLKPULSE, BLKSQWAVE, BLKLIMRAMP, BLKSINEGEN, BLKURAND, BLKNORMAL.
%

% Initial coding by A S Bozin, 6-10-97
% Copyright 1997-2000 The MathWorks, Inc.
% $Revision: 1.6 $ $Date: 2000/06/14 16:11:12 $

   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 the relative start time and step magnitude parameters
   %
   indInt = bint(15)+1;
   indStr = bint(17)+1;
   mode = bint(indInt);
   npar = 2;					   % Number of parameters
   symInd = zeros(1,npar);
   if (bitand(mode,16))
      indInt = indInt+2;
      iRange = 1:bint(indInt);
      symInd(bint(indInt+iRange)) = 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
   %
   % Step function block
   %
   bh = add_block('libsb2sl/SNG/StepFcn',path,...
		  'ForegroundColor',prop.fgColor,...
		  'BackgroundColor',prop.bgColor,...
		  'Orientation',prop.orientation,...
		  'DropShadow',prop.border,...
		  'Position',rect,...
		  'T0',str{1},...
		  'A',str{2},...
		  'TS',mat2char(sbSample));
   %
   % Connect the current block with the mux and demux blocks (if any)
   %
   blkio('line',channels,nOutputs,post,parent,name);
   return					   % Last card of BLKSTEP
