Map and access RTDB variables from generated code
The
When you use the MLToolkit GUI to generate SimWB-compliant code, the software automatically replaces the relevant native Simulink source and sink blocks in your model with one of these blocks. You must manually place these blocks in your Simulink model only if you want to generate code programmatically or further customize the generated code. For example, you can specify a custom variable name or sample time for a signal.
The C MEX S-function blocks,
Note:
Before generating code for these C MEX S-function blocks,
you must execute the createMex function.
This function generates the MEX files for both the C MEX S-function blocks.
|
The following images show the block dialogs for the
Option to treat the block input/output as a String (char
array).
(Applies to the
Name of the generated RTDB variable.
modelname.subsysname.blockname.varName
.
A variable name with a dot (varName.x
) generates an RTDB variable named
modelname.subsysname.blockname.varName.x
varName
.
A variable name with a dot (varName.x
) generates an
RTDB variable named varName.x
.
Example: varname
Note: You can customize how the MLToolkit handles variable names. For more information, see RTDB Generation Preferences |
Dimension of the RTDB variable.
Example: [1 1]
Data type of the RTDB variable. Basic Simulink& data types are supported.
Example: double
Block sample time. Default is inherited sample time.
Example: [-1 0]
Buffer length of the RTDB variable. The Maximum length is 1024.
The second output of the
Example: 10
Enter the bus name of a Simulink bus available in the workspace.
Refer to Bus Support in SimWB for additional details.
Example: Bus: mybusname
Default value of the RTDB variable.
If the Treat as String Block option is checked, then this option is called Default String.
Example: 0