MATLAB doesn`t see necessary COM port

7 ビュー (過去 30 日間)
Alexander Slovak
Alexander Slovak 2012 年 2 月 22 日
編集済み: Walter Roberson 2017 年 7 月 23 日
I'm trying to communicate Simulink model with bluetooth external module through SPP (Serial Port Profile).
I know that the new version of Instrument control toolbox support bluetooth connections, but I need to do this from Simulink model.
I have two COM ports on my notebook kreated to connect module:
COM3 - for incoming connections
COM4 - for outgoing connections (not needed)
In the registry I have two ports: [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM]
"\\Device\\BthModem1"="COM4"
"\\Device\\BthModem0"="COM3"
Matlab command instrhwinfo get me only COM4:
>> instrhwinfo('serial')
ans =
AvailableSerialPorts: {'COM4'}
JarFileVersion: 'Version 3.0.0'
ObjectConstructorName: {'serial('COM4');'}
SerialPorts: {'COM4'}
But I can connect to the port COM3 using terminal programms and MATLAB command promt!!!
If I type:
bt = serial('COM3');
bt.Terminator = '';
bt.BaudRate = 38400;
fopen(bt);
I have successfully connected to the port!
And, of course, the Simulink block "Serial config" doesn`t see this port, because it is not in the list of available serial ports.
Very grateful for any help!
  2 件のコメント
Doug Eastman
Doug Eastman 2012 年 2 月 22 日
Have you tried restarting MATLAB after plugging in the bluetooth module?
Alexander Slovak
Alexander Slovak 2012 年 2 月 22 日
Of course!
Restart OS, MATLAB and modules doesn`t help.
I use my built-in module to communicate with external module.
It`s wery strange that I can connect to COM port that doesn`t exist in list of available OCM ports using script, but can`t do this using Simulink...
Using a csript I also can create bluetooth object
btt = Bluetooth('linvor', 1);
fopen(btt);
and successfully use it. It works fine!
Please help me. I'm trying to do this over a week.

サインインしてコメントする。

回答 (3 件)

Hamid Jabbar
Hamid Jabbar 2015 年 1 月 28 日
編集済み: Hamid Jabbar 2015 年 1 月 28 日
i face the similar problem. Matlab was seeing the port, but the Simulink serial configuration showed no port.
I have windows 8, Matlab2012b
I right click the Bluetooth icon in the right bottom screen and click 'settings'.
Bluetooth setting comes up.
select COM port Tab
Add port for incoming
If device support, add output port also.
Now i see the port in Simulink.
  1 件のコメント
Hasan Siddiqui
Hasan Siddiqui 2015 年 3 月 27 日
How did you add port for incoming?

サインインしてコメントする。


X W
X W 2017 年 7 月 23 日
Any solutions found for this problem? I also only see COM1 through COM4 in the Simulink To Instrument block, and I know( and matlab test and measurement tool(not in Simulink), see all the com- to COM14.

X W
X W 2017 年 7 月 23 日
編集済み: Walter Roberson 2017 年 7 月 23 日
Here is an answer to this problem, the blocks are old, Matlab documents don't describe COM1-COM4 limitation, and why you'd use serial send, serial receive: https://stackoverflow.com/questions/4899507/difference-between-serial-send-and-to-instrument-blocks/35562205

カテゴリ

Help Center および File ExchangeTest and Measurement についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by