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

41 visualizzazioni (ultimi 30 giorni)
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 Commento
Ahmed
Ahmed il 15 Nov 2024 alle 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.

Accedi per commentare.

Risposte (1)

aditi bagora
aditi bagora circa 7 ore fa
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:

Prodotti


Release

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by