This Worklist Item is a MATLAB/Simulink Limitation
S-Function conversion does not support the conversion of functions that read/write from/to a memory address. This is common in code that implements memory-mapped I/O.
We recommend not converting this low level code construct since there is no good way of representing it in a Simulink model so that the generated code properly supports it. One approach could be to not convert this low level code and instead make it interact with the generated code from a Simulink model. Anyway, some support for this kind of code is included in Simulink/Stateflow conversion, where the memory location is represented as an Inport or/and Outport. Thus, you could select Simulink/Stateflow conversion if any of these options are available.
For further support, contact EnSoft Support at support@ensoftcorp.com