Serial Receive in Desktop Real-Time Kernel Mode
2 次查看(过去 30 天)
显示 更早的评论
I am trying to get an input from a serial input in Simulink Desktop Real-Time.
To do so I have a "Serial Configuration" block and a "Serial Receive" block which is connected to a "To Workspace" block. (see screenshot below)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1076545/image.png)
I am able to run the model in "Conneceted IO Mode". However, if I change the mode to "Kernel Mode", the model does not work anymore. Simulink states:
Serial Failed Code genreation inofrmation file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 19.781s
Error(s) encountered while building "Serial_Read"
Is it possible to use serial inputs in "Kernel Mode"? If yes, how can I avoid getting this error?
回答(1 个)
Ayush
2024-4-1
编辑:Ayush
2024-4-1
Hi Kreis,
The error that you have mentioned seems to suggest that the problem lies with the code generation process of your Simulink model. There can be several reasons for this particular problem, however you can try some of these troubleshooting steps to resolve the issue:
- If there are any custom code or libraries included for code generation, you can ensure that it is not corrupted or following the format expected.
- You can also try clearing the build files to remove any unnecessary stale files either by manually deleting the contents of the folder that is being read or using MATLAB commands
- Verify that the MATLAB’s current working directory and any external project paths are present with proper path names especially for the file that the block is trying to read.
- To analyse and debug further about the error that you have received you can try to increase the details of the diagnostic messages by using “verbose build”. You can also refer to the documentation below to know more about “verbose build”: https://www.mathworks.com/help/releases/R2021b/rtw/ref/verbose-build.html
Additionally, you can also look at the below mentioned references to know more about “Kernel mode” and its limitations:
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Real-Time Simulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!