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

Dummy class to allow assignment to SMU class. More...

#include <SMU.h>

Inheritance diagram for SMU:
Inheritance graph
Collaboration diagram for SMU:
Collaboration graph

Public Types

enum  SMU_CHANNEL { CHANNEL_A = 'a' , CHANNEL_B = 'b' }
 Used to select which channel of the SMU should be used to measure or supplied. More...
 
enum  UNIT { VOLTAGE = 0 , CURRENT = 1 , RESISTANCE = 2 , POWER = 3 }
 Unit which should be changed or measured. More...
 
enum  AUTOZERO { OFF , ONCE , AUTO }
 
enum  SRC_FUNC { DC_AMPS , DC_VOLTS }
 
enum  SRC_OFF_MODE { OUTPUT_NORMAL , OUTPUT_ZERO , OUTPUT_HIGH_Z }
 
enum  SRC_SETTLING {
  SMOOTH , FAST_RANGE , FAST_POLARITY , DIRECT_IRANGE ,
  SMOOTH_100NA , FAST_ALL
}
 
enum  SMU_DISPLAY { MEASURE_DC_AMPS , MEASURE_DC_VOLTS , MEASURE_OHMS , MEASURE_WATTS }
 
enum  SMU_SENSE { LOCAL , REMOTE , CALIBRATION }
 
- Public Types inherited from Device
enum  SEND_METHOD { DIRECT_SEND = 0 , BUFFER_ENABLED = 1 }
 

Public Member Functions

 SMU (std::string ipAddress, int timeoutInMs, SEND_METHOD mode=DIRECT_SEND)
 
 SMU (std::string ipAddress, int timeoutInMs, PIL::Logging *logger, SEND_METHOD mode=DIRECT_SEND)
 
virtual PIL_ERROR_CODE measure (UNIT unit, SMU_CHANNEL channel, double *value, bool checkErrorBuffer)=0
 
virtual PIL_ERROR_CODE turnOn (SMU_CHANNEL channel, bool checkErrorBuffer)=0
 
virtual PIL_ERROR_CODE turnOff (SMU_CHANNEL channel, bool checkErrorBuffer)=0
 
virtual PIL_ERROR_CODE setLimit (UNIT unit, SMU_CHANNEL channel, double limit, bool checkErrorBuffer)=0
 
virtual PIL_ERROR_CODE setLevel (UNIT unit, SMU_CHANNEL channel, double level, bool checkErrorBuffer)=0
 
- 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

- 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 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
 

Detailed Description

Dummy class to allow assignment to SMU class.

Member Enumeration Documentation

◆ AUTOZERO

Enumerator
OFF 

AutoZero Disabled

ONCE 

Perform AutoZero once and disable afterwards.

AUTO 

Automatic check the reference and zero measurements. An AutoZero is performed when needed.

◆ SMU_CHANNEL

Used to select which channel of the SMU should be used to measure or supplied.

Enumerator
CHANNEL_A 
CHANNEL_B 

◆ SMU_DISPLAY

Enumerator
MEASURE_DC_AMPS 

Display current measurement function.

MEASURE_DC_VOLTS 

Display voltage measurement function.

MEASURE_OHMS 

Display resistance measurement function.

MEASURE_WATTS 

Display power measurement function.

◆ SMU_SENSE

Enumerator
LOCAL 

Selects local sense (2-wire)

REMOTE 

Select remote sense (4-wire)

CALIBRATION 

Selects calibration sense mode

◆ SRC_FUNC

Enumerator
DC_AMPS 

Current source function

DC_VOLTS 

Voltage source function

◆ SRC_OFF_MODE

Enumerator
OUTPUT_NORMAL 

Configures the source function according to source.offfunc. Currently not supported!

OUTPUT_ZERO 

Set source output to 0V.

OUTPUT_HIGH_Z 

Open source output relay.

◆ SRC_SETTLING

Enumerator
SMOOTH 

Turns off additional settling operations.

FAST_RANGE 

Using a faster procedure when changing ranges.

FAST_POLARITY 

Change polarity without going to zero.

DIRECT_IRANGE 

Change the current range directly.

SMOOTH_100NA 

Enables the sue of range rampers for the 100 nA range.

FAST_ALL 

Enables SETTLE_FAST operations.

◆ UNIT

enum SMU::UNIT

Unit which should be changed or measured.

Enumerator
VOLTAGE 
CURRENT 
RESISTANCE 
POWER 

Constructor & Destructor Documentation

◆ SMU() [1/2]

SMU::SMU ( std::string  ipAddress,
int  timeoutInMs,
SEND_METHOD  mode = DIRECT_SEND 
)
explicit

◆ SMU() [2/2]

SMU::SMU ( std::string  ipAddress,
int  timeoutInMs,
PIL::Logging *  logger,
SEND_METHOD  mode = DIRECT_SEND 
)
explicit

Member Function Documentation

◆ measure()

virtual PIL_ERROR_CODE SMU::measure ( UNIT  unit,
SMU_CHANNEL  channel,
double *  value,
bool  checkErrorBuffer 
)
pure virtual

Implemented in KEI2600.

◆ setLevel()

virtual PIL_ERROR_CODE SMU::setLevel ( UNIT  unit,
SMU_CHANNEL  channel,
double  level,
bool  checkErrorBuffer 
)
pure virtual

Implemented in KEI2600.

◆ setLimit()

virtual PIL_ERROR_CODE SMU::setLimit ( UNIT  unit,
SMU_CHANNEL  channel,
double  limit,
bool  checkErrorBuffer 
)
pure virtual

Implemented in KEI2600.

◆ turnOff()

virtual PIL_ERROR_CODE SMU::turnOff ( SMU_CHANNEL  channel,
bool  checkErrorBuffer 
)
pure virtual

Implemented in KEI2600.

◆ turnOn()

virtual PIL_ERROR_CODE SMU::turnOn ( SMU_CHANNEL  channel,
bool  checkErrorBuffer 
)
pure virtual

Implemented in KEI2600.


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