フィルターのクリア

Issues regarding XCP CAN config when using it in a Referenced Model in Normal mode

1 回表示 (過去 30 日間)
Hi
I'm trying to use the XCP CAN config block in a referenced model, let's say a Hil model referenced in a Test harness, and I get the following error.
'The S-Function 'sxcpcanconfig' in 'HilMdl/XCP_A/XCP CAN Configuration' has a mdlStart and a mdlProcessParameters function. This is not supported when used in a model referenced in normal mode, unless the S-Function has called ssSetModelReferenceNormalModeSupport with the value MDL_START_AND_MDL_PROCESS_PARAMS_OK'
I'm not yet familiar with the S functions capability, but how can I modify the apropriate S function in order for it to work.
I found this support page, which tells what to modify, but I'm not sure where to insert it in my generated cpp code.
Thanks

採用された回答

akshatsood
akshatsood 2023 年 8 月 30 日
Hi Szilard,
I understand that you are facing issues working with XCP CAN config in a Referenced Model in Normal Mode. In response to the error mentioned, it advocates the use of ssSetModelReferenceNormalModeSupport with the value MDL_START_AND_MDL_PROCESS_PARAMS_OK. It is worth noting that when a C S-function appears in a referenced model that executes in Normal mode, successful execution is impossible if all of the following are true:
  • The S-function has both an mdlProcessParameters function and an mdlStart function.
  • The mdlProcessParameters function depends on the mdlStart function.
  • The referenced model calls mdlProcessParameters before calling mdlStart.
As per my understanding, error originates because mdlProcessParameters has dependency requirements that mdlStart has not satisfied. Examples of such dependencies include:
  • Allocating memory in mdlStart and using that memory in mdlProcessParameters. This is often done using ssSetUserData and ssGetUserData.
  • Initializing any DWork or any global memory in mdlStart and reading the values in mdlProcessParameters.
Going by the suggestion raised in the error, you can include the following statement in mdlInitializeSizes
ssSetModelReferenceNormalModeSupport(S, MDL_START_AND_MDL_PROCESS_PARAMS_OK);
Have a look at below references for better understanding
I hope this helps.
  1 件のコメント
Szilard Hegyi
Szilard Hegyi 2023 年 11 月 13 日
Thanks for the answer, this seems to work, but also another way we solved it, was using the called model as a Referenced Subsystem

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Environment Customization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by