Why do I get "Error: struct contains references from non-struct array object" when building my S-Function in Simulink Real-Time?
2 views (last 30 days)
Show older comments
Hi, I was trying to generate an S-function from a the 'Car_block.slx' for execution in Simulink Real-Time 2017b (the reason for not using newer version is that NI DAQs are not supported anymore in newer versions, and it would be great to see them back).
When doing the build and saving the block for previous versions (2017b), I obtain something like 'block_2017_car_atomic.slx'
Then, in order to be able to compile in 2017b, then I make the mex 'Car_block_sf.mexw64' with the sentence proveded in 'mexgenerator.m': mex -R2017b Car_block_sf.c Car_block_sfcn_rtw\rtGetNan.c Car_block_sfcn_rtw\rtGetInf.c
Finally, I try to run the 'block_2017b_car_atomic.slx' and I have no errors when simulating in the machine. Yet, when compiling to Simulink Real-Time (slrt.tlc), it appears to me the following error:
Error: Error detected: Struct contents reference from a non-struct array object.
.
Please, could you tell me why is this happening to me, and what should I do to be able to run my code in Simulink Real-Time 2017b?
Appart from that, would you be so kind to tell me if there is another way to use 'Vehicle Body 3DOF Dual Track' block (introduced in 'Vehicle Dynamics Blockset' in 2018a) in 2017b? As saving for previous version replaces blocks for empty subsystems.
Thanks a lot for your time and attention.
2 Comments
Answers (1)
Ayush
on 27 Dec 2023
I understand that you are facing the error: struct contains references from non-struct array object
You may look at this MATLAB answer for help: https://www.mathworks.com/matlabcentral/answers/357392-struct-contents-reference-from-a-non-struct-array-object-error-in-a-code?s_tid=srchtitle%22
Thanks!
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!