Clear Filters
Clear Filters

Serial Receive in Desktop Real-Time Kernel Mode

2 views (last 30 days)
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)
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?

Answers (1)

Ayush
Ayush on 1 Apr 2024
Edited: Ayush on 1 Apr 2024
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:
  1. 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.
  2. 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
  3. 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.
  4. 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!

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!