problem when running the simulink model connected with arduino mega2560

7 visualizaciones (últimos 30 días)
Below is the error that I faced. How to solve this.
Caused by:
  • Unable to create a communication link with the serial port. Please check the input argument PORT and verify that a device is connected.
Component:Simulink | Category:Block error

Respuestas (1)

Bhanu Prakash
Bhanu Prakash el 8 de Jul. de 2024
Hi Muadz,
A few possible causes for this issue are:
  1. The serial port is not properly created/ recognized by MATLAB.
  2. The serial port is being used by an other application outside of MATLAB.
Here are a few troubleshooting steps you can try to resolve the issue:
  • Verify that the serial (COM) port is listed in Windows Control Panel > Device Manager > Ports. You can also verify its availability using the following command:
serialportlist("available")
For more information regarding the 'serialportlist' function, refer to the following documentation:
  • As you can create only one 'serialport' object for each port, make sure that a 'serialport' object using the same port number does not already exist in the workspace.
  • Disconnect any devices / applications that might be using the serial port.
  • Make sure that you have an updated Arduino driver on your device. If not, you can update the driver by following the workflow mentioned in the below link:
  • If you still have issues with sending / receiving data, you might need to configure the communication parameters like BaudRate, DataBits, Party, StopBits, or Terminator to match with the connected device.
For more detailed information on the troubleshooting steps, refer to the following documentation links:
  • Resolve Serial Port Connection Errors:
  • Troubleshooting Serial Port Interface:
Hope this helps!

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by