image thumbnail
from Motion Control Demo by Paul Lambrechts
Model Based Design Demonstration Based on a Motion Control Case Study

xpcoptions_h.html
RTW Report - xpcoptions.h

File: c:\work\demos\DMC\DEMO\RP\DMC_system_demo_xpc_rtw\xpcoptions.h

    1   #ifndef __DMC_system_demo_XPCOPTIONS_H___
    2   #define __DMC_system_demo_XPCOPTIONS_H___
    3   #include "simstruc_types.h"
    4   #ifndef MT
    5   #define MT                             0                         /* MT may be undefined by simstruc_types.h */
    6   #endif
    7   
    8   #include "DMC_system_demo.h"
    9   #define SIZEOF_PARAMS                  (-1 * (int)sizeof(Parameters_DMC_system_demo))
   10   #define SIMMODE                        0
   11   #define LOGTET                         1
   12   #define LOGBUFSIZE                     100000
   13   #define IRQ_NO                         0
   14   #define IO_IRQ                         0
   15   #define WWW_ACCESS_LEVEL               0
   16   #define CPUCLOCK                       0
   17   
   18   /* Change all stepsize using the newBaseRateStepSize */
   19   void DMC_system_demo_ChangeStepSize(real_T newBaseRateStepSize,
   20     rtModel_DMC_system_demo *DMC_system_demo_rtM)
   21   {
   22     real_T ratio = newBaseRateStepSize / 0.002;
   23   
   24     /* update non-zore stepsize of periodic
   25      * sample time. Stepsize of asynchronous
   26      * sample time is not changed in this function */
   27     DMC_system_demo_rtM->Timing.stepSize0 = DMC_system_demo_rtM->Timing.stepSize0 *
   28       ratio;
   29     DMC_system_demo_rtM->Timing.stepSize = DMC_system_demo_rtM->Timing.stepSize *
   30       ratio;
   31   }
   32   
   33   void XPCCALLCONV changeStepSize(real_T stepSize)
   34   {
   35     /* Change all stepsize using the newBaseRateStepSize */
   36     DMC_system_demo_ChangeStepSize(stepSize, DMC_system_demo_rtM);
   37   }
   38   
   39   #endif                                 /* __DMC_system_demo_XPCOPTIONS_H___ */

Contact us at files@mathworks.com