ABSTRACT

The process for generating the code from the model is extremely easy. In the Simulink menu is a section called Tools. Pulling this menu down gives access to the options o f setting the R T W Parameters, or R T W Build . The parameters menu provides the options for selecting the solver used; in this case the selection is a fixed step wi th no continuous states, since the controller is totally discrete. When the code is executed and the options selected, the status o f the process is provided in the M A T L A B command window. A n example o f this output is shown in Figure 23. A section o f the C-code generated is shown in Figure 24. This section o f the code is a table look-up. The table look-up is a built in Simulink block. The code for this block comes out o f a set o f meta-code descriptions that The Math Works calls a target language compiler description, or a T L C file. Each o f the blocks in Simulink has a corresponding T L C file. These files may be edited and changed in any way the user might require.