-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJitter_RiseFallTime_Automation.py
More file actions
214 lines (144 loc) · 3.85 KB
/
Jitter_RiseFallTime_Automation.py
File metadata and controls
214 lines (144 loc) · 3.85 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
"""
Alex Yazdani
05/03/2023
This file acts as an automation test run for jitter, rise and fall time transmitter testing.
The script connects to a Keysight oscilloscope via GPIB to query the instrument.
In an actual script for testing, a loop should be used to wait for full scope acquisition.
The full list of VISA commands can be found at the end of the file.
"""
import time
import pyvisa
scope_gpib = "GPIB0::7::INSTR"
scope_ip = "TCPIP0::___.___.___.___::____::SOCKET
"""
Open Instrument:
"""
scope_rm = pyvisa.ResourceManager()
oscilloscope = scope_rm.open_resource(scope_gpib)
time.sleep(1)
"""
Rise and Fall Time Test:
"""
oscilloscope.write(":ACQuire:STOP")
time.sleep(1)
oscilloscope.write(":SYSTem:MODE OSCilloscope")
time.sleep(1)
oscilloscope.write(":ACQuire:RUN")
time.sleep(1)
oscilloscope.write(":CHAN3A:FILTer OFF")
time.sleep(1)
oscilloscope.write(":CRECovery5:RELock")
time.sleep(1)
oscilloscope.write(":SYSTem:AUToscale")
time.sleep(1)
oscilloscope.write(":TRIGger:PLOCk ON")
time.sleep(1)
oscilloscope.write(":SYSTem:AUToscale")
time.sleep(1)
oscilloscope.write(":MEASure:OSCilloscope:FALLtime")
oscilloscope.write(":MEASure:OSCilloscope:RISetime")
time.sleep(10)
oscilloscope.write(":ACQuire:STOP")
time.sleep(1)
fall_time = oscilloscope.query(":MEASure:OSCilloscope:FALLtime:Mean?")
rise_time = oscilloscope.query(":MEASure:OSCilloscope:RISetime:Mean?")
time.sleep(1)
print(f"\nRise Time = {rise_time}\nFall Time = {fall_time}\n")
oscilloscope.write(":CHAN3A:FILTer ON")
time.sleep(1)
oscilloscope.write(":SYSTem:MODE EYE")
time.sleep(1)
oscilloscope.write(":TRIGger:PLOCk OFF")
time.sleep(1)
"""
End of Rise and Fall Time Test
"""
"""
Putting back in normal state:
"""
oscilloscope.write(":ACQuire:RUN")
time.sleep(5)
"""
Jitter Test:
"""
oscilloscope.write(":ACQuire:STOP")
time.sleep(1)
oscilloscope.write(":SYSTem:MODE JITTer")
time.sleep(1)
oscilloscope.write(":CRECovery5:RELock")
time.sleep(1)
oscilloscope.write(":SYSTem:AUToscale")
time.sleep(1)
oscilloscope.write(":TRIGger:PLOCk ON")
time.sleep(1)
oscilloscope.write(":ACQuire:RUN")
time.sleep(1)
oscilloscope.write(":MEASure:JITTer:DEFine:UNITs UINTerval")
time.sleep(1)
time.sleep(10)
oscilloscope.write(":ACQuire:STOP")
time.sleep(1)
tj = oscilloscope.query(":MEASure:JITTer:TJ?")
ddj = oscilloscope.query(":MEASure:JITTer:DDJ?")
time.sleep(1)
print(f"\nDDJ = {ddj}\nTJ = {tj}\n")
oscilloscope.write(":SYSTem:MODE EYE")
time.sleep(1)
oscilloscope.write(":TRIGger:PLOCk OFF")
time.sleep(1)
"""
End of Jitter Test
"""
"""
Putting back in normal state:
"""
oscilloscope.write(":ACQuire:RUN")
time.sleep(1)
"""
Close Instrument:
"""
oscilloscope.clear()
oscilloscope.close()
scope_rm.close()
"""
Sample Output:
Rise Time = 3.602E-11
Fall Time = 7.540E-11
DDJ = 1.06E-2
TJ = 5.24E-2
"""
"""
Full VISA Command List:
//Rise and Fall Time:
:ACQuire:STOP
:SYSTem:MODE OSCilloscope
:ACQuire:RUN
:CHAN3A:FILTer OFF
:CRECovery5:RELock
:SYSTem:AUToscale
:TRIGger:PLOCk ON
:SYSTem:AUToscale
:MEASure:OSCilloscope:FALLtime
:MEASure:OSCilloscope:RISetime
//Add in commands to wait for data collection to finish --> --> :MEASure:LTESt:ACQuire:COUNt?
:MEASure:OSCilloscope:FALLtime:Mean? //QUERY
:MEASure:OSCilloscope:RISetime:Mean? //QUERY
//Take Screenshot
:CHAN3A:FILTer ON
:SYSTem:MODE EYE
:TRIGger:PLOCk OFF
//Jitter:
:ACQuire:STOP
:SYSTem:MODE JITTer
:CRECovery5:RELock
:SYSTem:AUToscale
:TRIGger:PLOCk ON
:ACQuire:RUN
:MEASure:JITTer:DEFine:UNITs UINTerval
//Add in commands to wait for data collection to finish --> :MEASure:LTESt:ACQuire:COUNt?
:MEASure:JITTer:TJ? //Query
:MEASure:JITTer:DDJ? //Query
//Take Screenshot
:SYSTem:MODE EYE
:TRIGger:PLOCk OFF
"""