I'm trying to automate synchronized measurements with two Rigol DM3068 DMMs and external triggering. In particular, both DMMs are set to 2 NPLC integration time, auto zero on, auto trigger delay, external trigger, positive slope. I've got a signal generator outputting a 10Hz 5V square wave to the external trigger input on both meters. They don't seem to miss triggers with this configuration.
I want to get the most recent measurement from both meters after each trigger over SCPI, but there does not seem to be a way to do this reliably
because the Rigol SCPI system makes no sense. Has anyone else run into these problems, and are there workarounds?
I want to send SCPI commands to figure out when the DMMs have triggered and read the most recent measurement. This should be possible because the USB bus turnaround time (~3ms) is shorter than the trigger period (100ms) and integration time (67ms with autozero). I could run the trigger slower if needed.
My problem is that there does not seem to be a way to reliably determine when a new trigger has occurred and then read the last measured value.
- The Rigol command set MEAS? command returns TRUE when new data has come in that has not been read out. However, there is no way to read the previously measured value and reset the result of the MEAS? command to FALSE. FUNC2:VAL1? and MEAS:VOLT:DC? in the rigol command set only give you the measurement result after the next trigger. VAL1? in the fluke command set reads the previously measured value but it does not reset the result of MEAS? to false. This implementation is completely braindead.
- I could send MEAS:VOLT:DC? commands to both meters with sufficiently long timeout, wait for results, and then immediately send new MEAS:VOLT:DC? commands as quickly as possible. My concern here is with race conditions. If the two MEAS:VOLT:DC? commands go out at slightly different times near an external trigger edge, one of the meters might miss a trigger. I suppose I could check for this by timing when results come back and ignore data samples on missed triggers.
- I could also use the Agilent command set to initiate the collection of a group of samples (<=512), wait for the time that takes, and then FETCh? the results. There would be a processing delay between groups of measurements, but I think I'm ok with that. I can run statistics on each group of 512 samples or whatever. My concern here, again, is a race condition. One of the meters might miss the first trigger, and then all of the samples would be staggered between the two meters by one trigger period. I suppose I could try controlling the sig gen as well, send INIT to both meters, wait, then enable the sig gen output for triggering.
Is there another or better way to do this? Other than buying Keysight or Tek meters, that is. I'm starting to save money for that. These meters work ok, but some of the implementation is just stupid, and it's pissing me off.
Another fun one with the DM3068 is it can save up to 512 readings in its internal buffer, but this is only accessible in the Agilent command set. And it lets you set SAMP:COUN to greater than 512, but it just completely hangs the SCPI subsystem if you do that. Very fun. This is also not mentioned in the datasheet or in the SAMP:COUN or INIT or FETC commands in the programming manual. You have to check the DATA:FEED RDG_STORE command in the programming manual.