How to programmatically get tunable parameters from real time application.

Hello everyone,
I recently started using Matlab 2020b real-time on a SpeedGoat target. In the past, I used an external application to connect to the target machine and tune parameters (and scope signals) using the APIs provided by Matlab. From 2020b this is not possible anymore from what I understand reading the documentation. I started developing an app in Matlab to emulate our obsolete C# app.
With this app I would like to get a list of all the tunable parameters in the Application running on the target machine, which should be equivalent to following the procedure indicated in the figure below (slrtExplorer).
I cannot find the functions to do so. The closest thing I was able to get to is the function getParameter, but I think that works only on the development computer.
Any help is much appreciated!

 Accepted Answer

9 Comments

Hi Diego, thanks for the answer. I tried that already.
Does this mean that I need necessarily to have the application loaded on the target on my development computer as well?
No, you can also get the parameters from the generated application (modelname.mldatx file generated after build). All you need is the mldatx file in your host computer.
slrtApp = slrealtime.Application(mldatxfile)
signals = slrtApp.getSignals()
parameters = slrtApp.getParameters()
Ok, sorry I misused development computer I actually meant host. I always need to have access to the application on the host computer. So if I have a stand-alone application on the target computer and I don't have access to the mldatxfile on my host computer I canno retrieve the data from the application on the target, correct?
You can retrieve the parameters and signals either from the application loaded on the target computer, or from the application built in the host computer. Essentially, you need the MLDATX file, either on the target or host. (when you load an application, the MLDATX file is transferred to the target)
I understand and I thought that's how it worked, however I am not able to get that information. When I try this
slrtApp = slrealtime.Application(mldatxfile)
signals = slrtApp.getSignals()
parameters = slrtApp.getParameters()
I need the mldatxfile in the matlab path (host). I am not sure how to make it retrieve the parameters from the target rather than the host. I think I am missing a step.
Thanks
I see. Thanks a lot for the help.
Unfortunately several SLRT functions are available from 2021a on. E.g. getApplicationFile was introduced in 2021b. This is quite unfortunate, because the lack of these functions is making the development of SLRT applications in 2020b very difficult since APIs have been removed.
I will try a different approach then! I hope that these newly introduced functions will be included in some updates for 2020b.
Thanks again! Have a nice day.
Before getApplicationFile was shipped (R2021b), we had an hidden method: getAppFile()
Awesome! That did the trick!
Thanks a lot!

Sign in to comment.

More Answers (0)

Products

Release

R2020b

Community Treasure Hunt

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

Start Hunting!