필터 지우기
필터 지우기

Changing Simulink Real-Time Workspace Variable

조회 수: 10 (최근 30일)
Reza Jatnika
Reza Jatnika 2020년 3월 9일
댓글: Jonas 2022년 1월 18일
I am currently working on Simulink Real Time (with Speedgoat). I want to change some variables in Model Workspace, from outside Speedgoat (using UDP connection or Serial Port).
I can't use assignin because it is not supported for code generation. Is it possible to do this?

답변 (1개)

Jonas
Jonas 2020년 3월 9일
You should use the command setparam. Typical command is: setparam(tg,'speed_setpoint',100) for changing parameter 'speed_setpoint' on your target tg = slrt.
  댓글 수: 4
Calvin Watson
Calvin Watson 2022년 1월 18일
Thank you Jonas. I can now edit tunable params during running :). I am using a GUI (matlab app) to alter the inputs into the model ad hoc. Is setparam the only method of driving the realtime model using the GUI?
Jonas
Jonas 2022년 1월 18일
setparam is a direct way, and until recently the only way to build a MATLAB App that interfaces with a SLRT application.
With the recent update to SLRT, I believe they have expanded the way you can interface with a SLRT application. An alternative way now would be to use Instrumentation.
I have no experience with it but it should be a more convenient way of reading signals and displaying them on elements, and changing parameters without having to manually program it all.
For displaying a real-time graph, I used to program capturing of signals linked to a timer object to refresh the graph in a MATLAB App, but they made it more user-friendly from what I understand.

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

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by