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

2 次查看(过去 30 天)
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)

采纳的回答

Uday
Uday 2023-10-23
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 个评论
Camilo Vicente Gonzalez Pozo
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 ?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by