Author Topic: SCPI - get instantaneous channel reading DS1054Z  (Read 712 times)

0 Members and 1 Guest are viewing this topic.

Offline orneaTopic starter

  • Supporter
  • ****
  • Posts: 139
  • Country: au
SCPI - get instantaneous channel reading DS1054Z
« on: May 05, 2024, 03:02:54 am »
i think I am missing the point and doing it all wrong.

I simply want to read the current channel input value.  i.e. The current ADC reading.

It seems my only options are to use SCPI command to

1. :MEAS:ITEM? with one of the following {VMAX|VMIN|VPP|VTOP|VBASe|VAMP|VAVG|VRMS|OVERshoot|PREShoot|MARea|MPARea|PERiod|FREQuency|RTIMe|FTIMe|PWIDth|NWIDth|PDUTy|NDUTy|RDELay|FDELay|RPHase|FPHase|TVMAX|TVMIN|PSLEWrate|NSLEWrate|VUPper|VMID|VLOWer|VARIance|PVRMS|PPULses|NPULses|PEDGes|NEDGes} or

2. :WAV:DATA? to read the entire internal memory and then pick an arbitrary point to use as my reading.

Has any one come up with an elegant work around to simply get the current ADC value for a channel.

(1). above only gives results on a processed waveform and (2) seems like massive overkill.

I am currently using :MEAS:ITEM? VAVG like RoGeorge does here https://github.com/RoGeorge/DS1054Z_data_logger which works for slowly changing voltages but no good when trying to sample at a point in time of my choosing for a varying signal.

I am thinking I have no choice but to use waveform and select a point in the array that is closest in time to my sample time.

I basically want to use the scope as an ADC and do the waveform analysis in software.

Any tips/hints/tricks warmly welcome.

ornea.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6488
  • Country: ro
Re: SCPI - get instantaneous channel reading DS1054Z
« Reply #1 on: May 05, 2024, 09:27:20 am »
Unfortunately, Rigol DS1054Z can not stream the raw ADC values.  It does not work like a Data Acquisition device, and its LAN or USB won't be fast enough anyway, to keep the peace with the max ADC throughput.  That is why, internally, it needs an FPGA to store that avalanche of data into local RAM.  1GSa/s at 8 bits means it would need an 8Gbit link (with extra data bordering needed to sent over LAN, probably a 10Gbit/s LAN will barely cope with the data coming from the ADC).  A casual laptop/desktop won't be able to cope with that data throughput, unless it was specially built for high throughput data streams.

If you need continuous data streaming of all ADC values, you may want to search for DAQ cards.  Otherwise, all the oscilloscope can do, is to send at most its entire 24 million samples, the max that can be stored at a trigger.  The ~24MB of raw samples will take about half a minute to be transferred over LAN.

Offline orneaTopic starter

  • Supporter
  • ****
  • Posts: 139
  • Country: au
Re: SCPI - get instantaneous channel reading DS1054Z
« Reply #2 on: May 05, 2024, 10:21:09 am »
Thanks for the reply RoGeorge.

It is not a constant stream of data I want.  Just a single reading when I choose.  Maybe every second maybe every 5 seconds.

I automate many devices, PSU's, Temperature Probes etc, then change a setting then I want to measure a voltage often to calibrate or characterise a device.  So I just want a reading when I want.

I get you point re the massive amount of data.

I think I have a solution for my use case (which I need to test):-

$MEMORYDEPTH = :ACQuire:MDEPth?
:RUN
:WAV:SOUR CHAN2
:WAV:MODE NORM
:WAV:FORM ASCii
:WAV:STAR $MEMORYDEPTH
:WAV:STOP $MEMORYDEPTH
:WAV:DATA?

Now every time I query :WAV:DATA?  it returns the last value displayed which would be very close to the last ADC measurement which is the waveform point on the far right of the screen..

Just not sure if :ACQuire:MDEPth? is the right waveform point when reading the screen waveform.

 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2903
  • Country: 00
Re: SCPI - get instantaneous channel reading DS1054Z
« Reply #3 on: May 05, 2024, 10:37:52 am »
Is the aperture time critical? Otherwise I'd think a bench DMM, if available, would be a simpler way to retrieve a single sample at such long intervals.
« Last Edit: May 05, 2024, 11:02:31 am by alm »
 
The following users thanked this post: abeyer

Offline Njk

  • Frequent Contributor
  • **
  • Posts: 255
  • Country: ru
Re: SCPI - get instantaneous channel reading DS1054Z
« Reply #4 on: May 05, 2024, 10:55:46 am »
Test Controller seems suitable. But DS1000Z has its peculiarities and there must be a reason it's not supported by this software. Ask HKJ
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6488
  • Country: ro
Re: SCPI - get instantaneous channel reading DS1054Z
« Reply #5 on: May 05, 2024, 12:57:03 pm »
Just not sure if :ACQuire:MDEPth? is the right waveform point when reading the screen waveform.

In the set of commands you posted, MDEPTH doesn't matter, it is ignored.

If you set normal mode with :WAV:MODE NORM, that means at the next :WAV:DATA? it will transfer only what is on the display at that moment.  It doesn't matter the MDEPTH and the start/stop points you set.  Those are for RAW mode transfer.  In NORMal mode transfer, only 1200 samples will be downloaded, each sample corresponding to a pixel from the trace on the oscilloscope's display (display width is 1200).

If the trigger moment is in the middle of the screen, then you can discard all samples except the sample 600th sample, and that one would be the 8 bits value at the trigger time.

If you want (rare) but precise (aperture), you can put the oscilloscope in single sweep mode (:TRIGger:SWEep SINGle), then generate from the PC a pulse (or from some other device with a digital output), and that pulse will trigger the oscilloscope (you apply that pulse to another osc channel), then download only that screen captured after you sent the trigger pulse (:WAV:MODE NORM;  :WAV:DATA?).  Then, in the PC software, discard all other points in the trace, and keep only the ADC sample from the trigger moment.

If the trigger moment is not critical (for reading once at 1..5 seconds or so), then you can use the measurement functions of the oscilloscope (the ones on the buttons at the left side of the screen).  Though those functions are using all the pixels of a trace, but only the pixels that are visible on the osc screen (1200 visible values of the trace, not the full range of samples given by memdepth).  For example :MEASure:ITEM VAVG,CHANnel1 if the voltage is mostly DC in the screen around the trigger time.
« Last Edit: May 05, 2024, 01:02:46 pm by RoGeorge »
 

Offline orneaTopic starter

  • Supporter
  • ****
  • Posts: 139
  • Country: au
Re: SCPI - get instantaneous channel reading DS1054Z
« Reply #6 on: May 06, 2024, 03:06:18 am »
Hey RoGeorge,

I like your thinking.  They are interesting solutions and much to think about.

Thanks for the MDEPTH explanation, I was getting what appeared to be weird results when I was experimenting and incorrectly rationalised its behavior.

For example, I was unable to explain why I was getting data and what was the data when executing these

:WAV:STAR 1500
:WAV:STOP 1600
:WAV:DATA?

I thought perhaps screen memory is bigger than the screen and maybe just a copy of internal memory but it turns out, it just ignores the invalid parameters and uses the last valid parameters entered. For example entering these would be continued to be used until new valid parameters were entered and download the last 100 point of the screen.

:WAV:STAR 1100
:WAV:STOP 1200
 
 

Offline orneaTopic starter

  • Supporter
  • ****
  • Posts: 139
  • Country: au
Re: SCPI - get instantaneous channel reading DS1054Z
« Reply #7 on: May 06, 2024, 03:23:22 am »
I found it interesting that the screen image differs from the screen data as in the two images attached.

The channel is connected to the Square Wave source of the scope itself.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6488
  • Country: ro
Re: SCPI - get instantaneous channel reading DS1054Z
« Reply #8 on: May 07, 2024, 06:40:56 am »
The trace can only be in one place at a time, the correct view is the downloaded data.  The screen looks differently because it tries to emulate the optical remanence of a phosphorus screen, like it used to be in the analog oscilloscopes with a CRT instead of LCD.

:WAV:STAR 1100
:WAV:STOP 1200

That's even better than downloading all the 1200 samples then discarding.  :-+


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf