-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path3303c.m
More file actions
38 lines (29 loc) · 921 Bytes
/
Copy path3303c.m
File metadata and controls
38 lines (29 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
%% Instrument Configuration and Control
%% Communicating with instrument object, obj1.
% Turn Channels on and off
fprintf(obj1, 'OUTPut CH1, ON');
fprintf(obj1, 'OUTPut CH1, OFF');
% Select the channel that will be operated
fprintf(obj1, 'INSTRUMENT CH1');
% Query the current operating channel
fprintf(obj1, 'INSTRUMENT?');
fscanf(obj1)
% Select the Operation Mode,
% 0: Independant, 1: Series, 2: Parallel
fprintf(obj1, 'OUTPut:TRACK 1');
% Set Voltage to 13.37 V
fprintf(obj1, 'CH1:VOLTage 13.37');
% Set Current limit to 2.5 A
fprintf(obj1, 'CH2:CURRent 2.5');
% Read Set Voltage
fprintf(obj1, 'CH1:VOLTage?');
U1 = str2double(fscanf(obj1))
% Read Set Current
fprintf(obj1, 'CH1:CURRent?');
I1 = str2double(fscanf(obj1))
% Measure actual Voltage
fprintf(obj1, 'MEAsure:VOLTage? CH1');
U1 = str2double(fscanf(obj1))
% Measure actual Current
fprintf(obj1, 'MEAsure:CURRent? CH1');
I1 = str2double(fscanf(obj1))