필터 지우기
필터 지우기

slrealtime.Application fails with "Enter a valid application name"

조회 수: 12 (최근 30일)
Jeffrey
Jeffrey 2023년 10월 26일
댓글: Jeffrey 2023년 10월 31일
Hi,
When I try to run slrealtime.Application('<appname>'), where <appname> is my application name without the .mldatx extension, I get an error message saying I need to enter a valid application name. I've tried passing the application name with and without the path, but it fails either way. Any idea what I might be doing wrong? Here is the error message below:
>> tg.getInstalledApplications
ans =
1×1 cell array
{'<appname>'}
>> slrealtime.Application('<appname>')
Error using slrealtime.internal.Application
Enter a valid application name
Error in slrealtime.Application

답변 (1개)

Varun
Varun 2023년 10월 30일
Hi Jeffrey,
Looks like you are trying to run "slrealtime.Application('<appname>')" where <appname> is the application name without ".mldatx" extension but you are facing an error message as "Enter a valid application name".
The functions "tg.getInstalledApplications" and "slrealtime.Application('<appname>')" which you have used appears to be correct. However, you can follow some workarounds to troubleshoot the issue:
  1. Ensure that you created the "slrealtime.Application('<appname>')" object only after the real-time application has been built. The argument is the file name without the ".mldatx" file extension of the MLDATX file that the build produces on the development computer.
  2. Ensure that you have specified the correct application name without any typos or case sensitivity issues.
  3. Make sure that your MATLAB working directory is set to the folder where your Simulink Real-Time application resides. The application name should be specified relative to this directory. If you are not in the correct directory, MATLAB might not be able to find the application.
  4. Verify that the application files are present in the specified directory. The application name you provide should correspond to the .mldatx file that represents your Simulink Real-Time application.
Please refer to the following documentation to learn more about using "slrealtime.Application()" function:
  댓글 수: 1
Jeffrey
Jeffrey 2023년 10월 31일
It seems simulink doesn't know the path, so I had to go through a convoluted set of commands to get it to work:
myAppName = tg.ModelStatus.Application;
myFileName = tg.getApplicationFile(myAppName);
myApp = slrealtime.Application(myFileName);

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by