Difference between revisions of "Oscilloscopes"
Line 41: | Line 41: | ||
{{config_key|1=Previously set value|2=Number of frames to capture (default 0 = unlimited)|3=NA}} | {{config_key|1=Previously set value|2=Number of frames to capture (default 0 = unlimited)|3=NA}} | ||
=== SR_CONF_NUM_TIMEBASE === | |||
The number of divisions an oscilloscope has across its horizontal (time) axis. This corresponds to the areas marked off by the vertical lines on the graticule of the device's display. Even on headless oscilloscopes, this concept still exists; for example the SR_CONF_TIMEBASE setting is meaningless without this number. | |||
{{config_key|1=Static number, fixed per model|2=NA|3=NA}} | |||
=== SR_CONF_TIMEBASE === | === SR_CONF_TIMEBASE === |
Revision as of 14:32, 20 January 2014
This page documents the config keys are various other info needed to write a libsigrok frontend for controlling oscilloscopes.
Frame-based
Generally oscilloscopes work by triggering on either the signal under measurement, or some external trigger. The device then measures as much as its internal buffer can hold. When the buffer is full, the device stops measurement and sends its buffer over to the libsigrok driver. This transfer represents a frame's worth of data. The driver converts this data to the libsigrok internal analog format and sends it out to the frontend like this:
Packet type | Payload |
---|---|
SR_DF_FRAME_BEGIN | |
SR_DF_ANALOG | analog data |
SR_DF_ANALOG... | |
SR_DF_FRAME_END |
The oscilloscope then restarts acquisition, sometimes after prodding by the driver. The data received from an oscilloscope is thus not contiguous from one frame to the next: in between there is a period where no measurements are done by the device.
Streaming
Some devices can act as continuously streaming oscilloscopes, with no framing involved. Notably FX2-based devices with an analog frontend, such as the Nexus-Computing OsciPrime, work this way.
Config keys
A libsigrok driver for an oscilloscope implements all or some subset of the following config keys.
SR_CONF_OSCILLOSCOPE
Denotes a device that can act as an oscilloscope, i.e. measure voltage over time on one or more analog channels, and send those measurements out to the frontend as analog values.
SR_CONF_LIMIT_FRAMES
Frame-based oscilloscopes implement this key set to the number of frames to capture and send out, between SR_DF_FRAME_BEGIN and SR_DF_FRAME_END packets.
It is only used to set this value; getting it will just return the previously set value. Defaults to 0, meaning continuously grab frames until told to stop.
Type | {{{type}}} |
Get | NA |
Set | NA |
List | NA |
SR_CONF_NUM_TIMEBASE
The number of divisions an oscilloscope has across its horizontal (time) axis. This corresponds to the areas marked off by the vertical lines on the graticule of the device's display. Even on headless oscilloscopes, this concept still exists; for example the SR_CONF_TIMEBASE setting is meaningless without this number.
Type | {{{type}}} |
Get | NA |
Set | NA |
List | NA |