フィルターのクリア

Serial communication with device error

2 ビュー (過去 30 日間)
Leon Ellis
Leon Ellis 2021 年 10 月 7 日
回答済み: Leon Ellis 2021 年 10 月 8 日
Good day, I'm trying to serially communicate with my FT232RL via COM1 port, however I keep getting an error. This is my code:
close all;
clc;
if ~isempty(instrfind)
fclose(instrfind);
delete(instrfind);
end
s= serialport("COM1",9600);
fopen(s);
And this is my error:
Error using serialport (line 116)
Unable to connect to the serialport device at port 'COM1'. Verify
that a device is connected to the port, the port is not in use,
and all serialport input arguments and parameter values are
supported by the device.
Error in Serial (line 9)
s= serialport("COM1",9600);
I have however been able to communicate to the device through MPLAB x, however for some reason MATLAB doesn't seem to pick it up. Help would be much appreciated!

採用された回答

Leon Ellis
Leon Ellis 2021 年 10 月 8 日
Solved: I just had to delete or close to variable each time.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSerial and USB Communication についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by