You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got a issue when trying to export simple model through s-function target for Model Exchange.
I simply created a new enum type BOOL_TYPE and some other typedef to use in my model.
During the FMU export for that model, when it generate model_interface.c file it create 2 times case with same value 8 and create 3 times case with value 0.
model_interface.c
D:\Manmohan\REF\Ref_V6\work\test_func_sfcn_rtw_fmi\model_interface.c(49): error C2196: case value '8' already used [D:\Manmohan\REF\Ref_V6\work\test_func_sfcn_rtw_fmi\test_func.vcxproj]
D:\Manmohan\REF\Ref_V6\work\test_func_sfcn_rtw_fmi\model_interface.c(52): error C2196: case value '0' already used [D:\Manmohan\REF\Ref_V6\work\test_func_sfcn_rtw_fmi\test_func.vcxproj]
D:\Manmohan\REF\Ref_V6\work\test_func_sfcn_rtw_fmi\model_interface.c(55): error C2196: case value '0' already used [D:\Manmohan\REF\Ref_V6\work\test_func_sfcn_rtw_fmi\test_func.vcxproj].
please let me know the solution.
To reproduce - Create a simple model and add some user defined enum types(boolean) and typedef(any base type). assign variables in the model with these enum or typedef. Then export the FMU. it will through this error.
The text was updated successfully, but these errors were encountered:
I can successfully export the above model with R2020a if I remove the sources in Configuration Parameters > Simulation Target (these are not required for the model).
Please re-open if the problem persists and provide steps to reproduce.
I got a issue when trying to export simple model through s-function target for Model Exchange.
I simply created a new enum type BOOL_TYPE and some other typedef to use in my model.
During the FMU export for that model, when it generate model_interface.c file it create 2 times case with same value 8 and create 3 times case with value 0.
size_t getCGTypeSize(int typeIndex)
{
switch (typeIndex) {
case 0:
return 8; /* real_T */
case 1:
return 4; /* real32_T */
case 2:
return 1; /* int8_T */
case 3:
return 1; /* uint8_T */
case 4:
return 2; /* int16_T */
case 5:
return 2; /* uint16_T */
case 6:
return 4; /* int32_T */
case 7:
return 4; /* uint32_T */
case 8:
return 1; /* boolean_T */
case 9:
return 0; /* fcn_call_T */
case 10:
return 4; /* int_T */
case 11:
return 8; /* pointer_T */
case 12:
return 8; /* action_T */
case 13:
return 8; /* timer_uint32_pair_T */
case 8:
return 1; /* BOOL_TYPE */
case 0:
return 8; /* TemperatureType */
case 0:
return 8; /* Q16_15_TYPE */
default:
return 0; /* unknown type */
}
}
Error given in Matlab is
model_interface.c
D:\Manmohan\REF\Ref_V6\work\test_func_sfcn_rtw_fmi\model_interface.c(49): error C2196: case value '8' already used [D:\Manmohan\REF\Ref_V6\work\test_func_sfcn_rtw_fmi\test_func.vcxproj]
D:\Manmohan\REF\Ref_V6\work\test_func_sfcn_rtw_fmi\model_interface.c(52): error C2196: case value '0' already used [D:\Manmohan\REF\Ref_V6\work\test_func_sfcn_rtw_fmi\test_func.vcxproj]
D:\Manmohan\REF\Ref_V6\work\test_func_sfcn_rtw_fmi\model_interface.c(55): error C2196: case value '0' already used [D:\Manmohan\REF\Ref_V6\work\test_func_sfcn_rtw_fmi\test_func.vcxproj].
please let me know the solution.
To reproduce - Create a simple model and add some user defined enum types(boolean) and typedef(any base type). assign variables in the model with these enum or typedef. Then export the FMU. it will through this error.
The text was updated successfully, but these errors were encountered: