I have written an S-function that uses Windows API functions. When I try to compile this model using sldrt.tlc to run the real-time simulation in External Mode, I receive the following build error using MATLAB R2020a:
In file included from ...\myFunction.c:134:C:/PROGRA~1/MATLAB/R2020a/toolbox/sldrt/lib/include\Windows.h:16:2: error:Attempt to include "windows.h"C:/PROGRA~1/MATLAB/R2020a/toolbox/sldrt/lib/include\Windows.h:17:2: error:The model being compiled contains a block that can run on host only and cannot becompiled for External Mode. Please either switch to Normal Mode or remove the block.
When I add an S-Function to my model, is there a limitation as to the C library functions it can use with Simulink Desktop Real-Time simulation in External Mode?
Best Answer