Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Timeout problem in matlab

Status
Not open for further replies.

xilinx1001

Member level 3
Member level 3
Joined
Apr 3, 2013
Messages
60
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,781
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

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
Can anybody suggest something about this

Thanks
xilinx1001
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top