Instrument Control Lib
Framework to control Oscilloscopes, SMUs, Function Generators and DC Powersupplies via Ethernet.
KST33500 Class Reference

#include <KST33500.h>

Inheritance diagram for KST33500:
Inheritance graph
Collaboration diagram for KST33500:
Collaboration graph

Public Member Functions

 KST33500 (const char *ip, int timeoutInMS)
 
 KST33500 (const char *ip, int timeoutInMs, PIL::Logging *logger)
 
PIL_ERROR_CODE turnOn () override
 
PIL_ERROR_CODE turnOff () override
 
PIL_ERROR_CODE setFrequency (double value) override
 
PIL_ERROR_CODE setAmplitude (double value, const char *constrain) override
 
PIL_ERROR_CODE setOffset (double offset) override
 
PIL_ERROR_CODE setPhase (double value) override
 
PIL_ERROR_CODE setFunction (FUNCTION_TYPE functionType) override
 Set output function of the function generator. E.g. SIN sets a sinus wave. More...
 
PIL_ERROR_CODE display (std::string &text)
 
PIL_ERROR_CODE displayConnection ()
 
- Public Member Functions inherited from FunctionGenerator
 FunctionGenerator (const char *ip, int timeoutInMs, PIL::Logging *logger)
 
FUNCTION_TYPE getOutputFunction () const
 
bool isOutputEnabled () const
 
double getCurrentAmplitude () const
 
- Public Member Functions inherited from Device
 Device (std::string ipAddress, int timeoutInMs, SEND_METHOD mode=DIRECT_SEND, bool throwException=true)
 Constructor for the Device without passing a logging object. More...
 
 Device (std::string ipAddress, int timeoutInMs, PIL::Logging *logger, SEND_METHOD mode=DIRECT_SEND, bool throwException=true)
 Constructor of Device generates a socket handle without connecting to it. More...
 
 Device (std::string ipAddress, uint16_t srcPort, uint16_t destPort, int timeoutInMs, PIL::Logging *logger, SEND_METHOD mode=DIRECT_SEND, bool throwException=true)
 Base class containing the base functionality of all devices. And parameters to store the name connection type, etc. More...
 
 ~Device ()
 
PIL_ERROR_CODE Connect ()
 Establish a connection to the device. More...
 
PIL_ERROR_CODE Disconnect ()
 Disconnect from the device. More...
 
bool isOpen () const
 Checks if the connection to the device is established. More...
 
bool isBuffered () const
 Checks if the commands sent to the device get buffered. More...
 
std::string getDeviceIdentifier ()
 Gets the name of the currently connected device. More...
 
PIL_ERROR_CODE Exec (const std::string &command, ExecArgs *args=nullptr, char *result=nullptr, bool br=true, int size=1024)
 execute a (SCPI) command More...
 
PIL_ERROR_CODE Exec (const std::string &command, ExecArgs *args, std::string *result, bool br)
 
PIL_ERROR_CODE ExecCommands (std::string &commands)
 
std::string ReturnErrorMessage ()
 
std::string getBufferedScript ()
 Transforms the current buffered script into a string and returns it. More...
 
void changeSendMode (SEND_METHOD mode)
 Changes the send mode of this device, i.e. whether the commands get buffered or sent directly to the device. More...
 
PIL_ERROR_CODE delay (double delayTime)
 Stops the execution for the specified amount of time in seconds. If buffering is enabled, the delay is included in the buffered script. Otherwise this thread sleeps for the given time. More...
 

Additional Inherited Members

- Public Types inherited from FunctionGenerator
enum  FUNCTION_TYPE {
  SIN , SQUARE , RAMP , NEGATIVE_RAM ,
  TRIANGLE , NOISE , PSEUDO_RANDOM_BIT_STREAM , ARBITRARY ,
  DC_VOLTAGE
}
 
enum  FUNC_CHANNEL { CHANNEL_A , CHANNEL_B }
 
- Public Types inherited from Device
enum  SEND_METHOD { DIRECT_SEND = 0 , BUFFER_ENABLED = 1 }
 
- Protected Member Functions inherited from Device
PIL_ERROR_CODE handleErrorsAndLogging (PIL_ERROR_CODE errorCode, bool throwException, PIL::Level logLevel, const std::string &fileName, int line, std::string formatStr,...)
 Handle logging messages, logs it based on the previously passed logging object. If exceptions are enabled throw an exception otherwise return the error code. More...
 
- Static Protected Member Functions inherited from Device
static bool errorOccured (PIL_ERROR_CODE errorCode)
 Checks if a error occured given the error code. More...
 
static PIL_ERROR_CODE postRequest (const std::string &url, std::string &payload)
 Sends a post request to the given url with the given payload. More...
 
static std::string vectorToStringNL (std::vector< std::string > vector)
 Transforms the given vector into a string. Each vector entry will be a line in the resulting string. More...
 
static std::string replaceAllSubstrings (std::string str, const std::string &from, const std::string &to)
 Replaces all substrings in the string with the given replacement string. More...
 
static std::vector< std::string > splitString (const std::string &toSplit, const std::string &delimiter)
 Splits a string by the given delimiter. More...
 
- Protected Attributes inherited from FunctionGenerator
FUNCTION_TYPE m_CurrentFunction
 
bool m_OutputEnabled
 
double m_Amplitude
 
- Protected Attributes inherited from Device
std::string m_IPAddr
 
PIL_ErrorHandle m_ErrorHandle
 
std::string m_DeviceName {}
 
PIL::Socket * m_SocketHandle
 
PIL::Logging * m_Logger
 
int m_destPort = 5025
 
int m_srcPort = 5025
 
bool m_EnableExceptions
 
SEND_METHOD m_SendMode
 
std::vector< std::string > m_BufferedScript
 

Constructor & Destructor Documentation

◆ KST33500() [1/2]

KST33500::KST33500 ( const char *  ip,
int  timeoutInMS 
)
explicit

◆ KST33500() [2/2]

KST33500::KST33500 ( const char *  ip,
int  timeoutInMs,
PIL::Logging *  logger 
)
explicit

Member Function Documentation

◆ display()

PIL_ERROR_CODE KST33500::display ( std::string &  text)
Here is the call graph for this function:

◆ displayConnection()

PIL_ERROR_CODE KST33500::displayConnection ( )
Here is the call graph for this function:

◆ setAmplitude()

PIL_ERROR_CODE KST33500::setAmplitude ( double  value,
const char *  constrain 
)
overridevirtual

Implements FunctionGenerator.

Here is the call graph for this function:

◆ setFrequency()

PIL_ERROR_CODE KST33500::setFrequency ( double  value)
overridevirtual

Implements FunctionGenerator.

Here is the call graph for this function:

◆ setFunction()

PIL_ERROR_CODE KST33500::setFunction ( FunctionGenerator::FUNCTION_TYPE  functionType)
overridevirtual

Set output function of the function generator. E.g. SIN sets a sinus wave.

Parameters
functionTypetype of output function to set. E.g. SINUS or SQUARE for sinus and square waves
Returns
true if no error occurs. Otherwise the error could be read by calling return_error_message().

Implements FunctionGenerator.

Here is the call graph for this function:

◆ setOffset()

PIL_ERROR_CODE KST33500::setOffset ( double  offset)
overridevirtual

argument unit: V attention: offset would change voltage by double of your argument

Implements FunctionGenerator.

Here is the call graph for this function:

◆ setPhase()

PIL_ERROR_CODE KST33500::setPhase ( double  value)
overridevirtual

Implements FunctionGenerator.

Here is the call graph for this function:

◆ turnOff()

PIL_ERROR_CODE KST33500::turnOff ( )
overridevirtual

Implements FunctionGenerator.

◆ turnOn()

PIL_ERROR_CODE KST33500::turnOn ( )
overridevirtual

Implements FunctionGenerator.


The documentation for this class was generated from the following files: