12.07.2015 Views

Developement Of An Instrument Landing Simulation ... - Cal Poly

Developement Of An Instrument Landing Simulation ... - Cal Poly

Developement Of An Instrument Landing Simulation ... - Cal Poly

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

also allows the entire simulation to be compiled into one executable. Programs can begenerated, distributed, then tested in the classrooms, or students can use them at home.2.3.2 S-FunctionsThe Real-Time Workshop in conjunction with Simulink requires the code to bewritten in a special S-Function format. 5 This allows different sections of the code to berun at different times during the simulation. 6 For instance, the S-Function requires thecode to have a start, initialize, sample time, output, and termination sections. The startsection is only called the first time the simulation runs. The initialize section initializesthe size of the input and output arrays. The sample time section determines the timedifferential for the simulation. The output section computes the output variables. Thetermination section allows conditions to be set to terminate the simulation. Various othersections can be added to make the code behave how and when the programmer wants itto.2.3.3 C-CodeThe C-Code for the simulation is written in the S-Function format. 7 If the code isin the correct format, the compiler will generate a dynamic linked library (dll). This iscompiled C-Code much like an executable. Simulink searches for this dll based on the S-Function name that was assigned to it. To generate the dll, the compiler must be set upcorrectly so Matlab knows where to find it. The code cannot be written in C++, it mustonly be written in C. The entire code for the simulation was written by students.15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!