The user can create own targets. All targets are defined in the target definition file Targets.ini. This file has a typical INI-file structure and starts with a section that simply enumerates which targets exist. Each target then has its own section that holds the remaining information, like a short description of the target, the name of the template directory, the names of the template source files, additional commands to perform, etc. The following keywords may appear in a target section:
="string"
The name that will appear in the 20-sim C-Code Generation Dialog.
="string"
The name of an icon file (.ico) that contains an icon to appear in the 20-sim C-Code Generation Dialog.
="string"
The string that will appear in the description field in the 20-sim C-Code Generation Dialog.
="string"
Here the path name where the template files for the c-code can be found can be specified. The default name is the target name in the CCode directory of 20-sim. If no full path is specified, the Ccode directory in 20-sim is taken as a starting point.
=filename1; filename2; filename3...
A list of files, semicolon-separated, that specify the files that are generated in the targetDirectory.
="string"
This holds the default target directory where the files will be generated. This directory name will appear in the 20-sim dialog box when C-Code is generated and can be overruled by the user.
=TRUE (default)
=FALSE
Determines whether C-Code is generated for the complete 20-sim model, or that a submodel selection is required.
="string"
A command which will be executed in the target directory before that the C-Code will be generated.
="string"
A command which will be executed in the target directory after that the C-Code has been generated. For example a "make" command can be given to automatically compile the generated code for the specific target.
|
=0 =1 =2 |
CRLF (0x0d0a = DOS Standard) CR (0x0d = Macintosh Standard) LF (0x0a = Unix Standard) |
Enter a number for the kind of newline character that should be used.
=value
This (re)defines the keyword "KEYWORD" and gives it the contents "value". Own keywords can be defined in this manner as well.
example:
%XX_TIME%=someTime
will redefine the time variable with the value "someTime"
A valid Targets.ini file (defining three targets) may look like below. The file may also contain specific 20-sim tokens (%MODEL_NAME%) that are described later on.
; Possible targets for 20-sim C-Code Generation
;
[targets]
StandAloneC
CFunction
20simDLL
Simulink
; Generate Stand-Alone C-Code for the complete 20-sim model
;
[StandAloneC]
targetName="Stand-Alone C-Code"
iconFile="20sim.ico"
description="Use this target when testing the complete 20-sim model as a single process."
SubmodelSelection=FALSE
templateDirectory="StandAloneC"
templateFiles=xxfuncs.c;xxfuncs.h;xxinteg.c;xxinteg.h;xxinverse.c
templateFiles=xxmain.c;xxmatrix.c;xxmatrix.h;xxmodel.c;xxmodel.h
templateFiles=xxtypes.h;%MODEL_NAME%.dsp;%MODEL_NAME%.dsw
targetDirectory="c:\temp\%MODEL_NAME%"
; Generate C-Code for a selected Submodel
;
[CFunction]
targetName="C-Code for 20-sim submodel"
iconFile="20sim.ico"
description="This is the C-Code as it was generated for a submodel in 20-sim version 3.1"
templateDirectory="CFunction"
templateFiles=xxfuncs.c;xxfuncs.h;xxinteg.c;xxinteg.h;xxinverse.c
templateFiles=xxmain.c;xxmatrix.c;xxmatrix.h;xxmodel.c;xxmodel.h
templateFiles=xxsubmod.c;xxsubmod.h;xxtypes.h;%SUBMODEL_NAME%.dsp;%SUBMODEL_NAM
E%.dsw
targetDirectory="c:\temp\%SUBMODEL_NAME%"
; Generate C-Code for a dynamic DLL-call to be used in 20-sim
;
[20simDLL]
targetName="20sim Dynamic Dll"
iconFile="20sim.ico"
description="Generate C-Code for a dynamic DLL-call to be used in 20-sim"
templateDirectory="20simDLL"
templateFiles=xxfuncs.c;xxfuncs.h;xxinverse.c
templateFiles=xxmatrix.c;xxmatrix.h;xxmodel.c;xxmodel.h
templateFiles=xxtypes.h;%SUBMODEL_NAME%.c
templateFiles=%SUBMODEL_NAME%.dsw;%SUBMODEL_NAME%.dsp;%SUBMODEL_NAME%.emx
targetDirectory="c:\temp\%SUBMODEL_NAME%"
; Generate C-Code for a Simulatink S-Function
;
[Simulink]
targetName="Simulink S-Function"
iconFile="mdl.ico"
description="This generates C-Code for a submodel to be used in Matlab/Simulink"
templateDirectory="Simulink"
templateFiles=%SUBMODEL_NAME%.c;xxinverse.c;xxmatrix.c;xxmatrix.h
templateFiles=xxmexfcs.c;xxmextps.h;xxtypes.h;%SUBMODEL_NAME%_.mdl
targetDirectory=c:\temp\%SUBMODEL_NAME%
postCommand=mex %SUBMODEL_NAME%.c