I am trying to setup a serial communication with a optical power meter and I am not able to read the returned string.
I am using a newport power meter (91936-R) with RS232. I set up the communication with the following code beow. I am running into a weird situation.
The readlinerespone is The first is ""PM:CALDATE?" However when I send the readline command again I get the right response "30NOV2022". Its almost like readline stops once it reaches the first termination character and doesnt continue. I tried adding a pause incase I am reading the port too fast but no sucess.
I am not sure and matlab doesnt have more documention online on serial port so I was hoping someone can answer this.
clear s
clear all
s = serialport("COM12",38400);
configureTerminator(s,"CR/LF","CR");
writeline(s,"PM:CALDATE?")
% pause(4)
readline(s)
%readline(s)I am using a newport power meter (91936-R) with RS232. I set up the communication with the following code beow. I am running into a weird situation.
The readlinerespone is The first is ""PM:CALDATE?" However when I send the readline command again I get the right response "30NOV2022". Its almost like readline stops once it reaches the first termination character and doesnt continue. I tried adding a pause incase I am reading the port too fast but no sucess.
I am not sure and matlab doesnt have more documention online on serial port so I was hoping someone can answer this.
clear s
clear all
s = serialport("COM12",38400);
configureTerminator(s,"CR/LF","CR");
writeline(s,"PM:CALDATE?")
% pause(4)
readline(s)
%readline(s) I am using a newport power meter (91936-R) with RS232. I set up the communication with the following code beow. I am running into a weird situation.
The readlinerespone is The first is ""PM:CALDATE?" However when I send the readline command again I get the right response "30NOV2022". Its almost like readline stops once it reaches the first termination character and doesnt continue. I tried adding a pause incase I am reading the port too fast but no sucess.
I am not sure and matlab doesnt have more documention online on serial port so I was hoping someone can answer this.
clear s
clear all
s = serialport("COM12",38400);
configureTerminator(s,"CR/LF","CR");
writeline(s,"PM:CALDATE?")
% pause(4)
readline(s)
%readline(s) serial, readline, writeline MATLAB Answers — New Questions