From spreadsheet in simulink real time

조회 수: 14 (최근 30일)
Enzo Yacometti
Enzo Yacometti 2024년 2월 6일
댓글: shen hy 2024년 10월 26일
Hello I’m interested in importing data from an Excel sheet or CSV file into a real time application but trying to build it I get the error “from spreadsheet block supports rapid simulation target and the following simulation modes: normal, accelerator and rapid accelerator”, is there a way to import data from files for a real time application?
  댓글 수: 2
Jaswanth
Jaswanth 2024년 2월 7일
Could you provide more details about the error you are facing? Also, by real time application, do you mean Simulink Real-Time Explorer?
Enzo Yacometti
Enzo Yacometti 2024년 2월 7일
The error is the one I stated above and it occurs when trying to build the model into a real time application for a speedgoat target machine (using Simulink Real Time). It doesn’t give any more info, it just throws the error and doesn’t allow the build to continue…

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

채택된 답변

Anshuman
Anshuman 2024년 2월 7일
Hi Enzo,
When working with real-time applications in MATLAB and Simulink, certain blocks that are available for simulation are not supported for real-time execution. The "From Spreadsheet" block, as indicated by the error message, does not support real-time targets directly.
However, you can import data from Excel sheets or CSV files for use in a real-time application by pre-processing the data before compiling your real-time application. Here's a general approach on how to do it:
  1. Read the data into MATLAB workspace using MATLAB functions such as "readtable", "xlsread", or "csvread".
  2. Process the data if necessary.
  3. Once you have your data in the workspace, save it to a MAT-file.
  4. In your Simulink model, you can use the "From File" or "From Workspace" block to load the data from the MAT-file. These blocks are typically supported for real-time applications.
  5. Make sure that the block is configured correctly for real-time execution. For the "From File" block, you'll need to ensure that the file is formatted correctly (as a MAT-file with a time series or a structure with time), and for the "From Workspace" block, you'll need to use an appropriate format supported by real-time targets.
  6. Once you have incorporated the data into your model using the appropriate block, you can proceed to build and deploy your real-time application.
  댓글 수: 2
Enzo Yacometti
Enzo Yacometti 2024년 2월 7일
Thank you very much. I was surprised to not see a warning in the “From Spreadsheet” page about this incompatibility, maybe it’s something worth mentioning there. Cheers!
shen hy
shen hy 2024년 10월 26일
you can choose rsim.tlc target,this will allow you generate code by “From Spreadsheet block”

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by