xilinx1001
Member level 3
Hi,
I am trying to read data through serial communication in matlab
I am reading 2 bytes of data
First byte is zero for most of the times and 2nd byte contains information.
I am getting timeout error
Warning: Unsuccessful read: A timeout occurred.
Is there any command to read data starting with zeros
Can anybody suggest something about this
Thanks
xilinx1001
I am trying to read data through serial communication in matlab
I am reading 2 bytes of data
First byte is zero for most of the times and 2nd byte contains information.
I am getting timeout error
Warning: Unsuccessful read: A timeout occurred.
Is there any command to read data starting with zeros
Code:
Code:
nexys = serial('COM1', 'BaudRate', 9600, 'Parity', 'odd', 'Terminator', '', 'Timeout', 1);
fopen(nexys);
myNum = 4563;
%fprintf(nexys, 'd1539'); %Fungerar
%fprintf(nexys, 'd%4d', myNum); %Fungerar
for i=1:2
fprintf(nexys, 's');
scan_s1 = fscanf(nexys,'%s')-0;
fprintf(nexys, 't');
scan_s2 = fscanf(nexys,'%s')-0;
end
Thanks
xilinx1001