1
1
from labdevices .exceptions import CommunicationError_ProtocolViolation
2
- from labdevices .exceptions import CommunicationError_Timeout
3
- from labdevices .exceptions import CommunicationError_NotConnected
2
+ # from labdevices.exceptions import CommunicationError_Timeout
3
+ # from labdevices.exceptions import CommunicationError_NotConnected
4
4
5
- from labdevices .oscilloscope import Oscilloscope , OscilloscopeSweepMode , OscilloscopeTriggerMode , OscilloscopeTimebaseMode , OscilloscopeRunMode
5
+ from labdevices .oscilloscope import Oscilloscope , OscilloscopeSweepMode , OscilloscopeTriggerMode , OscilloscopeTimebaseMode , OscilloscopeRunMode , OscilloscopeCouplingMode
6
6
from labdevices .scpi import SCPIDeviceEthernet
7
7
import atexit
8
8
9
- from time import sleep
10
-
11
- import socket
12
-
13
- import logging
14
- import datetime
15
-
16
9
class MSO5000 (Oscilloscope ):
17
10
def __init__ (
18
11
self ,
@@ -164,7 +157,7 @@ def _set_sweep_mode(self, mode):
164
157
raise ValueError (f"Unknown sweep mode { mode } passed" )
165
158
166
159
def _get_sweep_mode (self ):
167
- resp = self ._scpi .scpiCommand (f ":TRIG:SWE?" )
160
+ resp = self ._scpi .scpiCommand (":TRIG:SWE?" )
168
161
169
162
modes = {
170
163
"NORM" : OscilloscopeSweepMode .NORMAL ,
@@ -186,7 +179,7 @@ def _set_trigger_mode(self, mode):
186
179
self ._scpi .scpiCommand (":TRIG:MODE SLOP" )
187
180
188
181
def _get_trigger_mode (self ):
189
- resp = self ._scpi .scpiQuery (f ":TRIG:MODE?" )
182
+ resp = self ._scpi .scpiQuery (":TRIG:MODE?" )
190
183
191
184
modes = {
192
185
"EDGE" : OscilloscopeTriggerMode .EDGE ,
@@ -232,7 +225,7 @@ def _set_timebase_mode(self, mode):
232
225
self ._scpi .scpiCommand (f":TIM:MODE { modestr [mode ]} " )
233
226
234
227
def _get_timebase_mode (self ):
235
- resp = self ._scpi .scpiQuery (f ":TIM:MODE?" )
228
+ resp = self ._scpi .scpiQuery (":TIM:MODE?" )
236
229
237
230
modes = {
238
231
"MAIN" : OscilloscopeTimebaseMode .MAIN ,
@@ -441,13 +434,13 @@ def _query_waveform(self, channel, stats = None):
441
434
if self ._rawMode :
442
435
if self ._get_run_mode () != OscilloscopeRunMode .STOP :
443
436
raise CommunicationError_ProtocolViolation ("You must run OscilloscopeRunMode.STOP before capturing in raw mode" )
444
- self ._scpi .scpiCommand (f ":WAV:MODE RAW" )
445
- self ._scpi .scpiCommand (f ":WAV:POIN RAW" )
437
+ self ._scpi .scpiCommand (":WAV:MODE RAW" )
438
+ self ._scpi .scpiCommand (":WAV:POIN RAW" )
446
439
else :
447
- self ._scpi .scpiCommand (f ":WAV:MODE NORM" )
440
+ self ._scpi .scpiCommand (":WAV:MODE NORM" )
448
441
self ._scpi .scpiCommand (f":WAV:POIN { self ._samplePoints } NORM" )
449
442
self ._scpi .scpiCommand (f":WAV:SOUR CHAN{ channel + 1 } " )
450
- self ._scpi .scpiCommand (f ":WAV:FORM ASCII" )
443
+ self ._scpi .scpiCommand (":WAV:FORM ASCII" )
451
444
resppre = self ._scpi .scpiQuery (":WAV:PRE?" )
452
445
respdata = self ._scpi .scpiQuery (":WAV:DATA?" )
453
446
@@ -463,14 +456,14 @@ def _query_waveform(self, channel, stats = None):
463
456
raise CommunicationError_ProtocolViolation (f"Requested ASCII but received format { pre [0 ]} " )
464
457
if (int (pre [1 ]) != 0 ) and (int (pre [1 ]) != 2 ):
465
458
raise CommunicationError_ProtocolViolation (f"Requested Normal(0)/Raw(2) data, but received { pre [1 ]} " )
466
- points = int (pre [2 ])
467
- avgcount = int (pre [3 ])
459
+ # points = int(pre[2])
460
+ # avgcount = int(pre[3])
468
461
xinc = float (pre [4 ])
469
462
xorigin = float (pre [5 ])
470
- xref = float (pre [6 ])
471
- yinc = float (pre [7 ])
472
- yorigin = float (pre [8 ])
473
- yref = float (pre [9 ])
463
+ # xref = float(pre[6])
464
+ # yinc = float(pre[7])
465
+ # yorigin = float(pre[8])
466
+ # yref = float(pre[9])
474
467
475
468
# Parse data ...
476
469
if respdata [0 :2 ] != '#9' :
0 commit comments