Chapter 2 55
Basic Operation
Using Programmatic Interfaces
% Try to open a session
disp('Opening a session to the instrument');
[instrumentHandle2, errorN, errorMsg] =
agt_awg_open('TCPIP','TCPIP0::A-N8241-90XXX::inst0::INST
R');
if errorN ~= 0
disp(errorN);
disp(errorMsg);
disp('program stopped');
return;
else
disp('ok');
end
[instrumentHandle1, errorN, errorMsg] = agt_awg_open
('TCPIP','TCPIP0::A-N8241-90XXX::inst0::INSTR');
if errorN ~= 0
disp(errorN);
disp(errorMsg);
disp('program stopped');
return;
else
disp('ok');
end
disp('Enabling the instrument output');
[errorN, errorMsg] =
agt_awg_setstate(instrumentHandle1, 'outputenabled',
'true');
if errorN ~= 0
disp(errorN);