TwiceAsNice
2019-02-18
|
The class TempMonitor provides all functions to create a connection to the temperature monitor and send and receave specific comands. More...
#include <LSTempMonitor.h>
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... | |
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().
TempMonitor::TempMonitor | ( | ) |
standard constructor for this class.
It creates the command list.
TempMonitor::TempMonitor | ( | std::string | dev, |
bool | create | ||
) |
constructor to set the device adress and create connection on demand
dev | adress of the device |
create | true if a connection should be created at once |
|
virtual |
standard destructor ( slightly modified to close the port also )
void TempMonitor::closeChatLine | ( | void | ) |
this function closes the chatline and ends the connection to the Device
void TempMonitor::createChatLine | ( | const std::string & | conConfig | ) |
this function creates the chatline and starts the connection to the Lakeshore Temperature Monitor.
conConfig | configuration and identification needed by chatline |
void TempMonitor::createChatLine | ( | void | ) |
creates the chatline with m_IpInfo
void TempMonitor::getALARM | ( | int | _input | ) |
query the input alarm parameters
_input | specifies the input |
void TempMonitor::getALARMST | ( | int | _input | ) |
query the input alarm status
_input | specifies the input |
void TempMonitor::getALMB | ( | void | ) |
query the audible alarm parameters
void TempMonitor::getANALOG | ( | int | _output | ) |
query analog output parameters
_output | specifies the output |
|
inline |
returns the answer string
void TempMonitor::getAOUT | ( | int | _output | ) |
query analog output data
_output | specifies the output |
void TempMonitor::getBAUD | ( | void | ) |
gets the current serial interface baudrate
void TempMonitor::getCRDG | ( | int | _input | ) |
query celsius reading for a single input (or all inputs)
_input | specifies the input (0 for all inputs) |
void TempMonitor::getCRVHDR | ( | int | _curve | ) |
query curve header
_curve | specifies which curve to query (1-5=std diode curves, 6-9=std platinum curves, 21-28=user curves) |
void TempMonitor::getCRVPT | ( | int | _curve, |
int | _index | ||
) |
query curve data point
_curve | specifies which curve to query (1-5=std diode curves, 6-9=std platinum curves, 21-28=user curves) |
_index | specifies the points index in the curve (1-200) |
void TempMonitor::getDATETIME | ( | void | ) |
query date and time
void TempMonitor::getDISPFLD | ( | int | _loc | ) |
query display field
_loc | display location (1-8) |
void TempMonitor::getESE | ( | void | ) |
gets the configuration of status reports in the event status register
void TempMonitor::getESR | ( | void | ) |
gets the standard event status register
void TempMonitor::getFILTER | ( | int | _filter | ) |
query input filter parameters
_input | specifies input (1-8) |
void TempMonitor::getIDN | ( | void | ) |
gets the identification of the device
void TempMonitor::getIEEE | ( | void | ) |
query the IEEE-488 interface parameters
void TempMonitor::getINCRV | ( | int | _input | ) |
query input curve number
_input | specifies the input (1-8) |
void TempMonitor::getINPUT | ( | int | _input | ) |
query input control parameter
_input | specifies the input (1-8) |
void TempMonitor::getINTYPE | ( | char | _group | ) |
query input type parameters
_group | specifies input group (A=1-4, B=5-8) |
void TempMonitor::getKEYST | ( | void | ) |
query keypad status
void TempMonitor::getKRDG | ( | int | _input | ) |
query Kelvin reading for a single input (or all inputs)
_input | specifies the input (0 for all inputs) |
void TempMonitor::getLINEAR | ( | int | _input | ) |
query linear input equation parameters
_input | specifies input (1-8) |
void TempMonitor::getLOCK | ( | void | ) |
query lock-out and lock-out code
void TempMonitor::getLOG | ( | void | ) |
query logging status
void TempMonitor::getLOGNUM | ( | void | ) |
query number of last data log record stored
void TempMonitor::getLOGREAD | ( | int | _num | ) |
query log record parameters
_num | number of the log to be read (1-8) |
void TempMonitor::getLOGSET | ( | void | ) |
query logging parameters
void TempMonitor::getLOGVIEW | ( | int | _num, |
int | _read | ||
) |
query a logged data record
_num | number of data record |
_read | number of reading |
void TempMonitor::getLRDG | ( | int | _input | ) |
query linear equation data for a single input (or all inputs)
_input | specifieas the input (0-8) (0 for all inputs) |
void TempMonitor::getMNMX | ( | int | _input | ) |
query minimun and maximum input function parameters
_input | specifies the input (1-8) |
void TempMonitor::getMNMXRDG | ( | int | _input | ) |
query min/max data for an input
_input | specifies the input (1-8) |
void TempMonitor::getMODE | ( | void | ) |
query remote interface mode
void TempMonitor::getOPC | ( | void | ) |
query operation complete.
void TempMonitor::getRDGST | ( | int | _input | ) |
query input status
_input | specifies the input (1-8) |
void TempMonitor::getRELAY | ( | int | _relay | ) |
query relay control parameters
_relay | specifies which relay to query |
void TempMonitor::getRELAYST | ( | void | ) |
query relay status
void TempMonitor::getSRDG | ( | int | _input | ) |
query sensor units reading for a single input (or all inputs)
_input | specifies the input (0-8) (0 for all inputs) |
void TempMonitor::getSRE | ( | void | ) |
query the configuration of status reports in the service request enable register
void TempMonitor::getSTB | ( | void | ) |
query the status byte
void TempMonitor::getTST | ( | void | ) |
enable selftest of the device
void TempMonitor::printComands | ( | void | ) |
this function returns a list of all possible comands supportet by the temperature monitor.
|
protected |
this function reads the answer from the device
rcv | answer from the device |
|
protected |
this function sends a specific comand to the device
cmd | comand to send |
void TempMonitor::setALARM | ( | int | _input, |
bool | _alarm, | ||
int | _source, | ||
double | _high, | ||
double | _low, | ||
double | _dead, | ||
bool | _latch | ||
) |
sets the alarm parameters
_input | specifies the input to configure |
_alarm | sets teh alarm for the input to off or on |
_source | specifies input data to check (1=Kelvin, 2=Celsius, 3=sensor units, 4=linear data) |
_high | value the source is checked against to activate high alarm level |
_low | value the source is checked against to activate low alarm level |
_dead | the value that the source must change outside of an alarm condition to deactivate an unlatched alarm |
_latch | Specifies a latched alarm (remains active after alarm condition correction) |
void TempMonitor::setALMB | ( | bool | _beep | ) |
sets the audible alarm beeper on or off
_beep | on(true) or off(false) |
void TempMonitor::setALMRST | ( | void | ) |
clear alarm status for all inputs
void TempMonitor::setANALOG | ( | int | _output, |
bool | _bipolar, | ||
int | _mode, | ||
int | _input, | ||
int | _source, | ||
double | _high, | ||
double | _low, | ||
double | _manual | ||
) |
configure analog output parameters
_output | specifies the output (1 or 2) |
_bipolar | specifies analog output (0=positiv only, 1=bipolar) |
_mode | data for the analog output to monitor (0=off, 1=input, 2=manual) |
_input | specifies the input to monitor if _mode=1 |
_source | specifies input data (1=Kelvin, 2=Celsius, 3=sensor units, 4=linear equation) |
_high | If _mode=1, this parameter represents the data at which the analog output reaches +100% output |
_low | If _mode=1, this parameter represents the data at which the analog output reaches -100% output if bipolar or 0% else |
_manual | if _mode=2, this parameter is the output of the analog output |
void TempMonitor::setBAUD | ( | int | _baud | ) |
sets the serial interface baudrate
_baud | specifies baud rate (0=300, 1=1200, 2=9600) |
void TempMonitor::setCLS | ( | void | ) |
command to clear the interface of the device
void TempMonitor::setCRVDEL | ( | int | _curve | ) |
delete user curve
_curve | specifies which curve to delete (21-28) for inputs 1-8 |
void TempMonitor::setCRVHDR | ( | int | _curve, |
std::string | _name, | ||
std::string | _sn, | ||
int | _format, | ||
double | _limit, | ||
int | _coeff | ||
) |
configure the curve header
_curve | specifies which curve to configure (21-28) for inputs 1-8 |
_name | specifies curve name (max 15 chars) |
_sn | serial number for the curve (max 10 chars) |
_format | curve data format (2=V/K, 3=Ohm/K, 4=log(Ohm/K) |
_limit | curve temperature limit in Kelvin |
_coeff | temperature coefficient (1=negative, 2=positive) |
void TempMonitor::setCRVPT | ( | int | _curve, |
int | _index, | ||
double | _units, | ||
double | _temp | ||
) |
configure curve data point
_curve | specifies which curve to configure (21-28) for inputs 1-8 |
_index | specifies which point index in the curve (1-200) |
_units | specifies sensor units for this point to 6 digits |
_temp | specifies corresponding temperature in Kelvin for this point to 6 digits |
void TempMonitor::setDATETIME | ( | int | _MM, |
int | _dd, | ||
int | _yy, | ||
int | _hh, | ||
int | _mm, | ||
int | _ss | ||
) |
sets date and time
_MM | month (1-12) |
_dd | day (1-31) |
_yy | year (00-99) |
_hh | hour (0-23) |
_mm | minute (0-59) |
_ss | second (0-59) |
void TempMonitor::setDFLT | ( | void | ) |
set to factory defaults
void TempMonitor::setDISPFLD | ( | int | _loc, |
int | _input, | ||
int | _source | ||
) |
configure display parameters
_loc | display location (1-8) |
_input | specifies input to display in that location (0-8) (0=none) |
_source | specifies input data to display (1=Kelvin, 2=Celsius, 3=sensor units, 4=linear data, 5=minimum data, 6=maximum data) |
void TempMonitor::setESE | ( | int | _weight | ) |
sets the configure status reports in the standard event register
_weight | bit weighting |
void TempMonitor::setFILTER | ( | int | _input, |
bool | _filter, | ||
int | _points, | ||
int | _win | ||
) |
configure input filter paramters
_input | specifies input to configure (1-8) |
_filter | sets filter to off(false) or on(true) |
_points | amount of data points for the filtering function (2-64) |
_win | Specifies what percent of full scale reading limits the filtering function (1-10). Reading changes greater than this percentage reset the filter |
void TempMonitor::setIEEE | ( | int | _term, |
bool | _eoi, | ||
int | _adr | ||
) |
configure IEEE-488 interface parameters
_term | specifies the terminator (0=<CR><LF>, 1=<LF><CR>, 2=<LF>, 3=no terminator) |
_eoi | disables(flase)/enables(true) the EOI mode |
_adr | specifies the IEEE address |
void TempMonitor::setINCRV | ( | int | _input, |
int | _curve | ||
) |
configure curve input number
_input | specifies which input to configure (1-8) |
_curve | specifies which curve the input uses (0=none, 1-5=std diode curves, 6-9=std platinum curves, 21-28=user curves) |
|
private |
this function is used to set the m_IpInfo variable to a specific string
void TempMonitor::setINPUT | ( | int | _input, |
bool | _use | ||
) |
configure input control parameter
_input | specifies input (1-8) |
_use | turns input off(false) or on(true); |
void TempMonitor::setINTYPE | ( | char | _group, |
int | _type | ||
) |
configure input type parameters
_group | specifies input group (A=1-4, B=5-8) |
_type | specifies the input sensor type (0=2.5V Diode, 1 = 7.5V Diode, 2=250Ω Platinum, 3=500Ω Platinum, 4=5kΩ Platinum, 5=Cernox) |
void TempMonitor::setLINEAR | ( | int | _input, |
double | _varM, | ||
int | _source, | ||
double | _varB | ||
) |
configure input linear equation parameters
_input | specifies input (1-8) |
_varM | specifies a value for m in the equation |
_source | specifies input data (1=Kelvin, 2=Celsius, 3=sensor units) |
_varB | specifies a value for b in the equation |
void TempMonitor::setLOCK | ( | bool | _lock, |
int | _code | ||
) |
configure Lock-out and Lock-out code
_lock | disables(false)/enables(true) the keypad lock-out |
_code | specifies lock-out code (000-999) |
void TempMonitor::setLOG | ( | bool | _log | ) |
turns logging on or off
_log | true=on, false=off |
void TempMonitor::setLOGREAD | ( | int | _num, |
int | _input, | ||
int | _source | ||
) |
configure log records
_num | specifies the reading number (1-8) within a log record to configure |
_input | the input to log (1-8) |
_source | data source to log (1=Kelvin, 2=Celsius, 3=sensor units, 4=linear data) |
void TempMonitor::setLOGSET | ( | int | _mode, |
bool | _over, | ||
int | _start, | ||
int | _period, | ||
int | _read | ||
) |
configure logging paramters
_mode | specifies logging mode (0=off, 1=log continous, 2=log event, 3=print continous, 4=print event) |
_over | specifies overwrite mode (true=overwrite data, false=do not overwrite data) |
_start | specifies start mode (0=clear, 1=continue) |
_period | specifies period in seconds (1-3600). If _mode=3 minimum period is 10 |
_read | specifies number of readings per record (1-8) |
void TempMonitor::setMNMX | ( | int | _input, |
int | _source | ||
) |
configure minimun and maximum input function parameters
_input | specifies input to configure (1-8) |
_source | specifies input data to process through max/min (1=Kelvin, 2=Celsius, 3=sensor units, 4=linear data) |
void TempMonitor::setMNMXRST | ( | void | ) |
reset all min/max function for all inputs
void TempMonitor::setMODE | ( | int | _mode | ) |
configure remote interface mode
_mode | specifies the operation mode (0=local, 1=remote, 2=remote with local lock-out) |
void TempMonitor::setOPC | ( | void | ) |
sets operation complete command
void TempMonitor::setRELAY | ( | int | _relay, |
int | _mode, | ||
int | _input, | ||
int | _type | ||
) |
configure relay control parameters
_relay | specifies which relay to configure (1-8) |
_mode | specifies relay mode (0=off, 1=on, 2=alarms) |
_input | specifies which input alarm activates the relay when in alarm mode (1-8) |
_type | specifies the alarm type (0=low alarm, 1=high alarm, 2=both alarms) |
void TempMonitor::setRST | ( | void | ) |
reset the instrument
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
_std | specifies the standard curve to generate SoftCal from (1,6,7) |
_dest | specifies the user curve to store the SoftCal curve (21-28) |
_sn | specifies the curve serial number (max 10 chars) |
_t1 | specifies the first temperature point |
_u1 | specifies the first sensor units point |
_t2 | specifies the second temperature point |
_u2 | specifies the second sensor units point |
_t3 | specifies the third temperature point |
_u3 | specifies the third sensor units point |
void TempMonitor::setSRE | ( | int | _weight | ) |
set the status reports in the service request enable register
_weight | bit weighting |
|
private |
this string contains the latest answer from the device
|
private |
this is the chatline that is used to comunicate with the device
|
private |
this vector contains the comands supported by the temperature monitor
|
private |
this string contains the connection informations (ip adress, port) to build the chatLine
|
private |
this boolean indicates if there is an active connection to a device
|
private |
this string contains the current terminators for the sending of the commands