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

The class TempMonitor provides all functions to create a connection to the temperature monitor and send and receave specific comands. More...

#include <LSTempMonitor.h>

Collaboration diagram for Basda::TempMonitor:
Collaboration graph

Public Member Functions

 TempMonitor ()
 standard constructor for this class. More...
 
 TempMonitor (std::string dev, bool create)
 constructor to set the device adress and create connection on demand More...
 
virtual ~TempMonitor ()
 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 to the Lakeshore Temperature Monitor. 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...
 
void printComands (void)
 this function returns a list of all possible comands supportet by the temperature monitor. More...
 
void setCLS (void)
 command to clear the interface of the device More...
 
void setESE (int _weight)
 sets the configure status reports in the standard event 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 setALARM (int _input, bool _alarm, int _source, double _high, double _low, double _dead, bool _latch)
 sets the alarm parameters More...
 
void getALARM (int _input)
 query the input alarm parameters More...
 
void getALARMST (int _input)
 query the input alarm status More...
 
void setALMB (bool _beep)
 sets the audible alarm beeper on or off More...
 
void getALMB (void)
 query the audible alarm parameters More...
 
void setALMRST (void)
 clear alarm status for all inputs More...
 
void setANALOG (int _output, bool _bipolar, int _mode, int _input, int _source, double _high, double _low, double _manual)
 configure analog output parameters More...
 
void getANALOG (int _output)
 query analog output parameters More...
 
void getAOUT (int _output)
 query analog output data More...
 
void setBAUD (int _baud)
 sets the serial interface baudrate More...
 
void getBAUD (void)
 gets the current serial interface baudrate More...
 
void getCRDG (int _input)
 query celsius reading for a single input (or all inputs) More...
 
void setCRVDEL (int _curve)
 delete user curve More...
 
void setCRVHDR (int _curve, std::string _name, std::string _sn, int _format, double _limit, int _coeff)
 configure the curve header More...
 
void getCRVHDR (int _curve)
 query curve header More...
 
void setCRVPT (int _curve, int _index, double _units, double _temp)
 configure curve data point More...
 
void getCRVPT (int _curve, int _index)
 query curve data point More...
 
void setDATETIME (int _MM, int _dd, int _yy, int _hh, int _mm, int _ss)
 sets date and time More...
 
void getDATETIME (void)
 query date and time More...
 
void setDFLT (void)
 set to factory defaults More...
 
void setDISPFLD (int _loc, int _input, int _source)
 configure display parameters More...
 
void getDISPFLD (int _loc)
 query display field More...
 
void setFILTER (int _input, bool _filter, int _points, int _win)
 configure input filter paramters More...
 
void getFILTER (int _filter)
 query input filter parameters More...
 
void setIEEE (int _term, bool _eoi, int _adr)
 configure IEEE-488 interface parameters More...
 
void getIEEE (void)
 query the IEEE-488 interface parameters More...
 
void setINCRV (int _input, int _curve)
 configure curve input number More...
 
void getINCRV (int _input)
 query input curve number More...
 
void setINPUT (int _input, bool _use)
 configure input control parameter More...
 
void getINPUT (int _input)
 query input control parameter More...
 
void setINTYPE (char _group, int _type)
 configure input type parameters More...
 
void getINTYPE (char _group)
 query input type parameters More...
 
void getKEYST (void)
 query keypad status More...
 
void getKRDG (int _input)
 query Kelvin reading for a single input (or all inputs) More...
 
void setLINEAR (int _input, double _varM, int _source, double _varB)
 configure input linear equation parameters More...
 
void getLINEAR (int _input)
 query linear input equation parameters More...
 
void setLOCK (bool _lock, int _code)
 configure Lock-out and Lock-out code More...
 
void getLOCK (void)
 query lock-out and lock-out code More...
 
void setLOG (bool _log)
 turns logging on or off More...
 
void getLOG (void)
 query logging status More...
 
void getLOGNUM (void)
 query number of last data log record stored More...
 
void setLOGREAD (int _num, int _input, int _source)
 configure log records More...
 
void getLOGREAD (int _num)
 query log record parameters More...
 
void setLOGSET (int _mode, bool _over, int _start, int _period, int _read)
 configure logging paramters More...
 
void getLOGSET (void)
 query logging parameters More...
 
void getLOGVIEW (int _num, int _read)
 query a logged data record More...
 
void getLRDG (int _input)
 query linear equation data for a single input (or all inputs) More...
 
void setMNMX (int _input, int _source)
 configure minimun and maximum input function parameters More...
 
void getMNMX (int _input)
 query minimun and maximum input function parameters More...
 
void getMNMXRDG (int _input)
 query min/max data for an input More...
 
void setMNMXRST (void)
 reset all min/max function for all inputs More...
 
void setMODE (int _mode)
 configure remote interface mode More...
 
void getMODE (void)
 query remote interface mode More...
 
void getRDGST (int _input)
 query input status More...
 
void setRELAY (int _relay, int _mode, int _input, int _type)
 configure relay control parameters More...
 
void getRELAY (int _relay)
 query relay control parameters More...
 
void getRELAYST (void)
 query relay status More...
 
void setSCAL (int _std, int _dest, std::string _sn, double _t1, double _u1, double _t2, double _u2, double _t3, double _u3)
 generate a SoftCal(TM) curve More...
 
void getSRDG (int _input)
 query sensor units reading for a single input (or all inputs) More...
 
std::string getAnswer (void)
 returns the answer string More...
 

Protected Member Functions

int sendMsg (const std::string &cmd)
 this function sends a specific comand 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...
 

Private Attributes

std::vector< std::string > m_comands
 this vector contains the comands supported by the temperature monitor More...
 
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 TempMonitor provides all functions to create a connection to the temperature monitor and send and receave specific comands.

Comunication and conection is done by Chatline().

Constructor & Destructor Documentation

◆ TempMonitor() [1/2]

TempMonitor::TempMonitor ( )

standard constructor for this class.

It creates the command list.

◆ TempMonitor() [2/2]

TempMonitor::TempMonitor ( 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

◆ ~TempMonitor()

TempMonitor::~TempMonitor ( )
virtual

standard destructor ( slightly modified to close the port also )

Member Function Documentation

◆ closeChatLine()

void TempMonitor::closeChatLine ( void  )

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

◆ createChatLine() [1/2]

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

this function creates the chatline and starts the connection to the Lakeshore Temperature Monitor.

Parameters
conConfigconfiguration and identification needed by chatline

◆ createChatLine() [2/2]

void TempMonitor::createChatLine ( void  )

creates the chatline with m_IpInfo

◆ getALARM()

void TempMonitor::getALARM ( int  _input)

query the input alarm parameters

Parameters
_inputspecifies the input

◆ getALARMST()

void TempMonitor::getALARMST ( int  _input)

query the input alarm status

Parameters
_inputspecifies the input

◆ getALMB()

void TempMonitor::getALMB ( void  )

query the audible alarm parameters

◆ getANALOG()

void TempMonitor::getANALOG ( int  _output)

query analog output parameters

Parameters
_outputspecifies the output

◆ getAnswer()

std::string Basda::TempMonitor::getAnswer ( void  )
inline

returns the answer string

Returns
latest answer from the device

◆ getAOUT()

void TempMonitor::getAOUT ( int  _output)

query analog output data

Parameters
_outputspecifies the output

◆ getBAUD()

void TempMonitor::getBAUD ( void  )

gets the current serial interface baudrate

◆ getCRDG()

void TempMonitor::getCRDG ( int  _input)

query celsius reading for a single input (or all inputs)

Parameters
_inputspecifies the input (0 for all inputs)

◆ getCRVHDR()

void TempMonitor::getCRVHDR ( int  _curve)

query curve header

Parameters
_curvespecifies which curve to query (1-5=std diode curves, 6-9=std platinum curves, 21-28=user curves)

◆ getCRVPT()

void TempMonitor::getCRVPT ( int  _curve,
int  _index 
)

query curve data point

Parameters
_curvespecifies which curve to query (1-5=std diode curves, 6-9=std platinum curves, 21-28=user curves)
_indexspecifies the points index in the curve (1-200)

◆ getDATETIME()

void TempMonitor::getDATETIME ( void  )

query date and time

◆ getDISPFLD()

void TempMonitor::getDISPFLD ( int  _loc)

query display field

Parameters
_locdisplay location (1-8)

◆ getESE()

void TempMonitor::getESE ( void  )

gets the configuration of status reports in the event status register

◆ getESR()

void TempMonitor::getESR ( void  )

gets the standard event status register

◆ getFILTER()

void TempMonitor::getFILTER ( int  _filter)

query input filter parameters

Parameters
_inputspecifies input (1-8)

◆ getIDN()

void TempMonitor::getIDN ( void  )

gets the identification of the device

◆ getIEEE()

void TempMonitor::getIEEE ( void  )

query the IEEE-488 interface parameters

◆ getINCRV()

void TempMonitor::getINCRV ( int  _input)

query input curve number

Parameters
_inputspecifies the input (1-8)

◆ getINPUT()

void TempMonitor::getINPUT ( int  _input)

query input control parameter

Parameters
_inputspecifies the input (1-8)

◆ getINTYPE()

void TempMonitor::getINTYPE ( char  _group)

query input type parameters

Parameters
_groupspecifies input group (A=1-4, B=5-8)

◆ getKEYST()

void TempMonitor::getKEYST ( void  )

query keypad status

◆ getKRDG()

void TempMonitor::getKRDG ( int  _input)

query Kelvin reading for a single input (or all inputs)

Parameters
_inputspecifies the input (0 for all inputs)

◆ getLINEAR()

void TempMonitor::getLINEAR ( int  _input)

query linear input equation parameters

Parameters
_inputspecifies input (1-8)

◆ getLOCK()

void TempMonitor::getLOCK ( void  )

query lock-out and lock-out code

◆ getLOG()

void TempMonitor::getLOG ( void  )

query logging status

◆ getLOGNUM()

void TempMonitor::getLOGNUM ( void  )

query number of last data log record stored

◆ getLOGREAD()

void TempMonitor::getLOGREAD ( int  _num)

query log record parameters

Parameters
_numnumber of the log to be read (1-8)

◆ getLOGSET()

void TempMonitor::getLOGSET ( void  )

query logging parameters

◆ getLOGVIEW()

void TempMonitor::getLOGVIEW ( int  _num,
int  _read 
)

query a logged data record

Parameters
_numnumber of data record
_readnumber of reading

◆ getLRDG()

void TempMonitor::getLRDG ( int  _input)

query linear equation data for a single input (or all inputs)

Parameters
_inputspecifieas the input (0-8) (0 for all inputs)

◆ getMNMX()

void TempMonitor::getMNMX ( int  _input)

query minimun and maximum input function parameters

Parameters
_inputspecifies the input (1-8)

◆ getMNMXRDG()

void TempMonitor::getMNMXRDG ( int  _input)

query min/max data for an input

Parameters
_inputspecifies the input (1-8)

◆ getMODE()

void TempMonitor::getMODE ( void  )

query remote interface mode

◆ getOPC()

void TempMonitor::getOPC ( void  )

query operation complete.

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

◆ getRDGST()

void TempMonitor::getRDGST ( int  _input)

query input status

Parameters
_inputspecifies the input (1-8)

◆ getRELAY()

void TempMonitor::getRELAY ( int  _relay)

query relay control parameters

Parameters
_relayspecifies which relay to query

◆ getRELAYST()

void TempMonitor::getRELAYST ( void  )

query relay status

◆ getSRDG()

void TempMonitor::getSRDG ( int  _input)

query sensor units reading for a single input (or all inputs)

Parameters
_inputspecifies the input (0-8) (0 for all inputs)

◆ getSRE()

void TempMonitor::getSRE ( void  )

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

◆ getSTB()

void TempMonitor::getSTB ( void  )

query the status byte

◆ getTST()

void TempMonitor::getTST ( void  )

enable selftest of the device

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

◆ printComands()

void TempMonitor::printComands ( void  )

this function returns a list of all possible comands supportet by the temperature monitor.

Returns
string with the comands

◆ readMsg()

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

this function reads the answer from the device

Parameters
rcvanswer from the device

◆ sendMsg()

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

this function sends a specific comand to the device

Parameters
cmdcomand to send
Returns
number of chars sent

◆ setALARM()

void TempMonitor::setALARM ( int  _input,
bool  _alarm,
int  _source,
double  _high,
double  _low,
double  _dead,
bool  _latch 
)

sets the alarm parameters

Parameters
_inputspecifies the input to configure
_alarmsets teh alarm for the input to off or on
_sourcespecifies input data to check (1=Kelvin, 2=Celsius, 3=sensor units, 4=linear data)
_highvalue the source is checked against to activate high alarm level
_lowvalue the source is checked against to activate low alarm level
_deadthe value that the source must change outside of an alarm condition to deactivate an unlatched alarm
_latchSpecifies a latched alarm (remains active after alarm condition correction)

◆ setALMB()

void TempMonitor::setALMB ( bool  _beep)

sets the audible alarm beeper on or off

Parameters
_beepon(true) or off(false)

◆ setALMRST()

void TempMonitor::setALMRST ( void  )

clear alarm status for all inputs

◆ setANALOG()

void TempMonitor::setANALOG ( int  _output,
bool  _bipolar,
int  _mode,
int  _input,
int  _source,
double  _high,
double  _low,
double  _manual 
)

configure analog output parameters

Parameters
_outputspecifies the output (1 or 2)
_bipolarspecifies analog output (0=positiv only, 1=bipolar)
_modedata for the analog output to monitor (0=off, 1=input, 2=manual)
_inputspecifies the input to monitor if _mode=1
_sourcespecifies input data (1=Kelvin, 2=Celsius, 3=sensor units, 4=linear equation)
_highIf _mode=1, this parameter represents the data at which the analog output reaches +100% output
_lowIf _mode=1, this parameter represents the data at which the analog output reaches -100% output if bipolar or 0% else
_manualif _mode=2, this parameter is the output of the analog output

◆ setBAUD()

void TempMonitor::setBAUD ( int  _baud)

sets the serial interface baudrate

Parameters
_baudspecifies baud rate (0=300, 1=1200, 2=9600)

◆ setCLS()

void TempMonitor::setCLS ( void  )

command to clear the interface of the device

◆ setCRVDEL()

void TempMonitor::setCRVDEL ( int  _curve)

delete user curve

Parameters
_curvespecifies which curve to delete (21-28) for inputs 1-8

◆ setCRVHDR()

void TempMonitor::setCRVHDR ( int  _curve,
std::string  _name,
std::string  _sn,
int  _format,
double  _limit,
int  _coeff 
)

configure the curve header

Parameters
_curvespecifies which curve to configure (21-28) for inputs 1-8
_namespecifies curve name (max 15 chars)
_snserial number for the curve (max 10 chars)
_formatcurve data format (2=V/K, 3=Ohm/K, 4=log(Ohm/K)
_limitcurve temperature limit in Kelvin
_coefftemperature coefficient (1=negative, 2=positive)

◆ setCRVPT()

void TempMonitor::setCRVPT ( int  _curve,
int  _index,
double  _units,
double  _temp 
)

configure curve data point

Parameters
_curvespecifies which curve to configure (21-28) for inputs 1-8
_indexspecifies which point index in the curve (1-200)
_unitsspecifies sensor units for this point to 6 digits
_tempspecifies corresponding temperature in Kelvin for this point to 6 digits

◆ setDATETIME()

void TempMonitor::setDATETIME ( int  _MM,
int  _dd,
int  _yy,
int  _hh,
int  _mm,
int  _ss 
)

sets date and time

Parameters
_MMmonth (1-12)
_ddday (1-31)
_yyyear (00-99)
_hhhour (0-23)
_mmminute (0-59)
_sssecond (0-59)

◆ setDFLT()

void TempMonitor::setDFLT ( void  )

set to factory defaults

Note
use with causion

◆ setDISPFLD()

void TempMonitor::setDISPFLD ( int  _loc,
int  _input,
int  _source 
)

configure display parameters

Parameters
_locdisplay location (1-8)
_inputspecifies input to display in that location (0-8) (0=none)
_sourcespecifies input data to display (1=Kelvin, 2=Celsius, 3=sensor units, 4=linear data, 5=minimum data, 6=maximum data)

◆ setESE()

void TempMonitor::setESE ( int  _weight)

sets the configure status reports in the standard event register

Parameters
_weightbit weighting

◆ setFILTER()

void TempMonitor::setFILTER ( int  _input,
bool  _filter,
int  _points,
int  _win 
)

configure input filter paramters

Parameters
_inputspecifies input to configure (1-8)
_filtersets filter to off(false) or on(true)
_pointsamount of data points for the filtering function (2-64)
_winSpecifies what percent of full scale reading limits the filtering function (1-10). Reading changes greater than this percentage reset the filter

◆ setIEEE()

void TempMonitor::setIEEE ( int  _term,
bool  _eoi,
int  _adr 
)

configure IEEE-488 interface parameters

Parameters
_termspecifies the terminator (0=<CR><LF>, 1=<LF><CR>, 2=<LF>, 3=no terminator)
_eoidisables(flase)/enables(true) the EOI mode
_adrspecifies the IEEE address

◆ setINCRV()

void TempMonitor::setINCRV ( int  _input,
int  _curve 
)

configure curve input number

Parameters
_inputspecifies which input to configure (1-8)
_curvespecifies which curve the input uses (0=none, 1-5=std diode curves, 6-9=std platinum curves, 21-28=user curves)

◆ setInfo()

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

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

◆ setINPUT()

void TempMonitor::setINPUT ( int  _input,
bool  _use 
)

configure input control parameter

Parameters
_inputspecifies input (1-8)
_useturns input off(false) or on(true);

◆ setINTYPE()

void TempMonitor::setINTYPE ( char  _group,
int  _type 
)

configure input type parameters

Parameters
_groupspecifies input group (A=1-4, B=5-8)
_typespecifies the input sensor type (0=2.5V Diode, 1 = 7.5V Diode, 2=250Ω Platinum, 3=500Ω Platinum, 4=5kΩ Platinum, 5=Cernox)

◆ setLINEAR()

void TempMonitor::setLINEAR ( int  _input,
double  _varM,
int  _source,
double  _varB 
)

configure input linear equation parameters

Note
the equation used is y = m * x + b
Parameters
_inputspecifies input (1-8)
_varMspecifies a value for m in the equation
_sourcespecifies input data (1=Kelvin, 2=Celsius, 3=sensor units)
_varBspecifies a value for b in the equation

◆ setLOCK()

void TempMonitor::setLOCK ( bool  _lock,
int  _code 
)

configure Lock-out and Lock-out code

Parameters
_lockdisables(false)/enables(true) the keypad lock-out
_codespecifies lock-out code (000-999)

◆ setLOG()

void TempMonitor::setLOG ( bool  _log)

turns logging on or off

Parameters
_logtrue=on, false=off

◆ setLOGREAD()

void TempMonitor::setLOGREAD ( int  _num,
int  _input,
int  _source 
)

configure log records

Parameters
_numspecifies the reading number (1-8) within a log record to configure
_inputthe input to log (1-8)
_sourcedata source to log (1=Kelvin, 2=Celsius, 3=sensor units, 4=linear data)

◆ setLOGSET()

void TempMonitor::setLOGSET ( int  _mode,
bool  _over,
int  _start,
int  _period,
int  _read 
)

configure logging paramters

Parameters
_modespecifies logging mode (0=off, 1=log continous, 2=log event, 3=print continous, 4=print event)
_overspecifies overwrite mode (true=overwrite data, false=do not overwrite data)
_startspecifies start mode (0=clear, 1=continue)
_periodspecifies period in seconds (1-3600). If _mode=3 minimum period is 10
_readspecifies number of readings per record (1-8)

◆ setMNMX()

void TempMonitor::setMNMX ( int  _input,
int  _source 
)

configure minimun and maximum input function parameters

Parameters
_inputspecifies input to configure (1-8)
_sourcespecifies input data to process through max/min (1=Kelvin, 2=Celsius, 3=sensor units, 4=linear data)

◆ setMNMXRST()

void TempMonitor::setMNMXRST ( void  )

reset all min/max function for all inputs

◆ setMODE()

void TempMonitor::setMODE ( int  _mode)

configure remote interface mode

Parameters
_modespecifies the operation mode (0=local, 1=remote, 2=remote with local lock-out)

◆ setOPC()

void TempMonitor::setOPC ( void  )

sets operation complete command

◆ setRELAY()

void TempMonitor::setRELAY ( int  _relay,
int  _mode,
int  _input,
int  _type 
)

configure relay control parameters

Parameters
_relayspecifies which relay to configure (1-8)
_modespecifies relay mode (0=off, 1=on, 2=alarms)
_inputspecifies which input alarm activates the relay when in alarm mode (1-8)
_typespecifies the alarm type (0=low alarm, 1=high alarm, 2=both alarms)

◆ setRST()

void TempMonitor::setRST ( void  )

reset the instrument

◆ setSCAL()

void TempMonitor::setSCAL ( int  _std,
int  _dest,
std::string  _sn,
double  _t1,
double  _u1,
double  _t2,
double  _u2,
double  _t3,
double  _u3 
)

generate a SoftCal(TM) curve

Parameters
_stdspecifies the standard curve to generate SoftCal from (1,6,7)
_destspecifies the user curve to store the SoftCal curve (21-28)
_snspecifies the curve serial number (max 10 chars)
_t1specifies the first temperature point
_u1specifies the first sensor units point
_t2specifies the second temperature point
_u2specifies the second sensor units point
_t3specifies the third temperature point
_u3specifies the third sensor units point

◆ setSRE()

void TempMonitor::setSRE ( int  _weight)

set the status reports in the service request enable register

Parameters
_weightbit weighting

Member Data Documentation

◆ m_answer

std::string Basda::TempMonitor::m_answer
private

this string contains the latest answer from the device

◆ m_chat

Nice::ChatLine Basda::TempMonitor::m_chat
private

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

◆ m_comands

std::vector<std::string> Basda::TempMonitor::m_comands
private

this vector contains the comands supported by the temperature monitor

◆ m_IpInfo

std::string Basda::TempMonitor::m_IpInfo
private

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

◆ m_isConnected

bool Basda::TempMonitor::m_isConnected
private

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

◆ m_term

std::string Basda::TempMonitor::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: