Overview
Comment:Added ability to call ssSetErrorStatus during i/o processing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: b06fa3bb8b77d91f86287ecf5a1fc08b6749a87df8cfea01d780fb458f2e88b3
User & Date: geraint@users.sourceforge.net on 2002-11-12 17:17:42
Other Links: branch diff | manifest | tags
Context
2002-11-14
05:48:53
Useful utility not yet in mtt check-in: fe7a4ae6c6 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2002-11-12
17:17:42
Added ability to call ssSetErrorStatus during i/o processing. check-in: b06fa3bb8b user: geraint@users.sourceforge.net tags: origin/master, trunk
10:27:44
Added instruction to set include path for compiler. check-in: ff994ddb02 user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/lib/rep/sfun_rep/sfun_interface.c.tmpl from [2f89b5c9cc] to [bbdb5fc62d].

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* Start EDIT */
/* Edit this block to define the number of controller inputs, outputs and parameters */
const int NumberOfControllerInputs	= 1; /* inputs TO controller */
const int NumberOfControllerOutputs	= 1; /* outputs FROM controller */
/* End EDIT */

static void
<mtt_model_name>_process_inputs (void)
{
  /* insert <mtt_model_name>_struc.c */

  /* Start EDIT */
  /* Edit this block to process the model inputs and outputs */
  
  /* Remove the following line */
  fprintf (stderr, "*** Error: <mtt_model_name>_sfun_interface.c has not been customised!\n"); return;

  /* simple example follows */

  /* Get total of all outputs and input to controller */
  controller_inputs[0] = 0.0;
  for (i = 0; i < MTTNY; i++) {
    controller_inputs[0] += mtty[i];







|







|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* Start EDIT */
/* Edit this block to define the number of controller inputs, outputs and parameters */
const int NumberOfControllerInputs	= 1; /* inputs TO controller */
const int NumberOfControllerOutputs	= 1; /* outputs FROM controller */
/* End EDIT */

static void
<mtt_model_name>_process_inputs (SimStruct *S)
{
  /* insert <mtt_model_name>_struc.c */

  /* Start EDIT */
  /* Edit this block to process the model inputs and outputs */
  
  /* Remove the following line */
  ssSetErrorStatus (S, "<mtt_model_name>_sfun_interface.c has not been customised!\n");

  /* simple example follows */

  /* Get total of all outputs and input to controller */
  controller_inputs[0] = 0.0;
  for (i = 0; i < MTTNY; i++) {
    controller_inputs[0] += mtty[i];
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
static void mdlOutputs(SimStruct *S, int_T tid)
{
  PRINT_ENTER;

  update_inputs_from_simulink (S);
  update_simtime_from_simulink (S);

  <mtt_model_name>_process_inputs ();

  UNUSED_ARG(tid); /* not used in single tasking mode */

  for (i = 0; i < MTTNU; i++) {
    ssGetOutputPortRealSignal (S, 0)[i] = mttu[i];
  }
  







|







189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
static void mdlOutputs(SimStruct *S, int_T tid)
{
  PRINT_ENTER;

  update_inputs_from_simulink (S);
  update_simtime_from_simulink (S);

  <mtt_model_name>_process_inputs (S);

  UNUSED_ARG(tid); /* not used in single tasking mode */

  for (i = 0; i < MTTNU; i++) {
    ssGetOutputPortRealSignal (S, 0)[i] = mttu[i];
  }
  


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]