0

I am currently using Matlab Simulink with a Raspberry Pi. I have been using the S-Function Builder block to generate an S-Function that I am using with the S-Function Block. However, I always need to keep a copy of the S-Function builder that I need to build at the first start, as Simulink otherwise tells me :

"Error in S-function 'read_accelerometer/S-Function': S-Function 'sfun_read_adxl345' does not exist"

I am keeping the .c and the wrapper.c file, as well as the mexw64 and the tlc files. But that does not matter - I still have to rebuild the S-Function using the Builder block every time I reload my model.

How to circumvent this issue?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Domack
  • 75
  • 11
  • mex and tlc on the search path? – Daniel Jul 15 '15 at 13:13
  • All of them, the sfun.c, the sfun_wrapper.c, the .mexw64 and the .tlc are at the root of the path. – Domack Jul 15 '15 at 13:20
  • The sad part of this is that now that I have copied the S-Fun Builder inside my model, I am getting another error: "undefined reference to `sfun_read_adxl345_Outputs_wrapper'" ... – Domack Jul 15 '15 at 13:26

1 Answers1

0

Ok, this is kinda sad that I am answering my own question ... I had a startup script that messed with the mexw64. So, always keep the mexw64 file, even if it is not needed. (recompilation on Raspberry Pi) Also, specify the generated wrapper function as a module in the S-Fun block.

Domack
  • 75
  • 11