Why i got this error and how to solve it?

조회 수: 10 (최근 30일)
katuysha
katuysha 2023년 4월 17일
답변: Govind KM 2024년 9월 26일
I try to use ‘final states-save final operating piont’,but got the error:
" An error occurred while running the simulation and the simulation was terminated
Caused by:
  • Simulink is unable to save the operating point of the C Level-2 S-Function (sfun_Controller) block '***/sfun_Controller' because the S-function has pointer work (PWork) vectors.
"
Why there are pionter vectors and how to deal with them?

답변 (1개)

Govind KM
Govind KM 2024년 9월 26일
I was facing a similiar issue when simulating my model containing S-functions. A workaround for me was to turn off the Save final operating point setting in the Data Import/Export section in the Configuration Parameters.
If saving the simulation state is necessary for your workflow, some changes can be made to the S-function to accomodate this functionality. The following documentation suggests how to achieve this using the "GetOperatingPoint" and "SetOperatingPoint" functions, along with an example:
Pwork (or Pointer work) vectors store pointers to data structures, serving as interfaces between S-functions and other applications. More information can be found in the following documentation:
Hope this helps!

카테고리

Help CenterFile Exchange에서 Prepare Model Inputs and Outputs에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by