How to recognize boolean types in C caller block? 如何使用C Caller blcok 调用boolean数据类型
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!