14 #include "userqdppms.h"
15 #include "charinterface.h"
18 REGISTER_TYPE(
XDriverList, QDPPMS6000,
"Quantum Design PPMS low-level interface");
20 XQDPPMS6000::XQDPPMS6000(
const char *name,
bool runtime,
21 Transaction &tr_meas,
const shared_ptr<XMeasure> &meas) :
23 interface()->setEOS(
"");
24 interface()->setSerialEOS(
"\r\n");
28 XQDPPMS6000::setField(
double field,
double rate,
int approach_mode,
int magnet_mode){
29 interface()->sendf(
"FIELD %f %f %d %d", field*1e4, rate*1e4, approach_mode, magnet_mode);
33 XQDPPMS6000::setPosition(
double position,
int mode,
int slow_down_code){
34 interface()->sendf(
"MOVE %f %d %d", position, mode, slow_down_code);
38 XQDPPMS6000::setTemp(
double temp,
double rate,
int approach_mode){
40 interface()->sendf(
"TEMP %f %f %d", temp, rate, approach_mode);
43 interface()->send(
"SHUTDOWN");
48 XQDPPMS6000::getField(){
50 interface()->query(
"GetDat? 4");
51 if( interface()->scanf(
"4,%*f,%lf", &magnet_field) != 1)
57 XQDPPMS6000::getPosition(){
58 double sample_position;
59 interface()->query(
"GetDat? 8");
60 if( interface()->scanf(
"8,%*f,%lf", &sample_position) != 1)
62 return sample_position;
66 XQDPPMS6000::getTemp(){
68 interface()->query(
"GetDat? 2");
69 if( interface()->scanf(
"2,%*f,%lf", &sample_temp) != 1)
75 XQDPPMS6000::getUserTemp(){
76 double sample_user_temp;
78 interface()->query(
"USERTEMP?");
79 if( interface()->scanf(
"%d,%*f,%*f,%*f,%*f",&is_user_temp) != 1)
82 int user_temp_channel = lrint(pow(2,is_user_temp));
83 interface()->queryf(
"GetDat? %d", user_temp_channel);
84 if( interface()->scanf(
"%*d,%*f,%lf", &sample_user_temp) != 1)
88 sample_user_temp = 0.0;
90 return sample_user_temp;
94 XQDPPMS6000::getHeliumLevel(){
96 interface()->query(
"LEVEL?");
97 if( interface()->scanf(
"%lf,%*f", &helium_level) != 1)
103 XQDPPMS6000::getStatus(){
105 interface()->query(
"GetDat? 1");
106 if( interface()->scanf(
"1,%*f,%d", &status) != 1)