diff options
-rw-r--r-- | qolab/hardware/scpi.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/qolab/hardware/scpi.py b/qolab/hardware/scpi.py index 8564177..a9641cf 100644 --- a/qolab/hardware/scpi.py +++ b/qolab/hardware/scpi.py @@ -15,11 +15,12 @@ def response2numStr(strIn, firstSeparator=None, unit=None): # i.e. "<prefix><firstSeparator><numberString><unit> # prefix='TDIV', firstSeparator=' ', numberString='2.00E-08', unit='S' # this function parses the reply - if firstSeparator is None or firstSeparator == '': - return (strIn, None, None) - spltStr = re.split(firstSeparator, strIn) - prefix = spltStr[0] - rstr = spltStr[1] + prefix = None + rstr = strIn + if firstSeparator is not None and firstSeparator != '': + spltStr = re.split(firstSeparator, strIn) + prefix = spltStr[0] + rstr = spltStr[1] if unit is not None and unit != '': spltStr = re.split(unit, rstr) if len(spltStr) == 1: |