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 대략 7시간 전
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