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 CenterFile Exchange에서 Simulink 函数에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!