From: Mustafa on
Hello,

I am currently doing a project in wireless communication using XBee PRO. My goal is to send data from one XBee to another and both are connected to PC. I used X-CTU to flash the XBees and I wrote the follwing code:

clc
% setting COM8
s = serial('COM8');
set(s,'BaudRate',115200);
set(s, 'TimeOut', 10)
set(s, 'Terminator', 'LF')
%set(s, 'FlowControl', 'hardware')
%s.ReadAsyncMode = 'manual';
set(s,'InputBufferSize',1000)

fopen(s);

fprintf(s,'*IDN?')
idn=fscanf(s)

%fprintf(s,'7E 00 16 10 01 00 13 A2 00 40 4B 9F E4 00 00 00 00 54 78 32 43 6F 6F 72 64 36')
fprintf(s,'01111110 00000000 00010110 00010000 00000001 00000000 00010011 10100010 00000000 01000000 01001011 10011111 11100100 00000000 00000000 00000000 00000000 01010100 01111000 00110010 01000011 01101111 01101111 01110010 01100100 00110110')
%fwrite(s,'7E 00 16 10 01 00 13 A2 00 40 4B 9F E4 00 00 00 00 54 78 32 43 6F 6F 72 64 36')


%s.BytesAvailable
out = fscanf(s);
out
%oo=fread(s,50)
%oo
get(s)
fclose(s)
delete(s)
clear s

but still I am getting a warrning massege:
Warning: A timeout occurred before the read operation completed.

please if anyone can help. I'll be appericiated.

Thanks in advance
From: Mustafa on
Please I need help. It is urgent.