Protocole communication *µcontroller <=> Matlab

1 view (last 30 days)
Hello
I would like to send an order on the map in hexadecimal formats like this : 0x100x000x03 and I'd like to have this same format back.
But , I receive nothing in return an error
My programme matlab
s=serial('COM4');
set(s,'BaudRate',9600,'DataBits', 8, 'Parity', 'none','StopBits', 1, 'FlowControl', 'none','Terminator','CR')
% Connect to instrument object, obj1.
fopen(s);
% pause(2)
% fprintf(s,'0x100x000x03 ')
% pause (2)
% fscanf(s)
% data=fscanf(s);
% data=str2num(data);
%
% display(data)
fclose(s);
The error is :
warning: A timeout occurred before the Terminator was reached.
Is this program correct because I think that format inside fprintf is not good!
thanks

Answers (0)

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!