Troubleshooting bluetooth over serial
1 view (last 30 days)
Show older comments
The exercise is to retrieve the model number of a Bluetooth device.
Win10 Bluetooth connection:
Not sure why serial port object s7 fails to fopen. Any actionable suggestions or diagnostic questions are appreciated.
>> s6 = serial('COM6', 'BaudRate', 9600);
>> s7 = serial('COM7', 'BaudRate', 9600);
>> s6
Serial Port Object : Serial-COM6
Communication Settings
Port: COM6
BaudRate: 9600
Terminator: 'LF'
Communication State
Status: closed
RecordStatus: off
Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 0
>> s7
Serial Port Object : Serial-COM7
Communication Settings
Port: COM7
BaudRate: 9600
Terminator: 'LF'
Communication State
Status: closed
RecordStatus: off
Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 0
>> fopen(s6)
>> fopen(s7)
Error using serial/fopen (line 72)
Open failed: Port: COM7 is not available. Available ports: COM3.
Use INSTRFIND to determine if other instrument objects are connected to the requested device.
>> fopen(s7)
Error using serial/fopen (line 72)
Open failed: Port: COM7 is not available. Available ports: COM3.
Use INSTRFIND to determine if other instrument objects are connected to the requested device.
>> s6
Serial Port Object : Serial-COM6
Communication Settings
Port: COM6
BaudRate: 9600
Terminator: 'LF'
Communication State
Status: open
RecordStatus: off
Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 0
>> s6
Serial Port Object : Serial-COM6
Communication Settings
Port: COM6
BaudRate: 9600
Terminator: 'LF'
Communication State
Status: open
RecordStatus: off
Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 0
>> fprintf(s6, '*IDN?')
Error using serial/fprintf (line 144)
Unexpected error: A timeout occurred during the write operation..
>> fopen(s7)
Error using serial/fopen (line 72)
Open failed: Port: COM7 is not available. Available ports: COM3.
Use INSTRFIND to determine if other instrument objects are connected to the requested device.
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!