vptran84
Electrical
- May 5, 2006
- 1
Hi,
Here is what I am trying to do.
On one computer i open matlab and run the program (posted below) to open the serial port and read data. On the other computer i open hyperterminal and send data. If the data i receive in matlab is the same as the data i sent then you know the matlab program is working correctly.
So I am trying to read data from the rs232 via matlab, but i am struggling g
reatly.
here is my code:
s = serial('com1');
s.InputBufferSize = 10;
fopen(s);
fid = fopen('C\out.txt', 'w')
a = fread(s,8);
fwrite(fid,char(a));
fclose(s);
fclose(fid);
Results:
fid =
3
Warning: The specified amount of data was not returned within the Timeout period.
I don't really know what is wrong.
Please if anyone could, I would greatly appreciated. This is taking me so much time, and I am on the brink of madness. thank you.
Here is what I am trying to do.
On one computer i open matlab and run the program (posted below) to open the serial port and read data. On the other computer i open hyperterminal and send data. If the data i receive in matlab is the same as the data i sent then you know the matlab program is working correctly.
So I am trying to read data from the rs232 via matlab, but i am struggling g
reatly.
here is my code:
s = serial('com1');
s.InputBufferSize = 10;
fopen(s);
fid = fopen('C\out.txt', 'w')
a = fread(s,8);
fwrite(fid,char(a));
fclose(s);
fclose(fid);
Results:
fid =
3
Warning: The specified amount of data was not returned within the Timeout period.
I don't really know what is wrong.
Please if anyone could, I would greatly appreciated. This is taking me so much time, and I am on the brink of madness. thank you.