]> sigrok.org Git - libsigrok.git/commit
scpi-dmm: model and MQ dependent delay before measurement
authorGerhard Sittig <redacted>
Sat, 22 May 2021 08:39:10 +0000 (10:39 +0200)
committerGerhard Sittig <redacted>
Tue, 1 Jun 2021 06:20:59 +0000 (08:20 +0200)
commite90551c3f84f9d463d1453ba2e512e109e75edde
treeaaebc80fd4483f369e6f0673f37635e7f6ef966d
parent08f023fe97e402d68106299d04726f9094f00c45
scpi-dmm: model and MQ dependent delay before measurement

Some models are slow to start a measurement acquisition in specific MQs
(meter functions). An "*OPC?" query went unanswered after "INIT" was
sent. This was observed on 34405A in temperature, frequency, resistance,
AC voltage and current mode.

Add an optional per-model measurement delay that is used when the MQ
specifies that the delay is applicable. Because functions are changed
rarely but measurements are taken many times, only the first reading
is delayed while later readings are seen at the expected interval. Not
delaying the first reading will result in device errors.

  sr: [00:00.875162] scpi_usbtmc: Successfully sent SCPI command: 'CONF?'.
  sr: [00:00.881666] scpi: Got response: '"FREQ +1.00000E+00,+1.00000E-05"', length 32.
  sr: [00:00.881700] scpi-dmm: dev_acquisition_start: Precision: '"FREQ +1.00000E+00,+1.00000E-05"'
  sr: [00:00.881840] scpi_usbtmc: Successfully sent SCPI command: '*OPC?'.
  sr: [00:00.883966] scpi: Got response: '1', length 1.
  sr: [00:00.884139] scpi_usbtmc: Successfully sent SCPI command: 'INIT'.
  sr: [00:01.884420] session: bus: Received SR_DF_HEADER packet.
  cli: Received SR_DF_HEADER.
  sr: [00:01.895260] scpi_usbtmc: Successfully sent SCPI command: '*OPC?'.
  sr: [00:02.895766] scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
  sr: [00:02.906302] scpi_usbtmc: Successfully sent SCPI command: '*OPC?'.
  sr: [00:02.910703] scpi_usbtmc: USBTMC invalid bulk in header.
  sr: [00:02.921244] scpi_usbtmc: USBTMC bulk out transfer error: LIBUSB_ERROR_PIPE.
  sr: [00:02.931802] scpi_usbtmc: Successfully sent SCPI command: '*OPC?'.
  sr: [00:02.932276] scpi: Got response: '1', length 1.
  sr: [00:02.932425] scpi_usbtmc: Successfully sent SCPI command: '*OPC?'.
  sr: [00:02.934790] scpi: Got response: '1', length 1.
  sr: [00:02.935155] scpi_usbtmc: Successfully sent SCPI command: 'CONF?'.
  sr: [00:02.941564] scpi: Got response: '"FREQ +1.00000E+00,+1.00000E-05"', length 32.

  sr: [00:00.173408] hwdriver: scpi-dmm: Starting acquisition.
  sr: [00:00.173569] scpi_usbtmc: Successfully sent SCPI command: '*OPC?'.
  sr: [00:00.334312] scpi: Got response: '1', length 1.
  sr: [00:00.334544] scpi_usbtmc: Successfully sent SCPI command: 'CONF?'.
  sr: [00:00.341070] scpi: Got response: '"RES +1.00000E+02,+1.00000E-03"', length 31.
  sr: [00:00.341307] scpi_usbtmc: Successfully sent SCPI command: '*OPC?'.
  sr: [00:00.343636] scpi: Got response: '1', length 1.
  sr: [00:00.343872] scpi_usbtmc: Successfully sent SCPI command: 'CONF?'.
  sr: [00:00.350093] scpi: Got response: '"RES +1.00000E+02,+1.00000E-03"', length 31.
  sr: [00:00.350157] scpi-dmm: dev_acquisition_start: Precision: '"RES +1.00000E+02,+1.00000E-03"'
  sr: [00:00.350342] scpi_usbtmc: Successfully sent SCPI command: '*OPC?'.
  sr: [00:00.352524] scpi: Got response: '1', length 1.
  sr: [00:00.352832] scpi_usbtmc: Successfully sent SCPI command: 'INIT'.
  sr: [00:00.352901] session: bus: Received SR_DF_HEADER packet.
  cli: Received SR_DF_HEADER.
  sr: [00:00.363675] scpi_usbtmc: Successfully sent SCPI command: '*OPC?'.
  sr: [00:01.364363] scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
  sr: [00:01.374904] scpi_usbtmc: Successfully sent SCPI command: '*OPC?'.
  sr: [00:02.375380] scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
  sr: [00:02.385872] scpi_usbtmc: Successfully sent SCPI command: '*OPC?'.
  sr: [00:03.232457] scpi_usbtmc: USBTMC invalid bulk in header.
  sr: [00:03.243003] scpi_usbtmc: USBTMC bulk out transfer error: LIBUSB_ERROR_PIPE.
  sr: [00:03.253464] scpi_usbtmc: Successfully sent SCPI command: '*OPC?'.
  sr: [00:03.256568] scpi: Got response: '1', length 1.
  sr: [00:03.256902] scpi_usbtmc: Successfully sent SCPI command: '*OPC?'.
  sr: [00:03.259440] scpi: Got response: '1', length 1.
  sr: [00:03.259713] scpi_usbtmc: Successfully sent SCPI command: 'CONF?'.
  sr: [00:03.266070] scpi: Got response: '"RES +1.00000E+08,+1.00000E+3"', length 30.
  sr: [00:03.266456] scpi_usbtmc: Successfully sent SCPI command: '*OPC?'.
  sr: [00:03.268501] scpi: Got response: '1', length 1.
  sr: [00:03.268961] scpi_usbtmc: Successfully sent SCPI command: 'READ?'.
  sr: [00:03.353589] scpi: Got response: '+9.90000000E+37 ', length 16.

Declare a 2500ms measurement initiation delay for 34405A which was found
by experimentation. This is huge but was found to be necessary.

Of course all other meter functions are unaffected by this commit. As
are the meters which specify no delay.
src/hardware/scpi-dmm/api.c
src/hardware/scpi-dmm/protocol.h