delay sending data rs232
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
hello,
Can any one help on hpe to delay the (vv) values to be delayed in sending every 2 seconds?
clc
clear all
%s = serial('COM1','BaudRate',9600,'ByteOrder','bigEndian','FlowControl','none','Terminator','','TimeOut',10);% baud
s=serial('COM7','BaudRate', 9600, 'Terminator', 'CR','ByteOrder',...
'BigEndian','InputBufferSize',256,'TimeOut',10);
fopen(s);
%get(s);
% fprintf(s,'*idn?');
% out0 = fscanf(s)
% fprintf(s,':syst:err?');
% out1 = fscanf(s)
fprintf(s,'OUTP:STAT 1');
cc=3;
cmd = num2str(cc,':CHAN1:CURR\b %2.2f;CURR?')
fprintf(s,cmd);
%out2 = fscanf(s)
vv=[2,4,6,8]; %%%%%%%%%%%%%%
vmd = num2str(vv,':CHAN1:VOLT\b %2.2f;VOLT?')
fprintf(s,vmd);
%out3 = fscanf(s)
fprintf(s,':CHAN1:MEAS:CURR?');
%out4 = fscanf(s)
fprintf(s,':CHAN1:MEAS:VOLT?');
%out5 = fscanf(s)
%fprintf(s,'OUTP:STAT 0');
fclose (s);
delete (s);
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre String Parsing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!