- You stream data using matlab sdi command line interface. So you can add a logic in your simulink model to set a variable when it is time to trigger your pythn script.
- You can read trigger in matlab on host machine using sdi command line interface (this is just a simple matlab script that can start your real-time application and waits for a trigger from your target.)
- Once your your matlab script recieves the trigger it can lauch your python script with system() on your host machine.
Execute command on Host PC (windows) triggered by simulink real time model
조회 수: 11 (최근 30일)
이전 댓글 표시
Hello,
my setup is the following:
- Device under test (MCU board)
- Host PC (Windows) running simulink real time and python application
- Target PC (Speedgoat) running the real time application
I tried to use a test sequence to run the simulink model on the target PC while triggering a python script that activates specific functions on the device under test. I used the matlab
system()
command to run a .bat file to launch the python script but it is not supported by simulink coder hence it rightfully does not build the real time application.
How is it possible to trigger commands on the host PC from the target PC at runtime?
What I would like to verify with the real time application and hardware is if the sequence of commands written in the python script and launched by the host PC, are executed correctly by the device under test.
The following figure shows the configuration of the system.

Thank you
댓글 수: 0
답변 (1개)
Midhulesh Vellanki
2022년 3월 31일
This might be a little late but here is my suggestion:
Let me know how that works out for you
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Real-Time Simulation and Testing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!