%% $RCSfile: sfun_user_fxp_const.tlc,v $
%% $Revision: 1.1.6.1 $
%% $Date: 2003/03/05 07:08:09 $

%% Copyright 1994-2003 The MathWorks, Inc.
%%
%% Abstract:
%%     User SFunction Fixed-point constant 

%implements sfun_user_fxp_const "C"


%function BlockInstanceSetup(block, system) void
  %%
  %<LibBlockSetIsExpressionCompliant(block)>\
  %%
%endfunction  %% BlockInstanceSetup


%function BlockOutputSignal(block,system,portIdx,ucv,lcv,idx,retType) void
  %switch retType
    %case "Signal"
      %assign theParam = LibBlockParameter(Constant,ucv,lcv,idx)
      %return theParam
    %case "SignalAddr"
      %return LibBlockParameterAddr(Constant,ucv,lcv,idx)
    %default
      %assign errTxt = "Unsupported return type: %<retType>"
      %<LibBlockReportError(block,errTxt)>
  %endswitch
%endfunction


%function Outputs(block, system) Output
  %%
  %%  Put comment into the generated C code
  %%
  /* User Sfunction fixed-point constant */
  %%
  %assign labelForParameter = LibBlockParameter(Constant, "", "", 0 )
  %assign labelForOutput    = LibBlockOutputSignal(0,     "", "", 0 )
  %%
  %% put the assignment into the generated C code, there is no need to
  %% worry about the data types that are used.  The data type for
  %% the parameter and the output are the same, and they have already
  %% been declared elsewhere by Real Time Workshop.
  %%     In this case, the same line of TLC code works for all possible
  %% data types.
  %%
  %<labelForParameter> = %<labelForParameter>;
  %%
  %% blank line for formating

%endfunction
