1 /* Copyright (C) 2013, 2014 Czech Technical University in Prague
5 * This document contains proprietary information belonging to Czech
6 * Technical University in Prague. Passing on and copying of this
7 * document, and communication of its contents is not permitted
8 * without prior written authorization.
10 * File : sfunction_tror.c
12 * C-MEX S-function block for RPP overrun.
19 * <matlabroot>/bin/mex sfunction_tror.c
25 Name: Overrun Detection
26 Category: Trigger blocks
36 # Description and Help is in Markdown mark-up
39 This block triggers the connected function subsystems in case of
40 overrun, i.e. when execution of the previous loop iteration took
41 more time than the sampling period.
47 RPP API functions used:
53 #define S_FUNCTION_NAME sfunction_tror
57 static void mdlInitializeSizes(SimStruct *S)
60 * Configure parameters: 0
62 if (!rppSetNumParams(S, 0)) {
67 * Configure input ports: 0
69 if (!ssSetNumInputPorts(S, 0)) {
74 * Configure output ports: 1
77 if (!ssSetNumOutputPorts(S, 1)) {
80 rppAddOutputPort(S, 0, SS_FCN_CALL);
82 /* Set standard options for this block */
83 rppSetStandardOptions(S);
87 static void mdlInitializeSampleTimes(SimStruct *S)
89 ssSetSampleTime(S, 0, INHERITED_SAMPLE_TIME);
90 ssSetOffsetTime(S, 0, 0.0);
91 #if defined(ssSetModelReferenceSampleTimeDefaultInheritance)
92 ssSetModelReferenceSampleTimeDefaultInheritance(S);
95 ssSetCallSystemOutput(S,0);
99 #define UNUSED_MDLCHECKPARAMETERS
100 #define UNUSED_MDLOUTPUTS
101 #define UNUSED_MDLTERMINATE