Instrument Control Lib
Framework to control Oscilloscopes, SMUs, Function Generators and DC Powersupplies via Ethernet.
FunctionGenerator.h
Go to the documentation of this file.
1 //
2 // Created by florianfrank on 19.07.22.
3 //
4 
5 #ifndef INSTRUMENT_CONTROL_LIB_FUNCTIONGENERATOR_H
6 #define INSTRUMENT_CONTROL_LIB_FUNCTIONGENERATOR_H
7 
8 #include "Device.h"
9 
10 class FunctionGenerator : public Device
11 {
12 public:
14  /* Sinus signal*/
15  SIN,
16  /* Square signal*/
18  /* Square signal*/
20  /* Negative ramp signal*/
22  /* Triangle signal*/
24  /* Noise signal */
26  /* Pseudo random bit stream signal */
28  /* Arbitrary signal */
30  /* Constant dc voltage */
32  };
33 
34  enum FUNC_CHANNEL {
36  CHANNEL_B
37  };
38 
39  explicit FunctionGenerator(const char *ip, int timeoutInMs, PIL::Logging *logger);
40 
41  virtual PIL_ERROR_CODE turnOn() = 0;
42  virtual PIL_ERROR_CODE turnOff() = 0;
43 
44  virtual PIL_ERROR_CODE setFrequency(double value) = 0;
45  virtual PIL_ERROR_CODE setAmplitude(double value, const char *constrain) = 0;
46  virtual PIL_ERROR_CODE setPhase(double value) = 0;
47  virtual PIL_ERROR_CODE setFunction(FUNCTION_TYPE functionType) = 0;
48  virtual PIL_ERROR_CODE setOffset(double offset) = 0;
49 
51  bool isOutputEnabled() const;
52  double getCurrentAmplitude() const;
53 
54 protected:
57  double m_Amplitude;
58 
59 
60 };
61 
62 
63 #endif //INSTRUMENT_CONTROL_LIB_FUNCTIONGENERATOR_H
Basic device class This class contains all basic method of all devices, like Connect,...
Definition: Device.h:30
Definition: FunctionGenerator.h:11
virtual PIL_ERROR_CODE setFunction(FUNCTION_TYPE functionType)=0
FUNCTION_TYPE m_CurrentFunction
Definition: FunctionGenerator.h:55
virtual PIL_ERROR_CODE turnOff()=0
virtual PIL_ERROR_CODE turnOn()=0
FUNCTION_TYPE
Definition: FunctionGenerator.h:13
@ ARBITRARY
Definition: FunctionGenerator.h:29
@ NOISE
Definition: FunctionGenerator.h:25
@ TRIANGLE
Definition: FunctionGenerator.h:23
@ DC_VOLTAGE
Definition: FunctionGenerator.h:31
@ NEGATIVE_RAM
Definition: FunctionGenerator.h:21
@ RAMP
Definition: FunctionGenerator.h:19
@ PSEUDO_RANDOM_BIT_STREAM
Definition: FunctionGenerator.h:27
@ SIN
Definition: FunctionGenerator.h:15
@ SQUARE
Definition: FunctionGenerator.h:17
FUNC_CHANNEL
Definition: FunctionGenerator.h:34
@ CHANNEL_A
Definition: FunctionGenerator.h:35
@ CHANNEL_B
Definition: FunctionGenerator.h:36
bool m_OutputEnabled
Definition: FunctionGenerator.h:56
virtual PIL_ERROR_CODE setFrequency(double value)=0
double m_Amplitude
Definition: FunctionGenerator.h:57
virtual PIL_ERROR_CODE setPhase(double value)=0
virtual PIL_ERROR_CODE setOffset(double offset)=0
double getCurrentAmplitude() const
Definition: FunctionGenerator.cpp:15
FunctionGenerator(const char *ip, int timeoutInMs, PIL::Logging *logger)
Definition: FunctionGenerator.cpp:3
virtual PIL_ERROR_CODE setAmplitude(double value, const char *constrain)=0
FUNCTION_TYPE getOutputFunction() const
Definition: FunctionGenerator.cpp:7
bool isOutputEnabled() const
Definition: FunctionGenerator.cpp:11