% without prior written authorization.
%
% File : rpp_generate_lib.m
+% Abstract:
+% Generates library rpp_lib.slx for targets
%
% References:
% http://www.mathworks.com/help/matlab/ref/mex.html
[tok, blockName] = strtok(newBlocks{k}, '/');
blockName = ['rpp_lib', blockName];
disp([' ', newBlocks{k}, ' as ', blockName]);
- add_block(newBlocks{k}, blockName);
+
+ % Copy rather than link blocks to rpp_lib. This is
+ % because we don't want rpp_update_blocks_for_target
+ % below to modify the original blocks.
+ add_block(newBlocks{k}, blockName, 'LinkStatus', 'none');
end
close_system(blockFilePath, 0);
end
+
+ % Set ForwardingTable
+ mv = 9999.9999; %get_param('rpp_lib', 'ModelVersion');
+ ft = {
+ {'rpp_lib/General Purpose Digital Input', ...
+ 'rpp_lib/General Purpose Digital Input', ...
+ 0, mv, 'rpp_block_transform' },
+ {'rpp_lib/General Purpose Digital Output', ...
+ 'rpp_lib/General Purpose Digital Output', ...
+ 0, mv, 'rpp_block_transform' },
+ };
+ set_param('rpp_lib', 'ForwardingTable', ft);
+
+ rpp_update_blocks_for_target()
+
disp(['Closing and saving file ', 'rpp_lib.slx']);
set_param('rpp_lib', 'Lock', 'on');
+ save_system('rpp_lib');
close_system('rpp_lib.slx', 1);
end