%% File : pokus.tlc
%% Created: Sun Mar  7 18:16:35 2010
%%
%% Description: 
%%   Real-Time Workshop wrapper functions interface generated for 
%%   S-function "pokus.c".
%%
%%         File generated by S-function Builder Block
%%
%%   For more information on using the Target Language with the 
%%   Real-Time Workshop, see the Target Language Compiler manual
%%   (under Real-Time Workshop) in the "Inlining S-Functions"
%%   chapter under the section and subsection:
%%     "Writing Block Target Files to Inline S-Functions",
%%        "Function-Based or Wrappered Code".
%%
%implements  pokus "C"
%% Function: BlockTypeSetup ===================================================
%%
%% Purpose:
%%      Set up external references for wrapper functions in the 
%%      generated code.
%%
%function BlockTypeSetup(block, system) Output
  %openfile externs
    
  extern void pokus_Outputs_wrapper(const real_T *u0,
                          real_T *y0  ,
			              const real_T  *xD ,
                          const real_T *xC,
                         const real_T  *Tvz, const int_T p_width0);
  extern void pokus_Update_wrapper(const real_T *u0,
                          const real_T *y0 ,
                           real_T *xD, 
                          const real_T  *Tvz, const int_T  p_width0);
  extern void pokus_Derivatives_wrapper(const real_T *u0,
                          const real_T *y0,
                          real_T *dx ,
                           real_T *xC, 
                          const real_T  *Tvz, const int_T  p_width0);
  %closefile externs
  %<LibCacheExtern(externs)>
  %%
%endfunction

%% InitializeConditions =========================================================
 %%
 %function InitializeConditions(block, system) Output
  /* %<Type> Block: %<Name> */
  {

   real_T initVector[1] = {1};
   %assign rollVars = ["<dwork>/DSTATE"]
   %assign rollRegions = [0:%<LibBlockDWorkWidth(DSTATE)-1>]
   %roll sigIdx = rollRegions, lcv = 1, block, "Roller", rollVars
     %if %<LibBlockDWorkWidth(DSTATE)> == 1
       %<LibBlockDWork(DSTATE, "", lcv, sigIdx)> = initVector[0];
      %else
       %<LibBlockDWork(DSTATE, "", lcv, sigIdx)> = initVector[%<lcv>];
      %endif
   %endroll
  }
  { 
   real_T *xC   = &%<LibBlockContinuousState("", "", 0)>;
   
   
    xC[0] =  1;
  }
 %endfunction
%% Function: Start =============================================================
%%
%function Start(block, system) Output
   /* %<Type> Block: %<Name> */
   
  %assign pu0 = LibBlockInputSignalAddr(0, "", "", 0) 
  %assign py0 = LibBlockOutputSignalAddr(0, "", "", 0)
    
  %assign nelements1 = LibBlockParameterSize(P1)
  %assign param_width1 = nelements1[0] * nelements1[1]  
  %if (param_width1) > 1  
   %assign pp1 = LibBlockMatrixParameterBaseAddr(P1)
  %else  
   %assign pp1 = LibBlockParameterAddr(P1, "", "", 0)
  %endif

%endfunction

%% Function: Outputs ==========================================================
%%
%% Purpose:
%%      Code generation rules for mdlOutputs function.
%%
%function Outputs(block, system) Output
  %%
  %assign pu0 = LibBlockInputSignalAddr(0, "", "", 0)
  %assign py0 = LibBlockOutputSignalAddr(0, "", "", 0)
  %assign pxd = LibBlockDWorkAddr(DSTATE, "", "", 0)
  %assign nelements1 = LibBlockParameterSize(P1)
  %assign param_width1 = nelements1[0] * nelements1[1]
  %if (param_width1) > 1
     %assign pp1 = LibBlockMatrixParameterBaseAddr(P1)
   %else
     %assign pp1 = LibBlockParameterAddr(P1, "", "", 0)
   %endif
  %assign py_width = LibBlockOutputSignalWidth(0)
  %assign pu_width = LibBlockInputSignalWidth(0)
 { 
    real_T *pxc = &%<LibBlockContinuousState("", "", 0)>;
    pokus_Outputs_wrapper(%<pu0>, %<py0>,  %<pxd>,  pxc, %<pp1>, %<param_width1>);

  }  %%
%endfunction

%% Function: Update ==========================================================
%% Abstract:
%%    Update
%%     
%%
%function Update(block, system) Output
    /* S-Function "pokus_wrapper" Block: %<Name> */
  
  %assign pu0 = LibBlockInputSignalAddr(0, "", "", 0) 
  %assign py0 = LibBlockOutputSignalAddr(0, "", "", 0)
  %assign pxd = LibBlockDWorkAddr(DSTATE, "", "", 0)
  
   
  %assign nelements1 = LibBlockParameterSize(P1)
  %assign param_width1 = nelements1[0] * nelements1[1]  
  %if (param_width1) > 1  
   %assign pp1 = LibBlockMatrixParameterBaseAddr(P1)
  %else  
   %assign pp1 = LibBlockParameterAddr(P1, "", "", 0)
  %endif
 
  pokus_Update_wrapper(%<pu0>, %<py0>, %<pxd>, %<pp1>, %<param_width1>);
  

  %%
%endfunction 
%% Function: Derivatives ======================================================
%% Abstract:
%%      Derivatives
%%
%function Derivatives(block, system) Output
   /* S-Function "pokus_wrapper" Block: %<Name> */  

  
  %assign pu0 = LibBlockInputSignalAddr(0, "", "", 0)
  
  %assign py0 = LibBlockOutputSignalAddr(0, "", "", 0)
  
  %assign nelements1 = LibBlockParameterSize(P1)
  %assign param_width1 = nelements1[0] * nelements1[1]
  %if (param_width1) > 1    
   %assign pp1 = LibBlockMatrixParameterBaseAddr(P1) 
  %else    
   %assign pp1 = LibBlockParameterAddr(P1, "", "", 0)
  %endif
  
 
  
 { 
   real_T *pxc = &%<LibBlockContinuousState("", "", 0)>;
   real_T *dx  =  &%<LibBlockContinuousStateDerivative("","",0)>;
   pokus_Derivatives_wrapper(%<pu0>, %<py0>, dx, pxc, %<pp1>, %<param_width1>);
  }
  %%
%endfunction 
%% [EOF] pokus.tlc





