Simulink and C++ program cosimulation

조회 수: 21 (최근 30일)
Lukasz Wajdzik
Lukasz Wajdzik 2011년 8월 3일
Hello, I have an application written in C++ (VC) which is event trigged program and I want to couple it with a plant model made in simulink. The challenge is that the C++ program should transmit an input to the plant (to simulink) and receive an output back in steady intervals (from simulink). Depending on the output the input can be modified by C++ program. Simulink and C++ program should work simultaneously and exchange data. Is it possible? Thanks in advance for any answers.

채택된 답변

Kaustubha Govind
Kaustubha Govind 2011년 8월 3일
Yes, you can create a C++ S-function block and use your C++ as if it were any other block in your Simulink model.
  댓글 수: 1
Lukasz Wajdzik
Lukasz Wajdzik 2011년 8월 9일
Thank you for your answer! The problem is that I don't want to put my program into S-function block. My C++ program have to be a stand-alone application which should cooperate with simulink model. Maybe it's possible to build an interface using S-function to exchange data between this two different environments during simulation time..

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Block and Blockset Authoring에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by