[問題]MATLAB的RS232通訊問題 已回收
想請問各位前輩我的程式是否有錯誤
因為都會跑出錯誤
小弟不才.所以想請教各位前輩
以下是我的程式code
===================== code ====================
s=serial('com1');
set(s,'BaudRate',115200);
fopen(s);
fprintf(s,'a');
out=fscanf(s);
fclose(s);
delete(s);
clear s;
以下是出現的錯誤
~~~~~~~~~~~~~~~~~~~~~ error ~~~~~~~~~~~~~~~~~~~
??? Error using ==> serial.fopen at 72
Cannot connect to the COM1 port. Possible reasons are another
application is connected to the port or the port does not exist.
Error in ==> RS232_1 at 3
fopen(s);
其中??? Error using ==> serial.fopen at 72屬於內建的程式
錯誤的地方是:error('MATLAB:serial:fopen:opfailed', msg);
所以想請問各位前輩是我程式碼有錯還是它內建的程式碼有錯.謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.125.13.93
推
10/26 20:32, , 1F
10/26 20:32, 1F
→
10/27 00:18, , 2F
10/27 00:18, 2F
推
10/27 10:19, , 3F
10/27 10:19, 3F
→
10/27 10:20, , 4F
10/27 10:20, 4F
→
10/27 10:20, , 5F
10/27 10:20, 5F
→
10/27 14:59, , 6F
10/27 14:59, 6F
→
10/27 15:00, , 7F
10/27 15:00, 7F
→
10/27 15:00, , 8F
10/27 15:00, 8F
→
10/27 15:14, , 9F
10/27 15:14, 9F
推
11/21 15:04, , 10F
11/21 15:04, 10F