How to recognize boolean types in C caller block? 如何使用C Caller blcok 调用boolean数据类型

1 回表示 (過去 30 日間)
Xiaoning.Wang
Xiaoning.Wang 2023 年 11 月 24 日
Currently, I am using C Caller Block to call C code, which contains a Boolean data type as an input parameter. I have also defined a Boolean, but Simulink cannot recognize this Boolean class.
目前我使用了 C Caller Block 调用 C代码, 其中C代码包含了boolean数据类型,作为一个输入形参,同时我也定义了boolean, 但是simulink竟然识别不到这个Boolean这个类。
#ifndef _RTE_RTEinterfaceInput_H_
#define _RTE_RTEinterfaceInput_H_
typedef unsigned char uint8;
typedef unsigned char boolean;
#define false (0U)
#define true (1U)
void MIL2SIL(uint8 u1, boolean u2)
{
Temp_MMI_SaveElecSwitchModeSts = u1;
Temp_BMSH_stHeatRelay = u2;
}
In the Simulink model, u1 and u2 must be set to uint8 in order to be compiled successfully, otherwise data type conflicts will occur and Simulink compilation will not pass
在simulink模型中,u1 和 u2必须设置为uint8,才可以编译通过,否则数据类型冲突,simulink编译不通过

回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink 函数 についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!