I'm communicating with my RP via serial as I don't have an ethernet connection on my MacBook. I have managed to establish a Matlab connection and can output voltage signals, however I can't get seem to acquire data. When using 'query', the response is always the last command sent. I have attached code below - any help is appreciated!
Code: Select all
s=serial'/dev/cu.usbserial-DB00FW8L','BaudRate',115200,'DataBits',8,'Parity','none','StopBits',1,'FlowControl','none','Terminator','CR/LF');
fopen(s);
fprintf(s,'root'); % This and following 'root' are necessary to login to the RP
pause(1);
fprintf(s,'root');
pause(1);
fclose(s);
s.InputBufferSize=16384*32;
fopen(s);
fprintf(s,'generate 1 1 200000 sqr'); % This command works, output has been checked on oscilloscope.
pause(1);
query(s,'acquire 1024 8');
fclose(s);