TwiceAsNice  2019-02-18
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Basda::osci::AgilentOsci6k Class Reference

The class AgilentOsci6k provides all functions to create a connection to the oscilloscope and send and recieve specific commands. More...

#include <AgilentOsci6k.h>

Collaboration diagram for Basda::osci::AgilentOsci6k:
Collaboration graph

Public Member Functions

 AgilentOsci6k ()
 standard constructor for this class. More...
 
 AgilentOsci6k (std::string dev, bool create)
 constructor to set the device adress and create connection on demand More...
 
virtual ~AgilentOsci6k ()
 standard destructor ( slightly modified to close the port also ) More...
 
void createChatLine (const std::string &conConfig)
 this function creates the chatline and starts the connection with the oscilloscope. More...
 
void createChatLine (void)
 creates the chatline with m_IpInfo More...
 
void closeChatLine (void)
 this function closes the chatline and ends the connection to the Device More...
 
std::string getAnswer (void)
 returns the answer string More...
 
void setCLS (void)
 command to clear the interface of the device More...
 
void setESE (int _weight)
 sets the Standard Event Status register More...
 
void getESE (void)
 gets the configuration of status reports in the event status register More...
 
void getESR (void)
 gets the standard event status register More...
 
void getIDN (void)
 gets the identification of the device More...
 
void setOPC (void)
 sets operation complete command More...
 
void getOPC (void)
 query operation complete. More...
 
void setRST (void)
 reset the instrument More...
 
void setSRE (int weight)
 set the status reports in the service request enable register More...
 
void getSRE (void)
 query the configuration of status reports in the service request enable register More...
 
void getSTB (void)
 query the status byte More...
 
void getTST (void)
 enable selftest of the device More...
 
void autoscale ()
 evaluates all the input signals and sets the correct conditions to display all of the active signals More...
 
void setChannelProbe (int channel, double attenuation)
 Sets the probe attenuation factor for the selected channel. More...
 
void setChannelRange (int channel, double verticalRange)
 Sets the full scale vertical range in volts. More...
 
void setChannelOffset (int channel, double offset)
 sets the voltage or vertical value represented at center screen for the selected function. More...
 
void setTimeRange (double horizontalRange)
 Sets the full scale horizontal time in seconds. More...
 
void setTimeReference (std::string reference)
 
void setTimeDelay (double timeDelay)
 sets the main time base delay. More...
 
void setTriggerLevel (double triggerLevel)
 sets the main trigger level. More...
 
void digitize (int channel)
 
void setAcquireMode (std::string mode)
 
void setAcquireComplete (int percentage)
 
void setTriggerSource (std::string source)
 
void setTriggerMode (std::string mode)
 
void setTriggerSlope (std::string slope)
 
void getWaveform ()
 
void getWavePreamble (int channel, int points, std::string type)
 
void getTriggerSource ()
 
void getTriggerLevel ()
 
void getTriggerMode ()
 
void getTriggerSlope ()
 
void getTimeDelay ()
 
void getTimeRange ()
 
void getChannelRange (int channel)
 
void getChannelVoltagePTP (int channel)
 
void getChannelVoltageAverage (int channel)
 
void getChannelOffset (int channel)
 
void getTimeReference ()
 
 AgilentOsci6k ()
 standard constructor for this class. More...
 
 AgilentOsci6k (std::string dev, bool create)
 constructor to set the device adress and create connection on demand More...
 
virtual ~AgilentOsci6k ()
 standard destructor ( slightly modified to close the port also ) More...
 
void createChatLine (const std::string &conConfig)
 this function creates the chatline and starts the connection with the oscilloscope. More...
 
void createChatLine (void)
 creates the chatline with m_IpInfo More...
 
void closeChatLine (void)
 this function closes the chatline and ends the connection to the Device More...
 
std::string getAnswer (void)
 returns the answer string More...
 
void setCLS (void)
 command to clear the interface of the device More...
 
void setESE (int _weight)
 sets the Standard Event Status register More...
 
void getESE (void)
 gets the configuration of status reports in the event status register More...
 
void getESR (void)
 gets the standard event status register More...
 
void getIDN (void)
 gets the identification of the device More...
 
void setOPC (void)
 sets operation complete command More...
 
void getOPC (void)
 query operation complete. More...
 
void setRST (void)
 reset the instrument More...
 
void setSRE (int weight)
 set the status reports in the service request enable register More...
 
void getSRE (void)
 query the configuration of status reports in the service request enable register More...
 
void getSTB (void)
 query the status byte More...
 
void getTST (void)
 enable selftest of the device More...
 
void autoscale ()
 evaluates all the input signals and sets the correct conditions to display all of the active signals More...
 
void setChannelProbe (int channel, double attenuation)
 Sets the probe attenuation factor for the selected channel. More...
 
void setChannelRange (int channel, double verticalRange)
 Sets the full scale vertical range in volts. More...
 
void setChannelOffset (int channel, double offset)
 sets the voltage or vertical value represented at center screen for the selected function. More...
 
void setTimeRange (double horizontalRange)
 Sets the full scale horizontal time in seconds. More...
 
void setTimeReference (std::string reference)
 
void setTimeDelay (double timeDelay)
 sets the main time base delay. More...
 
void setTriggerLevel (double triggerLevel)
 sets the main trigger level. More...
 
void digitize (int channel)
 
void setAcquireMode (std::string mode)
 
void setAcquireComplete (int percentage)
 
void setTriggerSource (std::string source)
 
void setTriggerMode (std::string mode)
 
void setTriggerSlope (std::string slope)
 
void getWaveform ()
 
void getWavePreamble (int channel, int points, std::string type)
 
void getTriggerSource ()
 
void getTriggerLevel ()
 
void getTriggerMode ()
 
void getTriggerSlope ()
 
void getTimeDelay ()
 
void getTimeRange ()
 
void getChannelRange (int channel)
 
void getChannelVoltagePTP (int channel)
 
void getChannelVoltageAverage (int channel)
 
void getChannelOffset (int channel)
 
void getTimeReference ()
 

Protected Member Functions

int sendMsg (const std::string &cmd)
 this function sends a specific command to the device More...
 
void readMsg (std::string &rcv)
 this function reads the answer from the device More...
 
int sendMsg (const std::string &cmd)
 this function sends a specific command to the device More...
 
void readMsg (std::string &rcv)
 this function reads the answer from the device More...
 

Private Member Functions

void setInfo (std::string info)
 this function is used to set the m_IpInfo variable to a specific string More...
 
void readEcho ()
 read the echo from the oscilloscope More...
 
void setInfo (std::string info)
 this function is used to set the m_IpInfo variable to a specific string More...
 
void readEcho ()
 read the echo from the oscilloscope More...
 

Private Attributes

Nice::ChatLine m_chat
 this is the chatline that is used to comunicate with the device More...
 
std::string m_IpInfo
 this string contains the connection informations (ip adress, port) to build the chatLine More...
 
bool m_isConnected
 this boolean indicates if there is an active connection to a device More...
 
std::string m_answer
 this string contains the latest answer from the device More...
 
std::string m_term
 this string contains the current terminators for the sending of the commands More...
 

Detailed Description

The class AgilentOsci6k provides all functions to create a connection to the oscilloscope and send and recieve specific commands.

Communication and connection is done by Chatline().

Constructor & Destructor Documentation

◆ AgilentOsci6k() [1/4]

AgilentOsci6k::AgilentOsci6k ( )

standard constructor for this class.

It creates the command list.

◆ AgilentOsci6k() [2/4]

AgilentOsci6k::AgilentOsci6k ( std::string  dev,
bool  create 
)

constructor to set the device adress and create connection on demand

Parameters
devadress of the device
createtrue if a connection should be created at once

◆ ~AgilentOsci6k() [1/2]

AgilentOsci6k::~AgilentOsci6k ( )
virtual

standard destructor ( slightly modified to close the port also )

◆ AgilentOsci6k() [3/4]

Basda::osci::AgilentOsci6k::AgilentOsci6k ( )

standard constructor for this class.

It creates the command list.

◆ AgilentOsci6k() [4/4]

Basda::osci::AgilentOsci6k::AgilentOsci6k ( std::string  dev,
bool  create 
)

constructor to set the device adress and create connection on demand

Parameters
devadress of the device
createtrue if a connection should be created at once

◆ ~AgilentOsci6k() [2/2]

virtual Basda::osci::AgilentOsci6k::~AgilentOsci6k ( )
virtual

standard destructor ( slightly modified to close the port also )

Member Function Documentation

◆ autoscale() [1/2]

void AgilentOsci6k::autoscale ( )

evaluates all the input signals and sets the correct conditions to display all of the active signals

◆ autoscale() [2/2]

void Basda::osci::AgilentOsci6k::autoscale ( )

evaluates all the input signals and sets the correct conditions to display all of the active signals

◆ closeChatLine() [1/2]

void AgilentOsci6k::closeChatLine ( void  )

this function closes the chatline and ends the connection to the Device

◆ closeChatLine() [2/2]

void Basda::osci::AgilentOsci6k::closeChatLine ( void  )

this function closes the chatline and ends the connection to the Device

◆ createChatLine() [1/4]

void AgilentOsci6k::createChatLine ( const std::string &  conConfig)

this function creates the chatline and starts the connection with the oscilloscope.

Parameters
conConfigconfiguration and identification needed by chatline

◆ createChatLine() [2/4]

void Basda::osci::AgilentOsci6k::createChatLine ( const std::string &  conConfig)

this function creates the chatline and starts the connection with the oscilloscope.

Parameters
conConfigconfiguration and identification needed by chatline

◆ createChatLine() [3/4]

void AgilentOsci6k::createChatLine ( void  )

creates the chatline with m_IpInfo

◆ createChatLine() [4/4]

void Basda::osci::AgilentOsci6k::createChatLine ( void  )

creates the chatline with m_IpInfo

◆ digitize() [1/2]

void Basda::osci::AgilentOsci6k::digitize ( int  channel)

◆ digitize() [2/2]

void AgilentOsci6k::digitize ( int  channel)

◆ getAnswer() [1/2]

std::string Basda::osci::AgilentOsci6k::getAnswer ( void  )
inline

returns the answer string

Returns
latest answer from the device

◆ getAnswer() [2/2]

std::string Basda::osci::AgilentOsci6k::getAnswer ( void  )
inline

returns the answer string

Returns
latest answer from the device

◆ getChannelOffset() [1/2]

void AgilentOsci6k::getChannelOffset ( int  channel)

◆ getChannelOffset() [2/2]

void Basda::osci::AgilentOsci6k::getChannelOffset ( int  channel)

◆ getChannelRange() [1/2]

void AgilentOsci6k::getChannelRange ( int  channel)

◆ getChannelRange() [2/2]

void Basda::osci::AgilentOsci6k::getChannelRange ( int  channel)

◆ getChannelVoltageAverage() [1/2]

void AgilentOsci6k::getChannelVoltageAverage ( int  channel)

◆ getChannelVoltageAverage() [2/2]

void Basda::osci::AgilentOsci6k::getChannelVoltageAverage ( int  channel)

◆ getChannelVoltagePTP() [1/2]

void Basda::osci::AgilentOsci6k::getChannelVoltagePTP ( int  channel)

◆ getChannelVoltagePTP() [2/2]

void AgilentOsci6k::getChannelVoltagePTP ( int  channel)

◆ getESE() [1/2]

void Basda::osci::AgilentOsci6k::getESE ( void  )

gets the configuration of status reports in the event status register

◆ getESE() [2/2]

void AgilentOsci6k::getESE ( void  )

gets the configuration of status reports in the event status register

◆ getESR() [1/2]

void AgilentOsci6k::getESR ( void  )

gets the standard event status register

◆ getESR() [2/2]

void Basda::osci::AgilentOsci6k::getESR ( void  )

gets the standard event status register

◆ getIDN() [1/2]

void AgilentOsci6k::getIDN ( void  )

gets the identification of the device

◆ getIDN() [2/2]

void Basda::osci::AgilentOsci6k::getIDN ( void  )

gets the identification of the device

◆ getOPC() [1/2]

void AgilentOsci6k::getOPC ( void  )

query operation complete.

Note
places a 1 in the controllers outoput queue upon completion of all pending selected device operations

◆ getOPC() [2/2]

void Basda::osci::AgilentOsci6k::getOPC ( void  )

query operation complete.

Note
places a 1 in the controllers outoput queue upon completion of all pending selected device operations

◆ getSRE() [1/2]

void AgilentOsci6k::getSRE ( void  )

query the configuration of status reports in the service request enable register

◆ getSRE() [2/2]

void Basda::osci::AgilentOsci6k::getSRE ( void  )

query the configuration of status reports in the service request enable register

◆ getSTB() [1/2]

void AgilentOsci6k::getSTB ( void  )

query the status byte

◆ getSTB() [2/2]

void Basda::osci::AgilentOsci6k::getSTB ( void  )

query the status byte

◆ getTimeDelay() [1/2]

void AgilentOsci6k::getTimeDelay ( )

◆ getTimeDelay() [2/2]

void Basda::osci::AgilentOsci6k::getTimeDelay ( )

◆ getTimeRange() [1/2]

void AgilentOsci6k::getTimeRange ( )

◆ getTimeRange() [2/2]

void Basda::osci::AgilentOsci6k::getTimeRange ( )

◆ getTimeReference() [1/2]

void Basda::osci::AgilentOsci6k::getTimeReference ( )

◆ getTimeReference() [2/2]

void AgilentOsci6k::getTimeReference ( )

◆ getTriggerLevel() [1/2]

void AgilentOsci6k::getTriggerLevel ( )

◆ getTriggerLevel() [2/2]

void Basda::osci::AgilentOsci6k::getTriggerLevel ( )

◆ getTriggerMode() [1/2]

void AgilentOsci6k::getTriggerMode ( )

◆ getTriggerMode() [2/2]

void Basda::osci::AgilentOsci6k::getTriggerMode ( )

◆ getTriggerSlope() [1/2]

void AgilentOsci6k::getTriggerSlope ( )

◆ getTriggerSlope() [2/2]

void Basda::osci::AgilentOsci6k::getTriggerSlope ( )

◆ getTriggerSource() [1/2]

void AgilentOsci6k::getTriggerSource ( )

◆ getTriggerSource() [2/2]

void Basda::osci::AgilentOsci6k::getTriggerSource ( )

◆ getTST() [1/2]

void AgilentOsci6k::getTST ( void  )

enable selftest of the device

Note
the answer of the device is "0" when no errors has been found and "1" else

◆ getTST() [2/2]

void Basda::osci::AgilentOsci6k::getTST ( void  )

enable selftest of the device

Note
the answer of the device is "0" when no errors has been found and "1" else

◆ getWaveform() [1/2]

void Basda::osci::AgilentOsci6k::getWaveform ( )

◆ getWaveform() [2/2]

void AgilentOsci6k::getWaveform ( )

◆ getWavePreamble() [1/2]

void AgilentOsci6k::getWavePreamble ( int  channel,
int  points,
std::string  type 
)

◆ getWavePreamble() [2/2]

void Basda::osci::AgilentOsci6k::getWavePreamble ( int  channel,
int  points,
std::string  type 
)

◆ readEcho() [1/2]

void AgilentOsci6k::readEcho ( )
private

read the echo from the oscilloscope

◆ readEcho() [2/2]

void Basda::osci::AgilentOsci6k::readEcho ( )
private

read the echo from the oscilloscope

◆ readMsg() [1/2]

void AgilentOsci6k::readMsg ( std::string &  rcv)
protected

this function reads the answer from the device

Parameters
rcvanswer from the device

◆ readMsg() [2/2]

void Basda::osci::AgilentOsci6k::readMsg ( std::string &  rcv)
protected

this function reads the answer from the device

Parameters
rcvanswer from the device

◆ sendMsg() [1/2]

int AgilentOsci6k::sendMsg ( const std::string &  cmd)
protected

this function sends a specific command to the device

Parameters
cmdcommand to send
Returns
number of chars sent

◆ sendMsg() [2/2]

int Basda::osci::AgilentOsci6k::sendMsg ( const std::string &  cmd)
protected

this function sends a specific command to the device

Parameters
cmdcommand to send
Returns
number of chars sent

◆ setAcquireComplete() [1/2]

void Basda::osci::AgilentOsci6k::setAcquireComplete ( int  percentage)

◆ setAcquireComplete() [2/2]

void AgilentOsci6k::setAcquireComplete ( int  percentage)

◆ setAcquireMode() [1/2]

void Basda::osci::AgilentOsci6k::setAcquireMode ( std::string  mode)

◆ setAcquireMode() [2/2]

void AgilentOsci6k::setAcquireMode ( std::string  mode)

◆ setChannelOffset() [1/2]

void AgilentOsci6k::setChannelOffset ( int  channel,
double  offset 
)

sets the voltage or vertical value represented at center screen for the selected function.

The range of legal values is generally +/- 10 times the current scale of the selected function

Parameters
channelchannel
offsetvoltage represented at center of screen.

◆ setChannelOffset() [2/2]

void Basda::osci::AgilentOsci6k::setChannelOffset ( int  channel,
double  offset 
)

sets the voltage or vertical value represented at center screen for the selected function.

The range of legal values is generally +/- 10 times the current scale of the selected function

Parameters
channelchannel
offsetvoltage represented at center of screen.

◆ setChannelProbe() [1/2]

void Basda::osci::AgilentOsci6k::setChannelProbe ( int  channel,
double  attenuation 
)

Sets the probe attenuation factor for the selected channel.

The probe attenuation factor may be from 0.1 to 1000.

Parameters
channelchannel
attenuationprobe attenuation

◆ setChannelProbe() [2/2]

void AgilentOsci6k::setChannelProbe ( int  channel,
double  attenuation 
)

Sets the probe attenuation factor for the selected channel.

The probe attenuation factor may be from 0.1 to 1000.

Parameters
channelchannel
attenuationprobe attenuation

◆ setChannelRange() [1/2]

void Basda::osci::AgilentOsci6k::setChannelRange ( int  channel,
double  verticalRange 
)

Sets the full scale vertical range in volts.

The range value is eight times the volts per division.

Parameters
channelchannel
verticalRangefull vertical scale

◆ setChannelRange() [2/2]

void AgilentOsci6k::setChannelRange ( int  channel,
double  verticalRange 
)

Sets the full scale vertical range in volts.

The range value is eight times the volts per division.

Parameters
channelchannel
verticalRangefull vertical scale

◆ setCLS() [1/2]

void AgilentOsci6k::setCLS ( void  )

command to clear the interface of the device

◆ setCLS() [2/2]

void Basda::osci::AgilentOsci6k::setCLS ( void  )

command to clear the interface of the device

◆ setESE() [1/2]

void Basda::osci::AgilentOsci6k::setESE ( int  _weight)

sets the Standard Event Status register

Parameters
_weightbit weighting
Note
_weight 0 to 255: 128(7)= PON (Power On) 64(6) = URQ (User Request) 32(5) = CME (Command Error) 16(4) = EXE (Execution Error) 8(3) = DDE (Dev. Dependent Error) 4(2) = QYE (Query Error) 2(1) = RQL (Request Control) 1(0) = OPC (Operation Complete)

◆ setESE() [2/2]

void AgilentOsci6k::setESE ( int  _weight)

sets the Standard Event Status register

Parameters
_weightbit weighting
Note
_weight 0 to 255: 128(7)= PON (Power On) 64(6) = URQ (User Request) 32(5) = CME (Command Error) 16(4) = EXE (Execution Error) 8(3) = DDE (Dev. Dependent Error) 4(2) = QYE (Query Error) 2(1) = RQL (Request Control) 1(0) = OPC (Operation Complete)

◆ setInfo() [1/2]

void Basda::osci::AgilentOsci6k::setInfo ( std::string  info)
private

this function is used to set the m_IpInfo variable to a specific string

◆ setInfo() [2/2]

void AgilentOsci6k::setInfo ( std::string  info)
private

this function is used to set the m_IpInfo variable to a specific string

◆ setOPC() [1/2]

void AgilentOsci6k::setOPC ( void  )

sets operation complete command

◆ setOPC() [2/2]

void Basda::osci::AgilentOsci6k::setOPC ( void  )

sets operation complete command

◆ setRST() [1/2]

void AgilentOsci6k::setRST ( void  )

reset the instrument

◆ setRST() [2/2]

void Basda::osci::AgilentOsci6k::setRST ( void  )

reset the instrument

◆ setSRE() [1/2]

void AgilentOsci6k::setSRE ( int  weight)

set the status reports in the service request enable register

Parameters
_weightbit weighting

◆ setSRE() [2/2]

void Basda::osci::AgilentOsci6k::setSRE ( int  weight)

set the status reports in the service request enable register

Parameters
_weightbit weighting

◆ setTimeDelay() [1/2]

void AgilentOsci6k::setTimeDelay ( double  timeDelay)

sets the main time base delay.

This delay is the time between the trigger event and the delay reference point on the screen. The delay reference point is set with the :TIMebase:REFerence

Parameters
timeDelaymain time base delay in second

◆ setTimeDelay() [2/2]

void Basda::osci::AgilentOsci6k::setTimeDelay ( double  timeDelay)

sets the main time base delay.

This delay is the time between the trigger event and the delay reference point on the screen. The delay reference point is set with the :TIMebase:REFerence

Parameters
timeDelaymain time base delay in second

◆ setTimeRange() [1/2]

void AgilentOsci6k::setTimeRange ( double  horizontalRange)

Sets the full scale horizontal time in seconds.

The range value is ten times the time per division.

Parameters
horizontalRangefull horizontal scale in seconds

◆ setTimeRange() [2/2]

void Basda::osci::AgilentOsci6k::setTimeRange ( double  horizontalRange)

Sets the full scale horizontal time in seconds.

The range value is ten times the time per division.

Parameters
horizontalRangefull horizontal scale in seconds

◆ setTimeReference() [1/2]

void AgilentOsci6k::setTimeReference ( std::string  reference)

◆ setTimeReference() [2/2]

void Basda::osci::AgilentOsci6k::setTimeReference ( std::string  reference)

◆ setTriggerLevel() [1/2]

void AgilentOsci6k::setTriggerLevel ( double  triggerLevel)

sets the main trigger level.

Parameters
triggerLevelthe trigger level in volts

◆ setTriggerLevel() [2/2]

void Basda::osci::AgilentOsci6k::setTriggerLevel ( double  triggerLevel)

sets the main trigger level.

Parameters
triggerLevelthe trigger level in volts

◆ setTriggerMode() [1/2]

void Basda::osci::AgilentOsci6k::setTriggerMode ( std::string  mode)

◆ setTriggerMode() [2/2]

void AgilentOsci6k::setTriggerMode ( std::string  mode)

◆ setTriggerSlope() [1/2]

void Basda::osci::AgilentOsci6k::setTriggerSlope ( std::string  slope)

◆ setTriggerSlope() [2/2]

void AgilentOsci6k::setTriggerSlope ( std::string  slope)

◆ setTriggerSource() [1/2]

void Basda::osci::AgilentOsci6k::setTriggerSource ( std::string  source)

◆ setTriggerSource() [2/2]

void AgilentOsci6k::setTriggerSource ( std::string  source)

Member Data Documentation

◆ m_answer

std::string Basda::osci::AgilentOsci6k::m_answer
private

this string contains the latest answer from the device

◆ m_chat

Nice::ChatLine Basda::osci::AgilentOsci6k::m_chat
private

this is the chatline that is used to comunicate with the device

◆ m_IpInfo

std::string Basda::osci::AgilentOsci6k::m_IpInfo
private

this string contains the connection informations (ip adress, port) to build the chatLine

◆ m_isConnected

bool Basda::osci::AgilentOsci6k::m_isConnected
private

this boolean indicates if there is an active connection to a device

◆ m_term

std::string Basda::osci::AgilentOsci6k::m_term
private

this string contains the current terminators for the sending of the commands


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