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

2 visualizaciones (últimos 30 días)
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

Respuesta aceptada

akshatsood
akshatsood el 30 de Ag. de 2023
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 comentario
Szilard Hegyi
Szilard Hegyi el 13 de Nov. de 2023
Thanks for the answer, this seems to work, but also another way we solved it, was using the called model as a Referenced Subsystem

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Deployment, Integration, and Supported Hardware en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by