function [stat,post] = blkshiftreg(path,prop,bstr,bint,bflt,parent,name,catalog,ws,node,sbSample)
%BLKSHIFTREG This block defines a dynamic model that implements asequential shift register.
%
% See also BLKGAINLIST, BLKDELAY.

% Initial coding by A S Bozin, 06-16-98
% Copyright 1997-2000 The MathWorks, Inc.
% $Revision: 1.4 $ $Date: 2000/06/14 16:10:53 $

   stat = 0;			   		   % Error flag
   nInputs = bint(5);
   nOutputs = bint(6);
   nStates = bint(7);
   %
   % Add mux and demux blocks if necessary
   %
   [post,rect] = blkio('port',nInputs,nOutputs,prop,path);
   %
   % Get the initial conditions
   %
   indStr = bint(17)+1;
   indInt = bint(15)+1;
   npar = 1;					   % Number of parameters
   symInd = zeros(1,npar);
   mode = bint(indInt);
   if (bitand(mode,8))
      symInd(npar) = 1;
   end
   str = cell(npar,1);
   if (symInd == 1)
      ind = mfindstr(bstr,indStr,'|');
      str{npar} = bstr(indStr:ind-1);
   end
   %
   % Get the block parameter variables
   %
   [symInd,str] = mgetscope(symInd,str,catalog,ws,node);
   if (symInd == 0)
      indFlt = bint(16);
      indInt = indInt+1;
      nnzic = bint(indInt);
      x0 = zeros(nStates,1);
      if (~isempty(x0) & nnzic)
	 cRange = 1:nnzic;
	 indInt = indInt+nnzic;
	 x0(bint(indInt+cRange)) = bflt(indFlt+cRange);
      end
      str{npar} = mat2char(x0);
   end
   %
   % Constant interpolation block.
   %
   bh = add_block('libsb2sl/LOG/ShiftRegister',path,...
		  'ForegroundColor',prop.fgColor,...
		  'BackgroundColor',prop.bgColor,...
		  'Orientation',prop.orientation,...
		  'DropShadow',prop.border,...
		  'Position',rect,...
		  'X0',str{1},...
		  'NX',mat2char(nStates),...
		  'NY',mat2char(nOutputs),...
		  'TS',mat2char(sbSample));
   %
   % Connect the current state-space block with the mux and demux blocks
   %
   blkio('line',nInputs,nOutputs,post,parent,name);
   return					   % Last card of BLKSHIFTREG
