| Real-Time Workshop® | ![]() |
Package model code in zip file for relocation
packNGo(buildinfo, propVals...)
propVals is optional.
Build information returned by RTW.BuildInfo.
A cell array of property-value pairs that specify packaging details.
| To... | Specify Property... | With Value... |
|---|---|---|
| Package all model code files in a zip file as a single, flat directory | 'packType' | 'flat' (default) |
Package model code files hierarchically in a primary zip file
that contains three secondary zip files:
| 'packType' | 'hierarchical' Paths for files in the secondary zip files are relative to the root directory of the primary zip file. |
| Specify a file name for the primary zip file | 'fileName' | 'string' Default:'model.zip' |
The packNGo function packages the following code files in a compressed zip file so you can relocate, unpack, and rebuild them in another development environment:
Source files (for example, .c and .cpp files)
Header files (for example, .h and .hpp files)
Nonbuild-related files (for example, .dll files required for a final executable and .txt informational files)
MAT-file that contains the model's build information object (.mat file)
You might use this function to relocate files so they can be recompiled for a specific target environment or rebuilt in a development environment in which MATLAB® is not installed.
By default, the function packages the files as a flat directory structure in a zip file named model.zip. You can tailor the output by specifying property name and value pairs as explained above.
After relocating the zip file, use a standard zip utility to unpack the compressed file.
Package the code files for model zingbit in the file zingbit.zip as a flat directory structure.
set_param('zingbit','PostCodeGenCommand','packNGo(buildInfo);');
Then, rebuild the model.
Package the code files for model zingbit in the file portzingbit.zip and maintain the relative file hierarchy.
cd zingbat_grt_rtw;
load buildInfo.mat
packNGo(buildInfo, {'packType', 'hierarchical', ...
'fileName', 'portzingbit'});Programming a Post Code Generation Command
Relocating Code to Another Development Environment
![]() | getSourcePaths | rtwreport | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |