0

我想Simulink为实时目标准备一个文件。在主Simulink文件中,我有一个Model参考块,我将其设置为在Accelerator模式下运行。该Model块还包含几个S-functions. 该Model文件还配置为使用固定步长求解器。

但是,我收到此错误:

Caused by:
    Error using do_rt (line 410)
    The noninlined S-function 'whatever/Model' in a referenced model is not allowed
    to call macros that use the generic function in the SimStruct. To find such macros,
search for GenericFcn in simstruc.h

在为SIM目标构建时。

Normal如果我切换到块模式,一切都会很好Model

我应该如何解决这个问题?

4

1 回答 1

2

我想我找到了答案。以下是 S-Function + 模型参考的限制:http: //www.mathworks.se/help/simulink/ug/using-s-functions-with-model-referencing.html#bsp24qn-6

在以下情况下,引用模型不能使用非内联 S-Function:

  • 该模型使用可变步长求解器。
  • Simulink Coder™ 生成 S-Function。
  • S-Function 支持使用定点数作为输入、输出或参数。
  • 该模型在模型引用层次结构中被多次引用。要解决此限制,请使用普通模式。
  • S-Function 使用字符串参数。
于 2014-03-25T16:04:17.297 回答