36#ifndef AgilentOscilloscope_h
37#define AgilentOscilloscope_h
70 virtual void SetChannelCoupling(
size_t i, OscilloscopeChannel::CouplingType type)
override;
80 virtual void SetChannelOffset(
size_t i,
size_t stream,
float offset)
override;
85 virtual void Start()
override;
87 virtual void Stop()
override;
96 virtual std::set<InterleaveConflict> GetInterleaveConflicts()
override;
178 void GetTriggerSlope(
EdgeTrigger* trig, std::string reply);
187 void PushFloat(std::string path,
float f);
194 static std::map<uint64_t, uint64_t> m_sampleRateToDuration;
197 struct WaveformPreamble
202 unsigned int average_count;
211 void ConfigureWaveform(std::string channel);
212 bool IsAnalogChannel(
size_t i);
213 size_t GetDigitalPodIndex(
size_t i);
214 std::string GetDigitalPodName(
size_t i);
215 std::vector<uint8_t> GetWaveformData(std::string channel);
216 WaveformPreamble GetWaveformPreamble(std::string channel);
217 void ProcessDigitalWaveforms(
218 std::map<
int, std::vector<WaveformBase*>> &pending_waveforms,
219 std::vector<uint8_t> &data, WaveformPreamble &preamble,
221 void SetSampleRateAndDepth(uint64_t rate, uint64_t depth);
Declaration of EdgeTrigger.
Declaration of NthEdgeBurstTrigger.
Declaration of PulseWidthTrigger.
Driver for Agilent (and some Keysight) oscilloscopes.
Definition: AgilentOscilloscope.h:48
virtual bool IsTriggerArmed() override
Checks if the trigger is currently armed.
Definition: AgilentOscilloscope.cpp:847
uint64_t m_sampleDepth
Acquisition memory depth.
Definition: AgilentOscilloscope.h:160
virtual std::vector< uint64_t > GetSampleDepthsInterleaved() override
Get the legal memory depths for this scope in combined-channels mode.
Definition: AgilentOscilloscope.cpp:919
virtual uint64_t GetSampleRate() override
Gets the current sampling rate (in Hz) of this scope.
Definition: AgilentOscilloscope.cpp:926
virtual void DisableChannel(size_t i) override
Turn a channel off, given the index.
Definition: AgilentOscilloscope.cpp:324
virtual void ForceTrigger() override
Forces a single acquisition as soon as possible.
Definition: AgilentOscilloscope.cpp:842
virtual void SetChannelAttenuation(size_t i, double atten) override
Sets the probe attenuation used for an input channel.
Definition: AgilentOscilloscope.cpp:438
virtual void SetSampleDepth(uint64_t depth) override
Sets the sample depth of the scope.
Definition: AgilentOscilloscope.cpp:989
virtual float GetChannelVoltageRange(size_t i, size_t stream) override
Gets the range of the current channel configuration.
Definition: AgilentOscilloscope.cpp:486
bool m_triggerArmed
True if trigger is armed, false if idle.
Definition: AgilentOscilloscope.h:169
virtual uint64_t GetSampleDepth() override
Gets the current sample depth of this scope.
Definition: AgilentOscilloscope.cpp:939
virtual void Stop() override
Stops triggering.
Definition: AgilentOscilloscope.cpp:834
virtual std::vector< OscilloscopeChannel::CouplingType > GetAvailableCouplings(size_t i) override
Gets the set of legal coupling values for an input channel.
Definition: AgilentOscilloscope.cpp:336
std::map< size_t, int > m_channelBandwidthLimits
Map of channel ID to bandwidth limit.
Definition: AgilentOscilloscope.h:148
bool m_sampleDepthValid
True if m_sampleDepth is valid, false if not.
Definition: AgilentOscilloscope.h:157
virtual void SetChannelVoltageRange(size_t i, size_t stream, float range) override
Sets the range of the current channel configuration.
Definition: AgilentOscilloscope.cpp:512
ProbeType
Type of probe connected to a channel.
Definition: AgilentOscilloscope.h:124
@ AutoProbe
Passive probe with ID resistor for detecting attenuation.
Definition: AgilentOscilloscope.h:129
@ SmartProbe
Active probe.
Definition: AgilentOscilloscope.h:132
@ None
No probe, or no ID ring present.
Definition: AgilentOscilloscope.h:126
std::map< size_t, float > m_channelOffsets
Map of channel ID to offset.
Definition: AgilentOscilloscope.h:136
void PushCondition(std::string path, Trigger::Condition cond)
Send a trigger condition to the instrument.
Definition: AgilentOscilloscope.cpp:1378
uint64_t m_sampleRate
Acquisition sample rate.
Definition: AgilentOscilloscope.h:166
virtual bool AcquireData() override
Pull data from the instrument.
Definition: AgilentOscilloscope.cpp:724
void GetProbeType(size_t i)
Figures out what kind of probe is connected to a channel.
Definition: AgilentOscilloscope.cpp:1262
virtual void PullTrigger() override
Updates m_trigger with any changes made from the instrument side.
Definition: AgilentOscilloscope.cpp:1026
bool m_sampleRateValid
True if m_sampleRate is valid, false if not.
Definition: AgilentOscilloscope.h:163
virtual std::vector< uint64_t > GetSampleRatesInterleaved() override
Get the legal sampling rates (in Hz) for this scope in combined-channels mode.
Definition: AgilentOscilloscope.cpp:883
virtual void SetTriggerOffset(int64_t offset) override
Sets the trigger offset.
Definition: AgilentOscilloscope.cpp:1005
virtual void PushTrigger() override
Pushes changes made to m_trigger to the instrument.
Definition: AgilentOscilloscope.cpp:1286
void PushPulseWidthTrigger(PulseWidthTrigger *trig)
Pushes settings for a pulse width trigger to the instrument.
Definition: AgilentOscilloscope.cpp:1348
unsigned int m_analogChannelCount
Hardware analog channel count, independent of LA option etc.
Definition: AgilentOscilloscope.h:114
virtual void FlushConfigCache() override
Instruments are allowed to cache configuration settings to reduce round trip queries to the device.
Definition: AgilentOscilloscope.cpp:221
virtual void StartSingleTrigger() override
Arms the trigger for a single acquistion.
Definition: AgilentOscilloscope.cpp:826
virtual void EnableChannel(size_t i) override
Turn a channel on, given the index.
Definition: AgilentOscilloscope.cpp:308
virtual void Start() override
Starts the instrument in continuous trigger mode.
Definition: AgilentOscilloscope.cpp:818
void PullPulseWidthTrigger()
Reads settings for a pulse width trigger from the instrument.
Definition: AgilentOscilloscope.cpp:1133
void PushNthEdgeBurstTrigger(NthEdgeBurstTrigger *trig)
Pushes settings for a Nth edge burst trigger to the instrument.
Definition: AgilentOscilloscope.cpp:1330
virtual void SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type) override
Sets the coupling used for an input channel.
Definition: AgilentOscilloscope.cpp:382
void PullEdgeTrigger()
Reads settings for an edge trigger from the instrument.
Definition: AgilentOscilloscope.cpp:1052
std::map< size_t, float > m_channelVoltageRanges
Map of channel ID to voltage range.
Definition: AgilentOscilloscope.h:139
void PushEdgeTrigger(EdgeTrigger *trig)
Pushes settings for an edge trigger to the instrument.
Definition: AgilentOscilloscope.cpp:1308
void PullNthEdgeBurstTrigger()
Reads settings for an Nth-edge-burst trigger from the instrument.
Definition: AgilentOscilloscope.cpp:1089
bool m_triggerOneShot
True if trigger is one-shot (single or forced), false if idle.
Definition: AgilentOscilloscope.h:172
std::map< size_t, ProbeType > m_probeTypes
Map of channel ID to probe type.
Definition: AgilentOscilloscope.h:154
virtual void SetChannelBandwidthLimit(size_t i, unsigned int limit_mhz) override
Sets the bandwidth limit for an input channel.
Definition: AgilentOscilloscope.cpp:481
virtual float GetChannelOffset(size_t i, size_t stream) override
Gets the offset, in volts, for a given channel.
Definition: AgilentOscilloscope.cpp:531
virtual bool IsChannelEnabled(size_t i) override
Checks if a channel is enabled in hardware.
Definition: AgilentOscilloscope.cpp:276
virtual void SetSampleRate(uint64_t rate) override
Sets the sample rate of the scope, in Hz.
Definition: AgilentOscilloscope.cpp:997
void PushFloat(std::string path, float f)
Send a floating-point value to the instrument.
Definition: AgilentOscilloscope.cpp:1404
virtual Oscilloscope::TriggerMode PollTrigger() override
Checks the curent trigger status.
Definition: AgilentOscilloscope.cpp:571
virtual OscilloscopeChannel * GetExternalTrigger() override
Returns the external trigger input channel, if we have one.
Definition: AgilentOscilloscope.cpp:525
static std::string GetDriverNameInternal()
Return the constant driver name "agilent".
Definition: AgilentOscilloscope.cpp:203
virtual unsigned int GetChannelBandwidthLimit(size_t i) override
Gets the bandwidth limit for an input channel.
Definition: AgilentOscilloscope.cpp:454
virtual int64_t GetTriggerOffset() override
Gets the trigger offset.
Definition: AgilentOscilloscope.cpp:1010
std::map< size_t, OscilloscopeChannel::CouplingType > m_channelCouplings
Map of channel ID to voltage range.
Definition: AgilentOscilloscope.h:142
virtual unsigned int GetInstrumentTypes() const override
Returns a bitfield describing the set of instrument types that this instrument supports.
Definition: AgilentOscilloscope.cpp:208
Trigger::Condition GetCondition(std::string reply)
Converts a trigger condition from a string to a Trigger::Condition.
Definition: AgilentOscilloscope.cpp:1242
unsigned int m_digitalChannelCount
Number of digital channels supported.
Definition: AgilentOscilloscope.h:117
virtual bool IsInterleaving() override
Checks if the scope is currently combining channels.
Definition: AgilentOscilloscope.cpp:1016
AgilentOscilloscope(SCPITransport *transport)
Connect to an oscilloscope.
Definition: AgilentOscilloscope.cpp:54
OscilloscopeChannel * m_extTrigChannel
External trigger.
Definition: AgilentOscilloscope.h:111
std::map< int, bool > m_channelsEnabled
Map of channel ID to enable flag.
Definition: AgilentOscilloscope.h:151
virtual bool SetInterleaving(bool combine) override
Configures the scope to combine channels.
Definition: AgilentOscilloscope.cpp:1021
virtual OscilloscopeChannel::CouplingType GetChannelCoupling(size_t i) override
Gets the coupling used for an input channel.
Definition: AgilentOscilloscope.cpp:346
std::map< size_t, double > m_channelAttenuations
Map of channel ID to attenuation.
Definition: AgilentOscilloscope.h:145
virtual std::vector< uint64_t > GetSampleRatesNonInterleaved() override
Get the legal sampling rates (in Hz) for this scope in all-channels mode.
Definition: AgilentOscilloscope.cpp:874
unsigned int m_digitalChannelBase
Index of the first digital channel (if any)
Definition: AgilentOscilloscope.h:120
virtual std::vector< uint64_t > GetSampleDepthsNonInterleaved() override
Get the legal memory depths for this scope in all-channels mode.
Definition: AgilentOscilloscope.cpp:897
virtual double GetChannelAttenuation(size_t i) override
Gets the probe attenuation for an input channel.
Definition: AgilentOscilloscope.cpp:417
virtual std::vector< std::string > GetTriggerTypes() override
Gets a list of triggers this instrument supports.
Definition: AgilentOscilloscope.cpp:1461
virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override
Returns a bitfield describing the set of instrument types that a given channel supports.
Definition: AgilentOscilloscope.cpp:213
virtual void SetChannelOffset(size_t i, size_t stream, float offset) override
Sets the offset for a given channel.
Definition: AgilentOscilloscope.cpp:558
Simple edge trigger.
Definition: EdgeTrigger.h:44
EdgeType
Types of edges to trigger on.
Definition: EdgeTrigger.h:51
Nth Edge Burst Trigger: triggers on a specific edge within a burst.
Definition: NthEdgeBurstTrigger.h:44
EdgeType
Types of edges to trigger on.
Definition: NthEdgeBurstTrigger.h:51
A single channel on an oscilloscope.
Definition: OscilloscopeChannel.h:49
TriggerMode
Definition: Oscilloscope.h:411
Trigger on a pulse meeting certain width criteria.
Definition: PulseWidthTrigger.h:44
An SCPI-based oscilloscope.
Definition: SCPIOscilloscope.h:38
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47
Condition
Conditions for triggers that perform logical comparisons of values.
Definition: Trigger.h:69