ngscopeclient / scopehal

Test and measurement hardware abstraction library and protocol decodes. This is the library only. Most users should use scopehal-apps.
BSD 3-Clause "New" or "Revised" License
216 stars 97 forks source link

Rigol: Occasional floating point exception when triggering capture from ground-coupled channel #817

Closed juh2600 closed 1 year ago

juh2600 commented 1 year ago

Broken out from #815 per https://github.com/ngscopeclient/scopehal/issues/815#issuecomment-1818190650.

Observed in Linux Release build of ngscopeclient ecc525e, scopehal 2f49730, using a Rigol DS1054Z connected via LAN.

To reproduce:

  1. Clear preferences and stuff: rm -rf ~/.config/ngscopeclient/
  2. Hook up Rigol DS1054Z chan1 to signal source and press AUTO to reset scope config
  3. Launch ngscopeclient --debug --trace SCPISocketTransport
  4. Add > Oscilloscope > Connect > rigol, lan
  5. Trigger a one-shot capture from ngscopeclient
  6. Double-click yellow CHAN1 marker in top left of waveform group
  7. Change Input > Coupling from DC to Ground
  8. Trigger another one-shot capture from ngscopeclient

This procedure doesn't always generate an FPE, but it does sometimes.

couple-gnd-sigfpe.txt

azonenberg commented 1 year ago

Glancing at the capture, it appears that the scope is reporting zero points in the waveform preamble (the final WF:PRE?).

This is probably triggering an integer over/underflow, divide by zero, or similar in the RigolOscilloscope driver. The correct way to handle this would be for AcquireData() to simply not return any waveforms.