problem when running the simulink model connected with arduino mega2560

8 次查看(过去 30 天)
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

回答(1 个)

Bhanu Prakash
Bhanu Prakash 2024-7-8
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!

类别

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

标签

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by