I am trying to read data from the serial port of my laptop. The data is coming from the MSP430 through COM13.
When I try to access the data through MATLAB, it says -
??? Error using ==> serial.fopen at 72 Port: COM13 is not available. No ports are available. Use INSTRFIND to determine if other instrument objects are connected to the requested device.
Error in ==> interfaceplot at 3 fopen(s)
The code I am using is this-
s = serial('COM13'); %assigns the object s to serial port
set(s, 'InputBufferSize', 128); %number of bytes in inout buffer
set(s, 'FlowControl', 'none');
set(s, 'BaudRate', 9600);
set(s, 'Parity', 'none');
set(s, 'DataBits', 8);
set(s, 'StopBit', 1);
set(s, 'Timeout',100);
%clc;
disp(get(s,'Name'));
prop(1)=(get(s,'BaudRate'));
prop(2)=(get(s,'DataBits'));
prop(3)=(get(s, 'StopBit'));
prop(4)=(get(s, 'InputBufferSize'));
disp([num2str(prop)]);
fopen(s); %opens the serial port
data = fscanf(s);
fclose(s); %close the serial port
INSTRFIND
? – Daniel