- What are the available interfaces and APIs to interact with Speedgoat & Simulink Real-Time as a Test Engineer?
- What are the available interfaces and APIs to interact with Speedgoat & Simulink Real-Time as a Standalone Operator?
Can I interact with a Speedgoat real-time simulation from Python?
32 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 31 Ott 2018
Modificato: MathWorks Support Team
il 4 Feb 2025 alle 6:27
I would like to interact from our host computer with our Speedgoat machine to observe signals and update tunable parameters during runtime.
The goal is to be able to do this via a Python script or GUI. What would be the best way to accomplish this?
Risposta accettata
MathWorks Support Team
il 17 Gen 2025
Modificato: MathWorks Support Team
il 4 Feb 2025 alle 6:27
The MATLAB Engine API provides a package for Python to call MATLAB as a computational engine. An overview of this feature can be found at the following link:
To use the MATLAB Engine API for Speedgoat target computer & real-time simulation interaction, a full installation of MATLAB and Simulink Real-Time (including licenses) is required. With that, you will have full access to MATLAB's Simulink Real-Time features from Python.
For details on how to interact with a Speedgoat target machine and real-time simulation from Python, refer to the following example:
Note that the example above was designed to work with release R2020b or later. If you are working with R2020a or older, you will need to modify the code with the functions that are supported with your current release. For instance, you can access the release-specific documentation for the SimulinkRealTime.target object by executing the following command in the MATLAB Command Window:
>> web(fullfile(docroot, 'xpc/api/simulinkrealtime.target.html'))
Tip: One thing to suggest while developing the Python interface is using the "-desktop" startup option when creating the engine. This will make the MATLAB instance visible, and will be useful in testing how the MATLAB Engine API interacts with the MATLAB instance for debugging and development purposes:Start MATLAB Engine for Python - MATLAB matlab.engine.start_matlab (mathworks.com)
Alternatives to Python:
The recommended method for interacting with a Speedgoat target machine is through a GUI created with MATLAB's App Designer as shown in the following link:
The App Designer workflow also supports the standalone operation of the GUI (without any MATLAB installation or license).
For a complete overview of available interfaces that don't require the full Simulink Real-Time license suite, refer to the MATLAB Answer posts below:
Please use the below link to search for the required information in the current release:
0 Commenti
Più risposte (1)
Pablo Romero
il 19 Nov 2021
Please find a complete example at Run Real-Time Application by Using Python Script - MATLAB & Simulink (mathworks.com).
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!