Matlab - Simulink - Keil ARM
Matlab - Simulink - Keil ARM
-
-
- -
- -
-
o
o (trong Real-Time Workshop \
Custom Code)
o
1
- :
o
o z O
(trong Real-Time Workshop \ Custom Code)
o -
(trong Simulink \ User-Defined Function)
3.
- - - -
2
4.
-
o <model>.c
o <mode_data>.c
o ert_main.c <model>.c. S
o *.h
3
/*
* File: pid.c
* ....
*/
#include "pid.h"
#include "pid_private.h"
/* Exported block signals */
real_T In2; /* '<Root>/In2' */
real_T Out1; /* '<Root>/Saturation' */
real_T Out2; /* '<Root>/Pulse Generator' */
/* Block states (auto storage) */
D_Work_pid pid_DWork;
/* Real-time model */
RT_MODEL_pid pid_M_;
RT_MODEL_pid *pid_M = &pid_M_;
4
/*
* File: pid_data.c
* . . .
*/
#include "pid.h"
#include "pid_private.h"
5
/*
* File: ert_main.c
* . . .
*/
#include <stdio.h>
#include "pid.h" /* Model's header file */
#include "rtwtypes.h" /* MathWorks types */
static boolean_T OverrunFlag = 0;
. . .
void rt_OneStep(void)
{
...
/* Step the model */
pid_step();
/* Terminate model */
pid_terminate();
return 0;
}
6
5. C
-
o \ User Defined Functions)
o \
User Defined Functions)
- Ch
o z O
-Time Workshop \ Custom Code)
o - \ User-Defined
Function)
6. T fil