Simulink Real-Time input and Output to computer program

조회 수: 7 (최근 30일)
Sam Bond
Sam Bond 2017년 8월 9일
답변: Jon Lobo 2017년 8월 9일
I'm currently working on a project in my spare time where I am designing control systems and implementing them in Kerbal Space Program (a space physics sandbox). I am using KRPC which allows me to stream data and send commands to the program in C#, C++, Java, Lua and Python.
I've had quite a lot of success so far, I've been using MATLAB and Simulink to design my controllers and ave then been implementing them in Java. Is there any way to use Simulink Real-Time to simplify the implementation of my controllers? I've read that Simulink Real-Time C API allows you to "write the custom program in a high-level language (such as C, C++, or Java®) that works with a real-time application. This option requires that you are an experienced programmer.". I wouldn't describe myself as an experienced programmer (I'm an undergraduate Aerospace Engineering student), however KRPC allows me to send and receive data from KSP easily as well as allowing me to send commands to spacecraft in a format that I am very familiar with.
My question: Given all of this, is it possible for me to use Simulink Real-Time to design and implement control systems in C++ or Java?
I am very comfortable using Simulink but Simulink Real-Time is something that I've never used before and I'm struggling to find the information about whether it could be appropriate for this project.
Thanks, Sam

채택된 답변

Jon Lobo
Jon Lobo 2017년 8월 9일
Hi Sam,
Simulink Real-Time leverages a dedicated computer running the Simulink Real-Time Kernel. Using Simulink Coder, you can generate C code from your Simulink model (control system), compile to a real-time application, and download to the dedicated real-time target computer. Within MATLAB, there is an API to allow you to interact with your control system that is now on the target computer: you can do things like tune parameters, log data, and build UIs for example.
I know this was a lot of build up, but the end point is that there is a C API for this to allow users to create applications outside of MATLAB that are intended to connect to the real-time application running on the real-time target.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Target Computer Setup에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by