ngscopeclient 0.1-dev+51fbda87c
SiglentVectorSignalGenerator.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopehal *
4* *
5* Copyright (c) 2012-2024 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
37#ifndef SiglentVectorSignalGenerator_h
38#define SiglentVectorSignalGenerator_h
39
48 : public virtual SCPIRFSignalGenerator
49 , public virtual SCPIFunctionGenerator
50{
51public:
54
55 //Instrument
56 virtual unsigned int GetInstrumentTypes() const override;
57 virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override;
58
59 virtual bool AcquireData() override;
60
61 //RF signal generator base stuff
62 virtual bool GetChannelOutputEnable(int chan) override;
63 virtual void SetChannelOutputEnable(int chan, bool on) override;
64 virtual float GetChannelOutputPower(int chan) override;
65 virtual void SetChannelOutputPower(int chan, float power) override;
66 virtual double GetChannelCenterFrequency(int chan) override;
67 virtual void SetChannelCenterFrequency(int chan, double freq) override;
68
69 //Analog modulation
70 virtual bool IsAnalogModulationAvailable(int chan) override;
71 virtual bool GetAnalogModulationEnable(int chan) override;
72 virtual void SetAnalogModulationEnable(int chan, bool on) override;
73 virtual void SetAnalogFMEnable(int chan, bool on) override;
74 virtual bool GetAnalogFMEnable(int chan) override;
75 virtual std::vector<FunctionGenerator::WaveShape> GetAnalogFMWaveShapes() override;
76 virtual FunctionGenerator::WaveShape GetAnalogFMWaveShape(int chan) override;
77 virtual void SetAnalogFMWaveShape(int chan, FunctionGenerator::WaveShape shape) override;
78 virtual void SetAnalogFMDeviation(int chan, int64_t deviation) override;
79 virtual int64_t GetAnalogFMDeviation(int chan) override;
80 virtual void SetAnalogFMFrequency(int chan, int64_t frequency) override;
81 virtual int64_t GetAnalogFMFrequency(int chan) override;
82
83 //Vector modulation
84 virtual bool IsVectorModulationAvailable(int chan) override;
85
86 //Sweep
87 virtual bool IsSweepAvailable(int chan) override;
88 virtual float GetSweepStartFrequency(int chan) override;
89 virtual float GetSweepStopFrequency(int chan) override;
90 virtual void SetSweepStartFrequency(int chan, float freq) override;
91 virtual void SetSweepStopFrequency(int chan, float freq) override;
92 virtual float GetSweepStartLevel(int chan) override;
93 virtual float GetSweepStopLevel(int chan) override;
94 virtual void SetSweepStartLevel(int chan, float level) override;
95 virtual void SetSweepStopLevel(int chan, float level) override;
96 virtual void SetSweepDwellTime(int chan, float fs) override;
97 virtual float GetSweepDwellTime(int chan) override;
98 virtual void SetSweepPoints(int chan, int npoints) override;
99 virtual int GetSweepPoints(int chan) override;
100 virtual SweepShape GetSweepShape(int chan) override;
101 virtual void SetSweepShape(int chan, SweepShape shape) override;
102 virtual SweepSpacing GetSweepSpacing(int chan) override;
103 virtual void SetSweepSpacing(int chan, SweepSpacing shape) override;
104 virtual SweepDirection GetSweepDirection(int chan) override;
105 virtual void SetSweepDirection(int chan, SweepDirection dir) override;
106 virtual SweepType GetSweepType(int chan) override;
107 virtual void SetSweepType(int chan, SweepType type) override;
108
109 //Function generator
110 virtual std::vector<WaveShape> GetAvailableWaveformShapes(int chan) override;
111 virtual bool GetFunctionChannelActive(int chan) override;
112 virtual void SetFunctionChannelActive(int chan, bool on) override;
113 virtual bool HasFunctionDutyCycleControls(int chan) override;
114 virtual float GetFunctionChannelAmplitude(int chan) override;
115 virtual void SetFunctionChannelAmplitude(int chan, float amplitude) override;
116 virtual float GetFunctionChannelOffset(int chan) override;
117 virtual void SetFunctionChannelOffset(int chan, float offset) override;
118 virtual float GetFunctionChannelFrequency(int chan) override;
119 virtual void SetFunctionChannelFrequency(int chan, float hz) override;
120 virtual WaveShape GetFunctionChannelShape(int chan) override;
121 virtual void SetFunctionChannelShape(int chan, WaveShape shape) override;
122 virtual bool HasFunctionRiseFallTimeControls(int chan) override;
123 virtual bool HasFunctionImpedanceControls(int chan) override;
124
125public:
126 static std::string GetDriverNameInternal();
127 VSG_INITPROC(SiglentVectorSignalGenerator)
128
129protected:
130 enum ChannelIDs
131 {
132 CHANNEL_RFOUT = 0,
133 CHANNEL_LFO = 1
134 };
135
136 int m_firmwareRev[5];
137};
138
139#endif
WaveShape
Predefined waveform shapes.
Definition: FunctionGenerator.h:55
An SCPI-based function generator.
Definition: SCPIFunctionGenerator.h:38
An SCPI-based RF signal generator.
Definition: SCPIRFSignalGenerator.h:38
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47
Siglent vector signal generators.
Definition: SiglentVectorSignalGenerator.h:50
virtual float GetFunctionChannelOffset(int chan) override
Gets the DC offset for a function generator output.
Definition: SiglentVectorSignalGenerator.cpp:401
virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override
Returns a bitfield describing the set of instrument types that a given channel supports.
Definition: SiglentVectorSignalGenerator.cpp:88
virtual bool AcquireData() override
Pull data from the instrument.
Definition: SiglentVectorSignalGenerator.cpp:101
virtual float GetFunctionChannelAmplitude(int chan) override
Gets the amplitude for a function generator output.
Definition: SiglentVectorSignalGenerator.cpp:391
virtual bool GetChannelOutputEnable(int chan) override
Check if a channel is currently enabled.
Definition: SiglentVectorSignalGenerator.cpp:114
virtual int64_t GetAnalogFMDeviation(int chan) override
Gets the analog FM deviation for a channel.
Definition: SiglentVectorSignalGenerator.cpp:545
virtual void SetAnalogFMFrequency(int chan, int64_t frequency) override
Sets the analog FM frequency for a channel (in Hz)
Definition: SiglentVectorSignalGenerator.cpp:551
virtual SweepDirection GetSweepDirection(int chan) override
Gets the direction of a sweep.
Definition: SiglentVectorSignalGenerator.cpp:295
virtual void SetFunctionChannelFrequency(int chan, float hz) override
Sets the frequency for a function generator output.
Definition: SiglentVectorSignalGenerator.cpp:416
virtual float GetSweepDwellTime(int chan) override
Gets the dwell time for each step in a sweep, in femtoseconds.
Definition: SiglentVectorSignalGenerator.cpp:226
virtual void SetSweepStopLevel(int chan, float level) override
Sets the stop of a power sweep.
Definition: SiglentVectorSignalGenerator.cpp:216
virtual void SetChannelOutputPower(int chan, float power) override
Sets the power level of a channel.
Definition: SiglentVectorSignalGenerator.cpp:138
virtual void SetSweepDwellTime(int chan, float fs) override
Sets the dwell time for each step in a sweep.
Definition: SiglentVectorSignalGenerator.cpp:221
virtual float GetSweepStartFrequency(int chan) override
Gets the start of a frequency sweep, in Hz.
Definition: SiglentVectorSignalGenerator.cpp:181
virtual void SetSweepPoints(int chan, int npoints) override
Sets the number of frequency points in a sweep.
Definition: SiglentVectorSignalGenerator.cpp:231
virtual bool HasFunctionRiseFallTimeControls(int chan) override
Determines if the function generator allows control over rise/fall times.
Definition: SiglentVectorSignalGenerator.cpp:466
virtual void SetSweepStopFrequency(int chan, float freq) override
Sets the stop of a frequency sweep.
Definition: SiglentVectorSignalGenerator.cpp:196
virtual bool HasFunctionDutyCycleControls(int chan) override
Determines if the function generator allows control over duty cycles.
Definition: SiglentVectorSignalGenerator.cpp:386
virtual SweepSpacing GetSweepSpacing(int chan) override
Gets the spacing of a sweep (log or linear)
Definition: SiglentVectorSignalGenerator.cpp:269
virtual float GetSweepStartLevel(int chan) override
Gets the start of a power sweep, in dBm.
Definition: SiglentVectorSignalGenerator.cpp:201
virtual SweepType GetSweepType(int chan) override
Gets the type of a sweep.
Definition: SiglentVectorSignalGenerator.cpp:321
virtual void SetSweepStartLevel(int chan, float level) override
Sets the start of a power sweep.
Definition: SiglentVectorSignalGenerator.cpp:211
virtual int GetSweepPoints(int chan) override
Gets the number of frequency points in a sweep.
Definition: SiglentVectorSignalGenerator.cpp:236
virtual void SetAnalogModulationEnable(int chan, bool on) override
Enable or disable analog modulation.
Definition: SiglentVectorSignalGenerator.cpp:493
virtual SweepShape GetSweepShape(int chan) override
Gets the shape of a sweep.
Definition: SiglentVectorSignalGenerator.cpp:241
virtual void SetAnalogFMDeviation(int chan, int64_t deviation) override
Sets the analog FM deviation for a channel (in Hz)
Definition: SiglentVectorSignalGenerator.cpp:540
virtual void SetFunctionChannelAmplitude(int chan, float amplitude) override
Sets the amplitude for a function generator output.
Definition: SiglentVectorSignalGenerator.cpp:396
virtual float GetChannelOutputPower(int chan) override
Gets the power level of a channel.
Definition: SiglentVectorSignalGenerator.cpp:127
virtual bool GetFunctionChannelActive(int chan) override
Returns true if the function generator channel's output is enabled.
Definition: SiglentVectorSignalGenerator.cpp:373
virtual double GetChannelCenterFrequency(int chan) override
Gets the center frequency of a channel.
Definition: SiglentVectorSignalGenerator.cpp:146
virtual bool GetAnalogModulationEnable(int chan) override
Enable or disable analog modulation.
Definition: SiglentVectorSignalGenerator.cpp:487
virtual float GetFunctionChannelFrequency(int chan) override
Gets the frequency for a function generator output.
Definition: SiglentVectorSignalGenerator.cpp:411
virtual float GetSweepStopFrequency(int chan) override
Gets the end of a frequency sweep, in Hz.
Definition: SiglentVectorSignalGenerator.cpp:186
virtual void SetSweepType(int chan, SweepType type) override
Sets the type of a sweep.
Definition: SiglentVectorSignalGenerator.cpp:334
virtual void SetFunctionChannelOffset(int chan, float offset) override
Sets the DC offset for a function generator output.
Definition: SiglentVectorSignalGenerator.cpp:406
virtual bool IsAnalogModulationAvailable(int chan) override
Checks if an instrument is analog modulation capable.
Definition: SiglentVectorSignalGenerator.cpp:482
virtual void SetFunctionChannelShape(int chan, WaveShape shape) override
Sets the waveform shape for a function generator output.
Definition: SiglentVectorSignalGenerator.cpp:437
virtual WaveShape GetFunctionChannelShape(int chan) override
Gets the waveform shape for a function generator output.
Definition: SiglentVectorSignalGenerator.cpp:421
virtual void SetAnalogFMWaveShape(int chan, FunctionGenerator::WaveShape shape) override
Sets the analog FM modulation shape for a channel.
Definition: SiglentVectorSignalGenerator.cpp:532
virtual bool HasFunctionImpedanceControls(int chan) override
Determines if the function generator allows control over rise/fall times.
Definition: SiglentVectorSignalGenerator.cpp:471
virtual void SetAnalogFMEnable(int chan, bool on) override
Enable or disable analog frequency modulation (also requires modulation to be turned on)
Definition: SiglentVectorSignalGenerator.cpp:501
virtual unsigned int GetInstrumentTypes() const override
Returns a bitfield describing the set of instrument types that this instrument supports.
Definition: SiglentVectorSignalGenerator.cpp:83
virtual void SetSweepSpacing(int chan, SweepSpacing shape) override
Sets the spacing of a sweep (log or linear)
Definition: SiglentVectorSignalGenerator.cpp:278
virtual bool IsSweepAvailable(int chan) override
Checks if an instrument supports sweeping the center frequency.
Definition: SiglentVectorSignalGenerator.cpp:176
virtual float GetSweepStopLevel(int chan) override
Gets the end of a power sweep, in dBm.
Definition: SiglentVectorSignalGenerator.cpp:206
virtual void SetChannelCenterFrequency(int chan, double freq) override
Sets the power level of a channel.
Definition: SiglentVectorSignalGenerator.cpp:157
virtual FunctionGenerator::WaveShape GetAnalogFMWaveShape(int chan) override
Get the current waveform selected for analog FM.
Definition: SiglentVectorSignalGenerator.cpp:523
virtual int64_t GetAnalogFMFrequency(int chan) override
Gets the analog FM frequency for a channel.
Definition: SiglentVectorSignalGenerator.cpp:556
virtual bool GetAnalogFMEnable(int chan) override
Enable or disable analog frequency modulation.
Definition: SiglentVectorSignalGenerator.cpp:509
virtual std::vector< WaveShape > GetAvailableWaveformShapes(int chan) override
Query the set of available pre-defined waveforms for this generator.
Definition: SiglentVectorSignalGenerator.cpp:362
virtual std::vector< FunctionGenerator::WaveShape > GetAnalogFMWaveShapes() override
Get the set of waveforms available for analog FM.
Definition: SiglentVectorSignalGenerator.cpp:515
virtual void SetFunctionChannelActive(int chan, bool on) override
Turns a function generator channel on or off.
Definition: SiglentVectorSignalGenerator.cpp:378
virtual void SetSweepStartFrequency(int chan, float freq) override
Sets the start of a frequency sweep.
Definition: SiglentVectorSignalGenerator.cpp:191
virtual void SetSweepShape(int chan, SweepShape shape) override
Sets the shape of a sweep.
Definition: SiglentVectorSignalGenerator.cpp:250
virtual bool IsVectorModulationAvailable(int chan) override
Checks if an instrument is vector modulation capable.
Definition: SiglentVectorSignalGenerator.cpp:165
virtual void SetChannelOutputEnable(int chan, bool on) override
Enable or disable a channel output.
Definition: SiglentVectorSignalGenerator.cpp:119
virtual void SetSweepDirection(int chan, SweepDirection dir) override
Sets the direction of a sweep.
Definition: SiglentVectorSignalGenerator.cpp:304