Why does MATLAB hang or produce a segmentation violation when I use Real-Time Workshop to build a Simulink model which has a Simulink Parameter with a long character array?
I am using a Simulink Parameter in my model, which contains a long character array (>1000 characters). When I build my model, MATLAB will either hang or produce a segmentation violation:
Stack Trace: [0] libmx.dll:_mxGetNChars(0x2fbbe028, 0x3041d6c8 "[struct('block',['autocode3/Diff..", 3543, 0x2fbbe028) + 42 bytes [1] libmx.dll:_mxGetString(0, 0x3041d6c8 "[struct('block',['autocode3/Diff..", 3544, 0x2fbbe028) + 70 bytes [2] simulink.dll:_BdWriteMxArrayProperty(0x00df6c48, 0x2992aad0 "DefnBlocks_AtSource", 0x2fbbe028, 0x00df6c48) + 432 bytes [3] simulink.dll:struct slErrMsg_tag * __cdecl BdWriteUDDProperties(struct BdWriteInfo_Tag *,class UDInterface *,class UDInterface *,int)(0x00df6c48, 0x2ed79090, 0x2fbbe028, 24) + 913 bytes [4] simulink.dll:struct slErrMsg_tag * __cdecl BdWriteUDDObjectWithRecursion(struct BdWriteInfo_Tag *,class UDInterface *,int)(0x00df6c48, 0x0ab75a88, 25, 0x00df6ba8 "Àkß") + 188 bytes [5] simulink.dll:_BdWriteUDDObject(0x00df6c48, 0x2ed79090, 0x00df6bfc, 0) + 18 bytes [6] simulink.dll:struct slErrMsg_tag * __cdecl WriteModelParameters(struct RTWInfo_tag *)(0x00df6bfc, 0x00df6bfc, 0, 0x2fe4a2d8) + 2500 bytes [7] simulink.dll:struct slErrMsg_tag * __cdecl WriteRTWFile(struct RTWInfo_tag *)(0x2fe4a2d8, 0x00df6d44 "\mß", 2, 0x7a8a74e8) + 794 bytes [8] simulink.dll:void __cdecl DoRTWGen(struct RTWInfo_tag *,int,struct mxArray_tag * * const)(0x00df6bfc, 2, 0x00df6d80, 2) + 600 bytes [9] simulink.dll:_sleRTWGen(2, 0x00df6d80, 9, 0x00df6e48) + 140 bytes
Best Answer