Rapid Accelerator and sldrt.tlc compile issue: Code Generation and simulation targets registered different sets of persistent variables for the block.

조회 수: 4 (최근 30일)
Hello,
When I run my code with normal or accelerator mode or compile using grt.tlc my model executes succesfully. If I attempt to use rapid accelerator or sldrt.tlc, I receive this error:
Code generation and simulation targets registered different sets of persistent variables for the block. External or Rapid Accelerator mode simulation requires code generation and simulation targets to register the same set of persistent variables for this block. This discrepancy is typically caused by MATLAB functions that have different code paths for simulation and code generation targets where these code paths define different sets of persistent variables. Please identify these code paths in the offending block and rewrite the MATLAB code so that the set of persistent variables is the same between simulation and code generation.
This model is based almost entirely around stateflow and simply imports data from a binary file reader.
Things I've tried:
  1. Completely removed persistent variables from called matlab functions
  2. Followed this heirarchy for compiling matlab functions, made everything a subfunction, and then removed all extra files from the folder location. https://www.mathworks.com/help/coder/ug/how-matlab-resolves-function-calls-in-generated-code.html
  3. Tried various other compiling targets. Embedded coder returns a sizing error that I don't intend to fix currently.grt.tlc works great.
I can't find any information on the 2 seperate paths the error is referring to so I would be interested in knowing if that's a setting somewhere.

답변 (1개)

Pablo Romero
Pablo Romero 2022년 5월 31일
Please check out the following bug report.

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by