Integrate existing C++ code into SimuLink model
Show older comments
I am working with 3D simulation software called OrcaFlex to simulate platform motions at sea. Within this program I am using an external function through a DLL file, programmed in C++. This C++ code extracts data, performs a calculation and then inputs the results back into OrcaFlex.
I now want to extent the calculation part with for example a PID controller. I'd like to do this through SimuLink an eventually compile the resulting SimuLink model into a new DLL that can work with OrcaFlex.
Simply said I need a block that extracts data from the software using the existing C++ code, perform calculations using simple m files and then input the result back into the software again with existing C++ code.
My question is: how can I use functions or variables from the existing C++ code in my SimuLink model? I've seen options such as the S-Function builder and the Legacy Code Tool, but I'm not sure how these will work for me.
Thanks in advance!
Accepted Answer
More Answers (0)
Categories
Find more on Simulink Coder in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!