EPOS4 Maxon Group and beaglebone programmed from Simulink

I am trying to integrate EposCommandLibrary(shared library for linux applications) from MaxonGroup with simulink environment. My main goal is to put some c++ code in s-function builder block with some functions of EPOSCommandLibrary, and then this code is going to be deployed in my beaglebone black board with Embedded Coder. But i am getting some errors because my simulink model is not recognizing EPOSCommandLibrary and its functions. When you compile from linux terminal(beaglebone) you need to use gcc main.cpp -lEposCmd. As you can see, i need this parameter in the gcc compile command. I was wondering if i can compile my c++ code in simulink with gcc and put manually this flag.
Thank you for reading this!

 Accepted Answer

Hi,
You can add compile time flags to your build environment of Embedded Coder using the 'addCompileFlags' function.
For Example,
myModelBuildInfo = RTW.BuildInfo;
addCompileFlags(myModelBuildInfo,'-lEposCmd');
Hope this helps.

8 Comments

Hi! Thank you for you answer. I will try that and come back here if it works :)
I tried that, but i got this error when i press run/build:
Command "codertarget.arm_cortex_a.internal.addCompilerPath();" threw an error: The path 'bin' does not exist.
any ideia on this?
Can you give the complete output from the 'diagnostic viewer' when you get this error ?
I've just find out this error and now i am trying to do what you said:
myModelBuildInfo = RTW.BuildInfo;
addCompileFlags(myModelBuildInfo,'-lEposCmd');
However, the problem is:
EposCmd.lib needs to be instaled before in windows or linux environment, depending on which one you will use. I am creating my model and compiling it in a windows environment and the code generated will be deployed in beaglebone black, which is a linux embedded one. Is this going to be a problem?
Is there a way to implement my code and not worry about compiling in my windows pc? EposCmdLibrary is already installed in my beaglebone, so i just need the code to be copiled there.
For windows, i have the EposCmd.dll (Dynamic Link Library). I am trying to think a way to make this works with all the resources i've said.
Hi,
You can add '.dll' files to the build environment by using the 'addNonBuildFiles' function.
Syntax:
addNonBuildFiles(buildinfo,filenames,paths,groups)
Here, groups is an optional argument.
Example:
myModelBuildInfo = RTW.BuildInfo;
addNonBuildFiles(myModelBuildInfo, ...
{'myutility1.dll' 'myutility2.dll'}, ...
'/proj/dlls');
You can customise the build process by using the Build Process Customisation.
i tried hat and still it's not working... The diagnostic:
"mycode.c:(.text+0x200): undefined reference to 'VCS_opendevice' "
I am using S-function to call some C files that uses EposCmd library. When i build, this "undefined reference" error appears. It's not recognizing the library.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!