ngscopeclient v0.2.1
Loading...
Searching...
No Matches
SiglentSCPIOscilloscope.h
1/***********************************************************************************************************************
2* *
3* libscopehal *
4* *
5* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
6* All rights reserved. *
7* *
8* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
9* following conditions are met: *
10* *
11* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
12* following disclaimer. *
13* *
14* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
15* following disclaimer in the documentation and/or other materials provided with the distribution. *
16* *
17* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
18* derived from this software without specific prior written permission. *
19* *
20* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
21* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
22* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
24* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
26* POSSIBILITY OF SUCH DAMAGE. *
27* *
28***********************************************************************************************************************/
29
30#ifndef SiglentSCPIOscilloscope_h
31#define SiglentSCPIOscilloscope_h
32
33#include <mutex>
34#include <chrono>
35
36class DropoutTrigger;
37class EdgeTrigger;
38class GlitchTrigger;
40class RuntTrigger;
41class SlewRateTrigger;
42class UartTrigger;
43class WindowTrigger;
44
50#define MAX_ANALOG 4
51#define MAX_DIGITAL 16
52#define WAVEDESC_SIZE 346
53
54// These SDS2000/SDS5000 scopes will actually sample 200MPoints, but the maximum it can transfer in one
55// chunk is 10MPoints
56// TODO(dannas): Can the Siglent SDS1104x-e really transfer 14MPoints? Update comment and constant
57#define WAVEFORM_SIZE (14 * 1000 * 1000)
58
59#define c_digiChannelsPerBus 8
60
62 , public virtual SCPIFunctionGenerator
63{
64public:
67
68 //not copyable or assignable
70 SiglentSCPIOscilloscope& operator=(const SiglentSCPIOscilloscope& rhs) = delete;
71
72private:
73 std::string converse(const char* fmt, ...);
74 void sendOnly(const char* fmt, ...);
75 void flush();
76 void flushWaveformData();
77 void protocolError(std::string message = "");
78
79protected:
80 void IdentifyHardware();
81 void DetectBandwidth();
82 void SharedCtorInit();
83 virtual void DetectAnalogChannels();
84 void AddDigitalChannels(unsigned int count);
85 void DetectOptions();
86 void ParseFirmwareVersion();
87 uint64_t GetMaxPoints();
88 uint64_t GetAcqPoints();
89 uint64_t GetDigitalAcqPoints();
90
91public:
92 //Device information
93 virtual unsigned int GetInstrumentTypes() const override;
94 virtual unsigned int GetMeasurementTypes();
95 virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override;
96
97 virtual void FlushConfigCache() override;
98
99 void ForceHDMode(bool mode);
100
101 //Channel configuration
102 virtual bool IsChannelEnabled(size_t i) override;
103 virtual void EnableChannel(size_t i) override;
104 virtual bool CanEnableChannel(size_t i) override;
105 virtual void DisableChannel(size_t i) override;
106 virtual OscilloscopeChannel::CouplingType GetChannelCoupling(size_t i) override;
107 virtual void SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type) override;
108 virtual std::vector<OscilloscopeChannel::CouplingType> GetAvailableCouplings(size_t i) override;
109 virtual double GetChannelAttenuation(size_t i) override;
110 virtual void SetChannelAttenuation(size_t i, double atten) override;
111 virtual unsigned int GetChannelBandwidthLimit(size_t i) override;
112 virtual void SetChannelBandwidthLimit(size_t i, unsigned int limit_mhz) override;
113 virtual float GetChannelVoltageRange(size_t i, size_t stream) override;
114 virtual void SetChannelVoltageRange(size_t i, size_t stream, float range) override;
115 virtual OscilloscopeChannel* GetExternalTrigger() override;
116 virtual float GetChannelOffset(size_t i, size_t stream) override;
117 virtual void SetChannelOffset(size_t i, size_t stream, float offset) override;
118 virtual std::string GetChannelDisplayName(size_t i) override;
119 virtual void SetChannelDisplayName(size_t i, std::string name) override;
120 virtual std::vector<unsigned int> GetChannelBandwidthLimiters(size_t i) override;
121 virtual bool CanInvert(size_t i) override;
122 virtual void Invert(size_t i, bool invert) override;
123 virtual bool IsInverted(size_t i) override;
124
125 //Triggering
126 virtual Oscilloscope::TriggerMode PollTrigger() override;
127 virtual bool AcquireData() override;
128 virtual void Start() override;
129 virtual void StartSingleTrigger() override;
130 virtual void Stop() override;
131 virtual void ForceTrigger() override;
132 virtual bool IsTriggerArmed() override;
133 virtual void PushTrigger() override;
134 virtual void PullTrigger() override;
135 virtual void EnableTriggerOutput() override;
136 virtual std::vector<std::string> GetTriggerTypes() override;
137
138 //Scope communication protocol.
139 enum Protocol
140 {
141 PROTOCOL_SPO,
142 PROTOCOL_ESERIES,
143 // Refers to E11 Siglent Programming Guide :
144 // https://www.siglenteu.com/wp-content/uploads/dlm_uploads/2024/03/ProgrammingGuide_EN11F.pdf
145 PROTOCOL_E11,
146 PROTOCOL_UNKNOWN
147 };
148
149 //Scope models.
150 //We only distinguish down to the series of scope, exact SKU is mostly irrelevant.
151 enum Model
152 {
153 MODEL_SIGLENT_SDS800X_HD,
154 MODEL_SIGLENT_SDS1000,
155 MODEL_SIGLENT_SDS1000X_HD,
156 MODEL_SIGLENT_SDS2000XE,
157 MODEL_SIGLENT_SDS2000XP,
158 MODEL_SIGLENT_SDS2000X_HD,
159 MODEL_SIGLENT_SDS3000X_HD,
160 MODEL_SIGLENT_SDS5000X,
161 MODEL_SIGLENT_SDS6000L,
162 MODEL_SIGLENT_SDS6000A,
163 MODEL_SIGLENT_SDS6000PRO,
164 MODEL_SIGLENT_SDS7000A,
165 MODEL_UNKNOWN
166 };
167
168 //Scope channel mode (only relevant for E11 models).
169 enum ChannelMode
170 {
171 CHANNEL_MODE_SINGLE,
172 CHANNEL_MODE_DUAL,
173 CHANNEL_MODE_MULTI
174 };
175
176 Model GetModelID() { return m_modelid; }
177
178 std::string GetModelString() const
179 {
180 switch(m_modelid)
181 {
182 case MODEL_SIGLENT_SDS800X_HD: return "SIGLENT_SDS800X_HD";
183 case MODEL_SIGLENT_SDS1000: return "SIGLENT_SDS1000";
184 case MODEL_SIGLENT_SDS1000X_HD: return "SIGLENT_SDS1000X_HD";
185 case MODEL_SIGLENT_SDS2000XE: return "SIGLENT_SDS2000XE";
186 case MODEL_SIGLENT_SDS2000XP: return "SIGLENT_SDS2000XP";
187 case MODEL_SIGLENT_SDS2000X_HD: return "SIGLENT_SDS2000X_HD";
188 case MODEL_SIGLENT_SDS3000X_HD: return "SIGLENT_SDS3000X_HD";
189 case MODEL_SIGLENT_SDS5000X: return "SIGLENT_SDS5000X";
190 case MODEL_SIGLENT_SDS6000L: return "SIGLENT_SDS6000L";
191 case MODEL_SIGLENT_SDS6000A: return "SIGLENT_SDS6000A";
192 case MODEL_SIGLENT_SDS6000PRO: return "SIGLENT_SDS6000PRO";
193 case MODEL_SIGLENT_SDS7000A: return "SIGLENT_SDS7000A";
194 default:
195 case MODEL_UNKNOWN: return "UNKNOWN";
196 }
197 }
198
199 //Timebase
200 virtual std::vector<uint64_t> GetSampleRatesNonInterleaved() override;
201 virtual std::vector<uint64_t> GetSampleRatesInterleaved() override;
202 virtual std::set<InterleaveConflict> GetInterleaveConflicts() override;
203 virtual std::vector<uint64_t> GetSampleDepthsNonInterleaved() override;
204 virtual std::vector<uint64_t> GetSampleDepthsInterleaved() override;
205 virtual uint64_t GetSampleRate() override;
206 virtual uint64_t GetSampleDepth() override;
207 virtual void SetSampleDepth(uint64_t depth) override;
208 virtual void SetSampleRate(uint64_t rate) override;
209 virtual void SetUseExternalRefclk(bool external) override;
210 virtual bool IsInterleaving() override;
211 virtual bool SetInterleaving(bool combine) override;
212
213 virtual void SetTriggerOffset(int64_t offset) override;
214 virtual int64_t GetTriggerOffset() override;
215 virtual void SetDeskewForChannel(size_t channel, int64_t skew) override;
216 virtual int64_t GetDeskewForChannel(size_t channel) override;
217
219 // Function generator
220
221 virtual std::vector<WaveShape> GetAvailableWaveformShapes(int chan) override;
222
223 //Configuration
224 virtual bool GetFunctionChannelActive(int chan) override;
225 virtual void SetFunctionChannelActive(int chan, bool on) override;
226
227 virtual float GetFunctionChannelDutyCycle(int chan) override;
228 virtual void SetFunctionChannelDutyCycle(int chan, float duty) override;
229
230 virtual float GetFunctionChannelAmplitude(int chan) override;
231 virtual void SetFunctionChannelAmplitude(int chan, float amplitude) override;
232
233 virtual float GetFunctionChannelOffset(int chan) override;
234 virtual void SetFunctionChannelOffset(int chan, float offset) override;
235
236 virtual float GetFunctionChannelFrequency(int chan) override;
237 virtual void SetFunctionChannelFrequency(int chan, float hz) override;
238
239 virtual WaveShape GetFunctionChannelShape(int chan) override;
240 virtual void SetFunctionChannelShape(int chan, WaveShape shape) override;
241
242 virtual bool HasFunctionRiseFallTimeControls(int chan) override;
243
245 virtual void SetFunctionChannelOutputImpedance(int chan, OutputImpedance z) override;
246
248 // Logic analyzer configuration
249
250 virtual std::vector<DigitalBank> GetDigitalBanks() override;
251 virtual DigitalBank GetDigitalBank(size_t channel) override;
252 virtual bool IsDigitalHysteresisConfigurable() override;
253 virtual bool IsDigitalThresholdConfigurable() override;
254 virtual float GetDigitalHysteresis(size_t channel) override;
255 virtual float GetDigitalThreshold(size_t channel) override;
256 virtual void SetDigitalHysteresis(size_t channel, float level) override;
257 virtual void SetDigitalThreshold(size_t channel, float level) override;
258
260 // ADC bit depth configuration
261
262 //All currently supported Sig2 scopes have only one analog bank (same ADC config for all channels)
263 //so no need to override those
264
265 enum ADCMode
266 {
267 ADC_MODE_8BIT = 0,
268 ADC_MODE_10BIT = 1
269 };
270
271 virtual bool IsADCModeConfigurable() override;
272 virtual std::vector<std::string> GetADCModeNames(size_t channel) override;
273 virtual size_t GetADCMode(size_t channel) override;
274 virtual void SetADCMode(size_t channel, size_t mode) override;
275
276protected:
277 void PullDropoutTrigger();
278 void PullEdgeTrigger();
280 void PullRuntTrigger();
281 void PullSlewRateTrigger();
282 void PullUartTrigger();
283 void PullWindowTrigger();
284 void PullTriggerSource(Trigger* trig, const std::string& triggerModeName, bool isUart);
285
286 void GetTriggerSlope(EdgeTrigger* trig, std::string reply);
288
290 void PushEdgeTrigger(EdgeTrigger* trig, const std::string& trigType);
291 void PushGlitchTrigger(GlitchTrigger* trig);
292 void PushCondition(const std::string& path, Trigger::Condition cond);
293 void PushPatternCondition(const std::string& path, Trigger::Condition cond);
294 void PushFloat(const std::string& path, float f);
300
302
303 ChannelMode GetChannelMode();
304
305 void PrepareAcquisition();
306
307 std::string GetPossiblyEmptyString(const std::string& property);
308
309 int ReadWaveformBlock(uint32_t maxsize, size_t& readBytes, char* data, bool hdSizeWorkaround = false, std::function<void(float)> progress = nullptr);
310 bool ReadWavedescs(
311 char wavedescs[MAX_ANALOG][WAVEDESC_SIZE], bool* analogEnabled, bool* digitalEnabled, bool& anyAnalogEnabled, bool& anyDigitalEnabled);
312
313 time_t ExtractTimestamp(unsigned char* wavedesc, double& basetime);
314
315 std::vector<WaveformBase*> ProcessAnalogWaveform(
317 size_t datalen,
318 char* wavedesc,
321 double basetime,
322 double* wavetime,
323 int i);
324
325 std::vector<SparseDigitalWaveform*> ProcessDigitalWaveform(const char* data,
326 size_t datalen,
327 char* wavedesc,
330 double basetime,
331 double* wavetime,
332 int i);
333
334 //hardware analog channel count, independent of LA option etc
335 unsigned int m_analogChannelCount;
336 unsigned int m_digitalChannelCount;
337 unsigned int m_analogAndDigitalChannelCount;
338 size_t m_digitalChannelBase;
339
340 Model m_modelid;
341 Protocol m_protocolId;
342
343 // Firmware version
344 int m_ubootMajorVersion;
345 int m_ubootMinorVersion;
346 int m_ubootPatchVersion;
347 int m_fwMajorVersion;
348 int m_fwMinorVersion;
349 int m_fwPatchVersion;
350 int m_fwPatchRevision;
351
352 //set of SW/HW options we have
353 bool m_hasLA;
354 bool m_hasDVM;
355 bool m_hasFunctionGen;
356 bool m_hasFastSampleRate; //-M models
357 int m_memoryDepthOption; //0 = base, after that number is max sample count in millions
358 bool m_hasI2cTrigger;
359 bool m_hasSpiTrigger;
360 bool m_hasUartTrigger;
361
362 //SDS2000XP firmware <=1.3.6R6 has data size bug while in 10 bit mode
363 bool m_requireSizeWorkaround;
364
366 unsigned int m_maxBandwidth;
367
368 bool m_triggerForced;
369
370 // Pagination state
371 bool m_paginated;
372
373 //Cached configuration
374 std::map<size_t, float> m_channelVoltageRanges;
375 std::map<size_t, float> m_channelOffsets;
376 std::map<size_t, float> m_channelDigitalThresholds;
377 std::map<int, bool> m_channelsEnabled;
378 bool m_sampleRateValid;
379 int64_t m_sampleRate;
380 bool m_memoryDepthValid;
381 int64_t m_memoryDepth;
382 bool m_triggerOffsetValid;
383 int64_t m_triggerOffset;
384 bool m_maxPointsValid;
385 uint64_t m_maxPoints;
386 bool m_acqPointsValid;
387 uint64_t m_acqPoints;
388 bool m_digitalAcqPointsValid;
389 uint64_t m_digitalAcqPoints;
390 std::map<size_t, int64_t> m_channelDeskew;
391 Multimeter::MeasurementTypes m_meterMode;
392 bool m_meterModeValid;
393 std::map<size_t, bool> m_probeIsActive;
394 std::map<size_t, bool> m_awgEnabled;
395 std::map<size_t, float> m_awgDutyCycle;
396 std::map<size_t, float> m_awgRange;
397 std::map<size_t, float> m_awgOffset;
398 std::map<size_t, float> m_awgFrequency;
399 std::map<size_t, FunctionGenerator::WaveShape> m_awgShape;
400 std::map<size_t, FunctionGenerator::OutputImpedance> m_awgImpedance;
401 ADCMode m_adcMode;
402 bool m_adcModeValid;
403
404 std::map<std::string, std::string> ParseCommaSeparatedNameValueList(std::string str, bool forwardMap = true);
405
406 int64_t m_timeDiv;
407
408 //True if we have >8 bit capture depth
409 bool m_highDefinition;
410
411 //Other channels
412 OscilloscopeChannel* m_extTrigChannel;
413 FunctionGeneratorChannel* m_awgChannel;
414 std::vector<OscilloscopeChannel*> m_digitalChannels;
415
417 std::map<int, AcceleratorBuffer<uint8_t> > m_rawWaveformBuffers;
418
420 std::unique_ptr<ComputePipeline> m_conversion8BitPipeline;
421
423 std::unique_ptr<ComputePipeline> m_conversion16BitPipeline;
424
425public:
426 static std::string GetDriverNameInternal();
427
428 //This is intentionally not virtual since it's a static method used by enumeration
429 //cppcheck-suppress duplInheritedMember
430 static std::vector<SCPIInstrumentModel> GetDriverSupportedModels()
431 {
432 return {
433 {"SDS800X HD", {
434 { SCPITransportType::TRANSPORT_LAN, "<ip_address>:5025" },
435 { SCPITransportType::TRANSPORT_USBTMC, "/dev/usbtmc<x>" },
436 }},
437 {"SDS1000X HD", {
438 { SCPITransportType::TRANSPORT_LAN, "<ip_address>:5025" },
439 { SCPITransportType::TRANSPORT_USBTMC, "/dev/usbtmc<x>" },
440 }},
441 {"SDS2000X HD", {
442 { SCPITransportType::TRANSPORT_LAN, "<ip_address>:5025" },
443 { SCPITransportType::TRANSPORT_USBTMC, "/dev/usbtmc<x>" },
444 }},
445 {"SDS3000X HD", {
446 { SCPITransportType::TRANSPORT_LAN, "<ip_address>:5025" },
447 { SCPITransportType::TRANSPORT_USBTMC, "/dev/usbtmc<x>" },
448 }},
449 {"SDS2000X+", {
450 { SCPITransportType::TRANSPORT_LAN, "<ip_address>:5025" },
451 { SCPITransportType::TRANSPORT_USBTMC, "/dev/usbtmc<x>" },
452 }},
453 {"SDS1000X-E", {
454 { SCPITransportType::TRANSPORT_LAN, "<ip_address>:5025" },
455 { SCPITransportType::TRANSPORT_USBTMC, "/dev/usbtmc<x>" },
456 }},
457 {"SDS2000X-E", {
458 { SCPITransportType::TRANSPORT_LAN, "<ip_address>:5025" },
459 { SCPITransportType::TRANSPORT_USBTMC, "/dev/usbtmc<x>" },
460 }},
461 {"SDS5000X", {
462 { SCPITransportType::TRANSPORT_LAN, "<ip_address>:5025" },
463 { SCPITransportType::TRANSPORT_USBTMC, "/dev/usbtmc<x>" },
464 }},
465 {"SDS6000A/L/Pro", {
466 { SCPITransportType::TRANSPORT_LAN, "<ip_address>:5025" },
467 { SCPITransportType::TRANSPORT_USBTMC, "/dev/usbtmc<x>" },
468 }},
469 {"SDS7000A", {
470 { SCPITransportType::TRANSPORT_LAN, "<ip_address>:5025" },
471 { SCPITransportType::TRANSPORT_USBTMC, "/dev/usbtmc<x>" },
472 }},
473 };
474 }
475 OSCILLOSCOPE_INITPROC(SiglentSCPIOscilloscope)
476};
477#endif
Definition AcceleratorBuffer.h:204
Trigger when a signal stops toggling for some amount of time.
Definition DropoutTrigger.h:44
Simple edge trigger.
Definition EdgeTrigger.h:44
A single channel of a function generator.
Definition FunctionGeneratorChannel.h:45
WaveShape
Predefined waveform shapes.
Definition FunctionGenerator.h:55
OutputImpedance
Nominal output impedance for a function generator channel.
Definition FunctionGenerator.h:259
Trigger on a glitch meeting certain width criteria.
Definition GlitchTrigger.h:46
A single channel on an oscilloscope.
Definition OscilloscopeChannel.h:49
TriggerMode
Definition Oscilloscope.h:398
Trigger on a pulse meeting certain width criteria.
Definition PulseWidthTrigger.h:44
Runt trigger - trigger when a pulse of a given width crosses one threshold but not the second.
Definition RuntTrigger.h:46
An SCPI-based function generator.
Definition SCPIFunctionGenerator.h:38
An SCPI-based oscilloscope.
Definition SCPIOscilloscope.h:38
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition SCPITransport.h:53
Definition SiglentSCPIOscilloscope.h:63
virtual int64_t GetTriggerOffset() override
Gets the trigger offset.
Definition SiglentSCPIOscilloscope.cpp:3703
virtual OutputImpedance GetFunctionChannelOutputImpedance(int chan) override
Gets the currently selected output impedance for a function generator output (if supported)
Definition SiglentSCPIOscilloscope.cpp:5844
void PullSlewRateTrigger()
Reads settings for a slew rate trigger from the instrument.
Definition SiglentSCPIOscilloscope.cpp:4447
virtual void SetFunctionChannelOffset(int chan, float offset) override
Sets the DC offset for a function generator output.
Definition SiglentSCPIOscilloscope.cpp:5367
virtual void SetDigitalThreshold(size_t channel, float level) override
Gets the threshold for a digital input.
Definition SiglentSCPIOscilloscope.cpp:4099
virtual unsigned int GetInstrumentTypes() const override
See what features we have.
Definition SiglentSCPIOscilloscope.cpp:756
virtual bool SetInterleaving(bool combine) override
Configures the scope to combine channels.
Definition SiglentSCPIOscilloscope.cpp:3886
void PushWindowTrigger(WindowTrigger *trig)
Pushes settings for a window trigger to the instrument.
Definition SiglentSCPIOscilloscope.cpp:5094
virtual void SetChannelVoltageRange(size_t i, size_t stream, float range) override
Sets the range of the current channel configuration.
Definition SiglentSCPIOscilloscope.cpp:2813
virtual DigitalBank GetDigitalBank(size_t channel) override
Gets the bank containing a given channel.
Definition SiglentSCPIOscilloscope.cpp:4018
virtual std::vector< uint64_t > GetSampleDepthsNonInterleaved() override
Get the legal memory depths for this scope in all-channels mode.
Definition SiglentSCPIOscilloscope.cpp:2916
virtual void PullTrigger() override
Updates m_trigger with any changes made from the instrument side.
Definition SiglentSCPIOscilloscope.cpp:4124
virtual void SetFunctionChannelShape(int chan, WaveShape shape) override
Sets the waveform shape for a function generator output.
Definition SiglentSCPIOscilloscope.cpp:5601
virtual void SetSampleDepth(uint64_t depth) override
Sets the sample depth of the scope.
Definition SiglentSCPIOscilloscope.cpp:3180
void PushEdgeTrigger(EdgeTrigger *trig, const std::string &trigType)
Pushes settings for an edge trigger to the instrument.
Definition SiglentSCPIOscilloscope.cpp:4841
virtual void SetFunctionChannelOutputImpedance(int chan, OutputImpedance z) override
Sets the currently selected output impedance for a function generator output (if supported)
Definition SiglentSCPIOscilloscope.cpp:5859
void GetTriggerSlope(EdgeTrigger *trig, std::string reply)
Processes the slope for an edge or edge-derived trigger.
Definition SiglentSCPIOscilloscope.cpp:4641
void PushDropoutTrigger(DropoutTrigger *trig)
Pushes settings for a dropout trigger to the instrument.
Definition SiglentSCPIOscilloscope.cpp:4813
virtual int64_t GetDeskewForChannel(size_t channel) override
Gets the deskew setting for a channel.
Definition SiglentSCPIOscilloscope.cpp:3783
virtual unsigned int GetMeasurementTypes()
See what measurement capabilities we have.
Definition SiglentSCPIOscilloscope.cpp:747
virtual bool IsDigitalThresholdConfigurable() override
Checks if digital input threshold is configurable or fixed.
Definition SiglentSCPIOscilloscope.cpp:4042
virtual void SetChannelDisplayName(size_t i, std::string name) override
Sets the hardware display name for a channel. This is an arbitrary user-selected string.
Definition SiglentSCPIOscilloscope.cpp:1459
virtual void SetChannelBandwidthLimit(size_t i, unsigned int limit_mhz) override
Sets the bandwidth limit for an input channel.
Definition SiglentSCPIOscilloscope.cpp:1352
void PushRuntTrigger(RuntTrigger *trig)
Pushes settings for a runt trigger to the instrument.
Definition SiglentSCPIOscilloscope.cpp:4944
virtual bool CanInvert(size_t i) override
Checks if a channel is capable of hardware polarity inversion.
Definition SiglentSCPIOscilloscope.cpp:1401
virtual void Stop() override
Stops triggering.
Definition SiglentSCPIOscilloscope.cpp:2628
virtual void SetFunctionChannelActive(int chan, bool on) override
Turns a function generator channel on or off.
Definition SiglentSCPIOscilloscope.cpp:5285
virtual std::vector< WaveShape > GetAvailableWaveformShapes(int chan) override
Query the set of available pre-defined waveforms for this generator.
Definition SiglentSCPIOscilloscope.cpp:5190
virtual float GetDigitalThreshold(size_t channel) override
Gets the threshold for a digital input.
Definition SiglentSCPIOscilloscope.cpp:4053
virtual void SetChannelOffset(size_t i, size_t stream, float offset) override
Sets the offset for a given channel.
Definition SiglentSCPIOscilloscope.cpp:2738
virtual float GetFunctionChannelDutyCycle(int chan) override
Gets the duty cycle for a function generator output.
Definition SiglentSCPIOscilloscope.cpp:5306
virtual bool IsADCModeConfigurable() override
Returns true if the ADC is configurable, false if it can only run in one mode.
Definition SiglentSCPIOscilloscope.cpp:3899
virtual std::string GetChannelDisplayName(size_t i) override
Gets the hardware display name for a channel. This is an arbitrary user-selected string.
Definition SiglentSCPIOscilloscope.cpp:1497
void PullDropoutTrigger()
Reads settings for a dropout trigger from the instrument.
Definition SiglentSCPIOscilloscope.cpp:4225
virtual void DetectAnalogChannels()
Figures out how many analog channels we have, and add them to the device.
Definition SiglentSCPIOscilloscope.cpp:625
virtual void ForceTrigger() override
Forces a single acquisition as soon as possible.
Definition SiglentSCPIOscilloscope.cpp:2658
virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override
Returns a bitfield describing the set of instrument types that a given channel supports.
Definition SiglentSCPIOscilloscope.cpp:764
virtual Oscilloscope::TriggerMode PollTrigger() override
Checks the curent trigger status.
Definition SiglentSCPIOscilloscope.cpp:1559
virtual void SetADCMode(size_t channel, size_t mode) override
Sets the ADC mode for a channel.
Definition SiglentSCPIOscilloscope.cpp:3945
virtual void EnableTriggerOutput() override
Enables the trigger output, configuring a shared auxiliary port for this purpose if needed.
Definition SiglentSCPIOscilloscope.cpp:3637
void PushCondition(const std::string &path, Trigger::Condition cond)
Pushes settings for a trigger condition under a .Condition field.
Definition SiglentSCPIOscilloscope.cpp:5119
std::map< std::string, std::string > ParseCommaSeparatedNameValueList(std::string str, bool forwardMap=true)
Parses a name-value set expressed as pairs of comma separated values.
Definition SiglentSCPIOscilloscope.cpp:5405
virtual void PushTrigger() override
Pushes changes made to m_trigger to the instrument.
Definition SiglentSCPIOscilloscope.cpp:4700
virtual float GetChannelOffset(size_t i, size_t stream) override
Gets the offset, in volts, for a given channel.
Definition SiglentSCPIOscilloscope.cpp:2693
void PushSlewRateTrigger(SlewRateTrigger *trig)
Pushes settings for a slew rate trigger to the instrument.
Definition SiglentSCPIOscilloscope.cpp:4975
virtual uint64_t GetSampleRate() override
Gets the current sampling rate (in Hz) of this scope.
Definition SiglentSCPIOscilloscope.cpp:3020
virtual std::vector< uint64_t > GetSampleRatesInterleaved() override
Get the legal sampling rates (in Hz) for this scope in combined-channels mode.
Definition SiglentSCPIOscilloscope.cpp:2904
virtual void Invert(size_t i, bool invert) override
Enables hardware polarity inversion for a channel, if supported.
Definition SiglentSCPIOscilloscope.cpp:1407
void PullTriggerSource(Trigger *trig, const std::string &triggerModeName, bool isUart)
Reads the source of a trigger from the instrument.
Definition SiglentSCPIOscilloscope.cpp:4213
virtual float GetFunctionChannelFrequency(int chan) override
Gets the frequency for a function generator output.
Definition SiglentSCPIOscilloscope.cpp:5375
virtual std::vector< uint64_t > GetSampleDepthsInterleaved() override
Get the legal memory depths for this scope in combined-channels mode.
Definition SiglentSCPIOscilloscope.cpp:2995
virtual void Start() override
Starts the instrument in continuous trigger mode.
Definition SiglentSCPIOscilloscope.cpp:2568
virtual double GetChannelAttenuation(size_t i) override
Gets the probe attenuation for an input channel.
Definition SiglentSCPIOscilloscope.cpp:1184
virtual void EnableChannel(size_t i) override
Turn a channel on, given the index.
Definition SiglentSCPIOscilloscope.cpp:839
virtual void SetFunctionChannelDutyCycle(int chan, float duty) override
Sets the duty cycle for a function generator output.
Definition SiglentSCPIOscilloscope.cpp:5321
virtual float GetFunctionChannelAmplitude(int chan) override
Gets the amplitude for a function generator output.
Definition SiglentSCPIOscilloscope.cpp:5329
virtual bool IsChannelEnabled(size_t i) override
Checks if a channel is enabled in hardware.
Definition SiglentSCPIOscilloscope.cpp:776
virtual void StartSingleTrigger() override
Arms the trigger for a single acquistion.
Definition SiglentSCPIOscilloscope.cpp:2597
virtual unsigned int GetChannelBandwidthLimit(size_t i) override
Gets the bandwidth limit for an input channel.
Definition SiglentSCPIOscilloscope.cpp:1313
void PullWindowTrigger()
Reads settings for a window trigger from the instrument.
Definition SiglentSCPIOscilloscope.cpp:4598
virtual size_t GetADCMode(size_t channel) override
Gets the ADC mode for a channel.
Definition SiglentSCPIOscilloscope.cpp:3913
Trigger::Condition GetCondition(std::string reply)
Parses a trigger condition.
Definition SiglentSCPIOscilloscope.cpp:4682
void PullRuntTrigger()
Reads settings for a runt-pulse trigger from the instrument.
Definition SiglentSCPIOscilloscope.cpp:4386
virtual void SetUseExternalRefclk(bool external) override
Configures the instrument's clock source.
Definition SiglentSCPIOscilloscope.cpp:3642
virtual bool CanEnableChannel(size_t i) override
Determines if a channel can be enabled.
Definition SiglentSCPIOscilloscope.cpp:887
virtual void DisableChannel(size_t i) override
Turn a channel off, given the index.
Definition SiglentSCPIOscilloscope.cpp:893
virtual void SetFunctionChannelAmplitude(int chan, float amplitude) override
Sets the amplitude for a function generator output.
Definition SiglentSCPIOscilloscope.cpp:5344
virtual bool AcquireData() override
Pull data from the instrument.
Definition SiglentSCPIOscilloscope.cpp:2058
virtual float GetFunctionChannelOffset(int chan) override
Gets the DC offset for a function generator output.
Definition SiglentSCPIOscilloscope.cpp:5352
std::map< int, AcceleratorBuffer< uint8_t > > m_rawWaveformBuffers
Buffers for raw waveform data before conversion to float32.
Definition SiglentSCPIOscilloscope.h:417
virtual std::vector< std::string > GetTriggerTypes() override
Gets a list of triggers this instrument supports.
Definition SiglentSCPIOscilloscope.cpp:5150
virtual std::vector< OscilloscopeChannel::CouplingType > GetAvailableCouplings(size_t i) override
Gets the set of legal coupling values for an input channel.
Definition SiglentSCPIOscilloscope.cpp:1002
virtual bool IsTriggerArmed() override
Checks if the trigger is currently armed.
Definition SiglentSCPIOscilloscope.cpp:1554
virtual std::vector< DigitalBank > GetDigitalBanks() override
Gets the digital channel banks for this instrument.
Definition SiglentSCPIOscilloscope.cpp:3998
virtual std::vector< uint64_t > GetSampleRatesNonInterleaved() override
Get the legal sampling rates (in Hz) for this scope in all-channels mode.
Definition SiglentSCPIOscilloscope.cpp:2841
virtual float GetDigitalHysteresis(size_t channel) override
Gets the hysteresis for a digital input.
Definition SiglentSCPIOscilloscope.cpp:4047
void PullEdgeTrigger()
Reads settings for an edge trigger from the instrument.
Definition SiglentSCPIOscilloscope.cpp:4279
std::unique_ptr< ComputePipeline > m_conversion16BitPipeline
Compute pipeline for converting raw ADC codes to float32 samples.
Definition SiglentSCPIOscilloscope.h:423
virtual bool IsInverted(size_t i) override
Checks if hardware polarity inversion is enabled for a channel.
Definition SiglentSCPIOscilloscope.cpp:1431
virtual bool IsInterleaving() override
Checks if the scope is currently combining channels.
Definition SiglentSCPIOscilloscope.cpp:3832
void BulkCheckChannelEnableState()
Optimized function for checking channel enable status en masse with less round trips to the scope.
Definition SiglentSCPIOscilloscope.cpp:1683
virtual bool HasFunctionRiseFallTimeControls(int chan) override
Determines if the function generator allows control over rise/fall times.
Definition SiglentSCPIOscilloscope.cpp:5839
unsigned int m_maxBandwidth
Maximum bandwidth we support, in MHz.
Definition SiglentSCPIOscilloscope.h:366
virtual bool GetFunctionChannelActive(int chan) override
Returns true if the function generator channel's output is enabled.
Definition SiglentSCPIOscilloscope.cpp:5255
virtual void SetSampleRate(uint64_t rate) override
Sets the sample rate of the scope, in Hz.
Definition SiglentSCPIOscilloscope.cpp:3544
std::unique_ptr< ComputePipeline > m_conversion8BitPipeline
Compute pipeline for converting raw ADC codes to float32 samples.
Definition SiglentSCPIOscilloscope.h:420
void ForceHDMode(bool mode)
Forces 16-bit transfer mode on/off when for HD models.
Definition SiglentSCPIOscilloscope.cpp:5883
virtual bool IsDigitalHysteresisConfigurable() override
Checks if digital input hysteresis is configurable or fixed.
Definition SiglentSCPIOscilloscope.cpp:4037
void PullPulseWidthTrigger()
Reads settings for an edge trigger from the instrument.
Definition SiglentSCPIOscilloscope.cpp:4329
virtual WaveShape GetFunctionChannelShape(int chan) override
Gets the waveform shape for a function generator output.
Definition SiglentSCPIOscilloscope.cpp:5448
virtual std::vector< std::string > GetADCModeNames(size_t channel) override
Gets the names of the ADC modes for the bank a given channel is located in.
Definition SiglentSCPIOscilloscope.cpp:3904
virtual float GetChannelVoltageRange(size_t i, size_t stream) override
Gets the range of the current channel configuration.
Definition SiglentSCPIOscilloscope.cpp:2768
virtual void SetFunctionChannelFrequency(int chan, float hz) override
Sets the frequency for a function generator output.
Definition SiglentSCPIOscilloscope.cpp:5390
virtual void SetChannelAttenuation(size_t i, double atten) override
Sets the probe attenuation used for an input channel.
Definition SiglentSCPIOscilloscope.cpp:1221
virtual void SetTriggerOffset(int64_t offset) override
Sets the trigger offset.
Definition SiglentSCPIOscilloscope.cpp:3671
virtual void SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type) override
Sets the coupling used for an input channel.
Definition SiglentSCPIOscilloscope.cpp:1102
virtual uint64_t GetSampleDepth() override
Gets the current sample depth of this scope.
Definition SiglentSCPIOscilloscope.cpp:3146
void AddDigitalChannels(unsigned int count)
Creates digital channels for the oscilloscope.
Definition SiglentSCPIOscilloscope.cpp:598
virtual OscilloscopeChannel::CouplingType GetChannelCoupling(size_t i) override
Gets the coupling used for an input channel.
Definition SiglentSCPIOscilloscope.cpp:1049
virtual void FlushConfigCache() override
Instruments are allowed to cache configuration settings to reduce round trip queries to the device.
Definition SiglentSCPIOscilloscope.cpp:706
void PushUartTrigger(UartTrigger *trig)
Pushes settings for a UART trigger to the instrument.
Definition SiglentSCPIOscilloscope.cpp:4992
virtual OscilloscopeChannel * GetExternalTrigger() override
Returns the external trigger input channel, if we have one.
Definition SiglentSCPIOscilloscope.cpp:701
void PushPulseWidthTrigger(PulseWidthTrigger *trig)
Pushes settings for a pulse width trigger to the instrument.
Definition SiglentSCPIOscilloscope.cpp:4916
virtual std::vector< unsigned int > GetChannelBandwidthLimiters(size_t i) override
Gets the set of available bandwidth limiters for an input channel.
Definition SiglentSCPIOscilloscope.cpp:1267
virtual void SetDigitalHysteresis(size_t channel, float level) override
Sets the hysteresis for a digital input.
Definition SiglentSCPIOscilloscope.cpp:4094
virtual void SetDeskewForChannel(size_t channel, int64_t skew) override
Sets the deskew setting for a channel.
Definition SiglentSCPIOscilloscope.cpp:3754
void PullUartTrigger()
Reads settings for a UART trigger from the instrument.
Definition SiglentSCPIOscilloscope.cpp:4510
Slew rate trigger - trigger when an edge rate meets the specified conditions.
Definition SlewRateTrigger.h:46
Abstract base class for oscilloscope / logic analyzer trigger inputs.
Definition Trigger.h:46
Condition
Conditions for triggers that perform logical comparisons of values.
Definition Trigger.h:85
Trigger when a UART sees a certain data pattern.
Definition UartTrigger.h:56
Window trigger - detect when the signal leaves a specified range.
Definition WindowTrigger.h:46