%% $RCSfile: sfunmem.tlc,v $
%% $Revision: 1.1 $
%% $Date: 2002/01/21 21:56:49 $
%%
%% Copyright 1990-2002 The MathWorks, Inc.
%%
%% Abstract:
%%
%%      See simulink/src/sfunmem.c

%implements sfunmem "C"

%% Function: Outputs ==========================================================
%% Abstract:
%%    Y = input (U) from last Update
%%
%function Outputs(block, system) Output
  %% 
  /* %<Type> %<ParamSettings.FunctionName> Block: %<Name> */

  %assign rollVars = ["RWork", "Y"]
  %%
  %roll idx = RollRegions, lcv = RollThreshold, block, "Roller", rollVars
    %%
    %assign uAtLastUpdate = LibBlockRWork(InputAtLastUpdate,"",lcv,idx)
    %%			   
    %assign y = LibBlockOutputSignal(0,"",lcv,idx)
    %%
    %<y> = %<uAtLastUpdate>;

  %endroll
  %%
%endfunction  %% Outputs

%% Function: Update ===========================================================
%% Abstract:
%%    store current input (U)
%%
%function Update(block, system) Output
  %%
  /* %<Type> %<ParamSettings.FunctionName> Block: %<Name> */

  %assign rollVars = ["RWork", "U"]
  %%
  %roll idx = RollRegions, lcv = RollThreshold, block, "Roller", rollVars
    %%
    %assign uAtLastUpdate = LibBlockRWork(InputAtLastUpdate,"",lcv,idx)
    %%
    %% The symbol "InputAtLastUpdate" is registered in sfunmem.c by
    %%
    %%    ssWriteRTWWorkVect([...], "InputAtLastUpdate", [...])
    %%			   
    %assign u = LibBlockInputSignal(0,"",lcv,idx)
    %%
    %<uAtLastUpdate> = %<u>;

  %endroll
  %%
%endfunction

%% [EOF] sfunmem
