Simulink serial block error serial port is not configured even though Serial Configuration block is conifigured correctly.

41 次查看(过去 30 天)
Hi,
I need some help debugging/fixing an error I am having with my Simulink model. I have serial send & receive blocks from the embedded coder library, as well as the serial configuration block. The model sends & receives data to an Arduino, with the model in 'run' mode. I have tried a number of suggestions from the forum, replacing all the serial blocks, restarting my MATLAB and computer, clearing the workspace and classes, running in administrator mode, and confirming all configurations. Nothing seemed to fix the error and let my model run.
My model was running fine prior to this but stopped working randomly, outputting this error:
Error:MATLAB System block 'HITL_Simulation/serial_send_data/Subsystem Reference/Enabled Subsystem3/Serial Send' error occurred when invoking 'setupImpl' method of 'system.SerialSend'. The error was thrown from '
'C:\Program Files\MATLAB\R2024b\toolbox\shared\seriallib_blocks\+system\SerialSend.m' at line 137
'C:\Program Files\MATLAB\R2024b\toolbox\simulink\ui\studio\config\m\+SLStudio\StartPauseContinue.p' at line 0
'C:\Program Files\MATLAB\R2024b\toolbox\simulink\ui\studio\config\m\+SLStudio\ToolBars.p' at line 0'.
Caused by:
The selected port is not configured. Use Serial Configuration block to configure the port.
If anyone has any suggestions on how to fix this that would be greatly appreciated.
Thanks.
  1 个评论
Ahmed
Ahmed 2024-11-15,15:26
I noticed another big issue: When i search for system.SerialSend in the command window, I get:
However, the blocks are configured to have the correct COM port and the other specific settings.

请先登录,再进行评论。

回答(1 个)

aditi bagora
aditi bagora about 5 hours 前
Hi @Ahmed,
It looks like there is an issue in reading the port values from the 'Serial Send' block. Since, you have tried all the possible workarounds and the issue still exists.
You can try using blocks 'Serial Transmit' and 'Serial Receive' from 'Simulink Support Package for Arduino Hardware' as it provides specific support for the hardware. It wil be easier for you to connect to the hardware to send and receive data.
You can refer to the following documentation links for more information on the support package and blocks provided:

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

产品


版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by