How to set 'Target Hardware' in Simulink Embedded Coder from a script?

限于喜欢 提交于 2019-12-12 02:35:23

问题


I have a Simulink project with a lot of sub-projects. I have different environments for which I need to generate code from Simulink. So I am trying to set the Target Hardware from a MATLAB script. I can change other settings just fine, but I don't know how the name of the Target Hardware parameter so I can use set_param(). I have searched for it, but can't seem to find it and it appears that there isn't one.

models = {'Model1','Model2','Model2'};

for i=1:length(models)
    open(char(models(i)));
    set_param(char(models(i)),'TargetLang','C++');
    set_param(char(models(i)),'CodeInterfacePackaging','Nonreusable function')
    set_param(char(models(i)),'MaxIdLength','63')

    set_param(char(models(i)),'ZeroExternalMemoryAtStartup','off');
    set_param(char(models(i)),'Toolchain','Linaro Toolchain v4.8');
    save_system(char(models(i)));
end

Does anyone know how to set the Target Hardware from a MATLAB script? It doesn't have to be set_param.

EDIT

I am using MATLAB 2014a and a screen shot is below.


回答1:


Is TargetHWDeviceType what you are after? This can be set with set_param. It seems to apply to both Device Vendor and Device Type.

EDIT

The correct setting to use is ProdHWDeviceType. For example, to set it to an MPC55xx from Freescale, you need to do:

set_param(bdroot,'ProdHWDeviceType','Freescale->MPC55xx')


来源:https://stackoverflow.com/questions/28588112/how-to-set-target-hardware-in-simulink-embedded-coder-from-a-script

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!