Есть ли способ установить соединение GPIB, используя MATLAB без Ящика для инструментов? (У меня его нет). Кроме того, есть ли у MATLAB способ узнать, каковы значения параметров RS232 внешнего устройства (скорость передачи, стоп-бит и т. Д.). Для подключения RS232 у меня есть следующий код:
% This function is meant to send commands to Potentiostat Model 263A.
% A run includes turning the cell on, reading current for time t1, turning
% the cell off, waiting for time t2.
% t1 is the duration [secs] for which the Potentiostat must run (cell is on)
% t2 is the duration [secs] to on after off
% n is the number of runs
% port is the serial port name such as COM1
function [s] = Potentiostat_control(t1,t2,n)
port = input('type port name such as COM1', 's')
s = serial(port);
set(s,'BaudRate', 9600, 'DataBits', 8, 'Parity', 'even', 'StopBits', 2 ,'Terminator', 'CR/LF');
fopen(s)
%fprintf(s,'RS232?')
disp(['Total runs requested = ' num2str(n)])
disp('i denotes number of runs executed so far..');
for i=1:n
i
%data1 = query(s, '*IDN?')
fprintf(s,'%s','CELL 1'); % sends the command 'CELL 1'
%fprintf(s,'%s','READI');
pause(t1);
fprintf(s,'%s','CELL 0');
%fprintf(s,'%s','CLEAR');
pause(t2);
end
fclose(s)