Specified key type does not match the type expected for this container. in Simulink code from TCLAB (using Arduino Leonardo and TCLab)

2 visualizaciones (últimos 30 días)
Hi i'm trying to run the TCLab Code for PID in the simulink files, package from Matlab and Simulink for arduino installed correctly, but at the moment of running the program the following picture shows:
Error due to multiple causes.
Caused by:
Specified key type does not match the type expected for this container.
Error evaluating MATLAB function in 'arduino_pid/Temperature Control Lab/Arduino/Arduino'
When i try to Run the code from Simulink it shows:
An error occurred while running the simulation and the simulation was terminated
Caused by:
And a yellow error block showing a Matlab function block of 'interpreted MATLAB fcn.
There are the same code, one is running from the MATLAB Console and the other is running from a .slx file (it shouldn't matter cause is the same file).
And reinstalling or remove package and add-ons isnt working , thanks in advance. (this error is caused in the 2023b version)

Respuesta aceptada

Uday
Uday el 23 de Oct. de 2023
Dear Camilo,
As per my understanding, you are encountering an issue while trying to run the “TCLab” Code for “PID” in Simulink. You’ve also mentioned that reinstalling or removing packages and add-ons hasn’t resolved the issue.
Here are some possible solutions to resolve the error:
  1. Check Key Type: The error message suggests that there might be a mismatch between the expected key type and the specified key type in your code.
  2. Interpreted MATLAB Function Block: You mentioned a yellow error block showing a MATLAB function block of “interpreted MATLAB fcn”’. The Interpreted MATLAB Function block applies a specified MATLAB function or expression to the input. If there’s an issue with this function or expression, it could lead to errors: https://www.mathworks.com/help/simulink/slref/interpretedmatlabfunction.html.
  3. Reinstallation Issues: If reinstalling or removing packages and add-ons isn’t working, ensure that you’re following the correct steps for uninstallation and reinstallation. Since you mentioned that this error is occurring in the 2023b version, it’s possible that there might be some compatibility issues, check for the compatibility issues if any (https://www.mathworks.com/hardware-support/arduino.html).
I hope this helps!
  1 comentario
Camilo Vicente Gonzalez Pozo
Camilo Vicente Gonzalez Pozo el 25 de Oct. de 2023
Thanks Uday , most probably is that MATLAB 2023b no longer support interpreted MATLAB fcn , because i tried the same code in a 2021b version and it works (in the interpreted MATLAB fcn was a notification of end in support that block), do you think if i re code that blocks with a s-function or MATLAB function block , maybe i could Run the code successfully ?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Programmatic Model Editing en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by