Effacer les filtres
Effacer les filtres

Parameter data type mismatch in C Function block

6 vues (au cours des 30 derniers jours)
Marco Wagner
Marco Wagner le 14 Août 2023
Réponse apportée : Animesh le 21 Août 2023
Hi there,
I'm using a C Funktion Block for integrating some user customized c funktions into simulink.
In the Symbols section in the C-funtion Block I add a Parameter scope to parametrize this block from the block parameter mask e.g set the SerielPort nummer.
When I do this I get the olling Error:
Parameter data type mismatch in C Function block 'HHTs/HandsHeld'. Block parameter 'COMPortNr' of type 'int8' does not match type of evaluated parameter 'COMPortNr'.
It does not matter whether I use the variable COMPortNr in my C code or not.
Please can someone Help me?
Best regards
Marco

Réponses (1)

Animesh
Animesh le 21 Août 2023
Hello Marco,
To resolve this issue, you need to ensure that the data type of the evaluated parameter 'COMPortNr' matches the data type specified in the block parameter 'COMPortNr'. Here are a few steps you can take to troubleshoot and fix the problem:
  • Check the data type of the evaluated parameter 'COMPortNr': Make sure that the evaluated parameter 'COMPortNr' is defined as an 'int8' data type.
  • Verify the data type of the block parameter 'COMPortNr': Double-check that the block parameter 'COMPortNr' is indeed set to 'int8' in the block parameter mask.
  • Ensure consistency in the C code: If you are using the variable 'COMPortNr' in your C code, make sure that its data type matches the block parameter and evaluated parameter.
By ensuring that the data type of the evaluated parameter, block parameter, and C code variable 'COMPortNr' are all consistent and set to 'int8', you should be able to resolve the parameter data type mismatch error in the C Function block.
Thanks,
Animesh

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by