S-function and TLC code

2 views (last 30 days)
PEDRO HENRIQUE Ulhoa
PEDRO HENRIQUE Ulhoa on 9 Feb 2021
Hi! I am trying to run a simulink model that contains a S-function. This Sfun brings C code to my model and the target hardware is the beaglebone black. Basically, i am trying to control EPOS4 driver (Maxon Group Motors) with my beaglebone(BBB), but i am using simulink in a windows computer to create the model and deploy the generated code to BBB. There is a library (EposCommandLibrary) that is installed in beaglebone black so i can communicate with EPOS4 from a linux computer. I found this package here: https://ch.mathworks.com/matlabcentral/fileexchange/60218-epos2-support-for-simulink-coder-in-linux-and-raspberry-pi. I am trying to use it but i receive errors in the Code Generation step, basically saying that the EposCommandLibrary's functions were not recognized : "undefined reference to .....<name of the function>". What I am trying to understand is: when i run the model in External Mode, the code (s-function) is compiled in the beaglebone black? or in the windows computer? Because if it is from windows computer i think i have a problem once beaglebone is Linux and Eposcommandlibrary only have .lib files that depends on the OS.
The .tlc file in the link I mentioned has the lines:
%assign ret = FEVAL("realtime.addBuildInfoLinkerFlag", "-lEposCmd", CompiledModel.Name)
%assign ret = FEVAL("realtime.addBuildInfoLinkerFlag", "-lftd2xx", CompiledModel.Name)
So i assumed that tlc file helps generate code for the target file and then the code is copiled in the target. These flags "-lEposCmd" and "-lftd2xx" is used when EposCommandLibrary is being used in Beaglebone or Raspberry.
Please any idea will help!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!