forked from tektronix/Programmatic-Control-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrsa_dpx_trace_selector.m
More file actions
62 lines (52 loc) · 1.86 KB
/
rsa_dpx_trace_selector.m
File metadata and controls
62 lines (52 loc) · 1.86 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
% VISA Control: RSA DPX Trace Selector
% Author: Morgan Allison
% Date Edited: 8/17
% This program opens up a split DPX display and allows the user to select
% the available traces. The trace numbers in the VISA commands are interpreted
% in the comments below.
% Windows 7 64-bit, TekVISA 4.0.4
% Matlab r2017a with ICT
% Download SignalVu-PC programmer manual: http://www.tek.com/node/1828803
% Download RSA5100B programmer manual:
% http://www.tek.com/spectrum-analyzer/inst5000-manual-7
% Tested on RSA306B/RSA507A with SignalVu-PC 3.10.0030
%% #################SEARCH/CONNECT#################
visaBrand = 'tek';
% instAddress = 'TCPIP::192.168.1.10::INSTR';
instAddress = 'GPIB8::1::INSTR';
buf = 50000;
inst = visa(visaBrand, instAddress);
set(inst, 'InputBuffer', buf);
set(inst, 'OutputBuffer', buf);
fopen(inst);
inst.timeout = 15;
instID = query(inst,'*idn?');
fprintf('Connected to %s\n',instID);
% preset, clear buffer, and stop acquisition
fprintf(inst, 'system:preset');
fprintf(inst, '*cls');
fprintf(inst, 'abort');
%% #################INITIALIZE VARIABLES#################
% configure acquisition parameters
cf = 2.4453e9;
span = 40e6;
%% #################CONFIGURE INSTRUMENT#################
% configure DPX measurement
fprintf(inst, 'display:general:measview:new DPX');
fprintf(inst, 'sense:dpx:plot split');
fprintf(inst, 'spectrum:frequency:center %d', cf);
fprintf(inst, 'spectrum:frequency:span %d', span);
%% #################ACQUIRE/PROCESS DATA#################
fprintf(inst, 'initiate:immediate');
query(inst, '*opc?');
fprintf(inst, 'trace1:dpx 1'); % Trace 1
fprintf(inst, 'trace2:dpx 1'); % Trace 2
fprintf(inst, 'trace3:dpx 1'); % Trace 3
fprintf(inst, 'trace4:dpx 0'); % Math
fprintf(inst, 'trace5:dpx 1'); % Bitmap
fprintf(inst, 'trace6:dpx 1'); % DPXogram
fprintf(inst, 'trace7:dpx 1'); % DPXogram Line
%% Close inst
fclose(inst);
delete(inst);
clear inst;