Select Git revision
KeithleySCPIProtocol.cpp
-
Xavier ELATTAOUI authored
MEAS? cmd changed. Now READ? is called instead.
Xavier ELATTAOUI authoredMEAS? cmd changed. Now READ? is called instead.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
KeithleySCPIProtocol.cpp 31.98 KiB
// ============================================================================
//
// = CONTEXT
// TANGO Project - SCPI KeithleySCPIProtocol Support Library
//
// = FILENAME
// KeithleySCPIProtocol.cpp
//
// = AUTHOR
// X. Elattaoui
//
// ============================================================================
// ============================================================================
// DEPENDENCIES
// ============================================================================
#include <iostream>
#include <sstream>
#include <string>
#include <Xstring.h>
#ifndef WIN32
# include <unistd.h>
#endif
//# include
//#endif
#include "KeithleySCPIProtocol.h"
#include "TangoGpibLink.h"
// ============================================================================
// KeithleySCPIProtocol::KeithleySCPIProtocol
// ============================================================================
KeithleySCPIProtocol::KeithleySCPIProtocol (std::string& gpib_device_name)
: ElectrometerProtocol(),
isDiffSuportedMode(false),
trigCountStr("")
{
std::cout << "KeithleySCPIProtocol::KeithleySCPIProtocol <-" << std::endl;
_communication_link = new TangoGpibLink (gpib_device_name);
std::string cmd_to_send("");
//- Select reading only
cmd_to_send = "FORM:ELEM READ";
_communication_link->write(cmd_to_send);
//- Select control source : IMMediate
cmd_to_send = "ARM:SOUR IMM";
_communication_link->write(cmd_to_send);
//- Set measure count
cmd_to_send = "ARM:COUNT 1";
_communication_link->write(cmd_to_send);
std::cout << "KeithleySCPIProtocol::KeithleySCPIProtocol ->" << std::endl;
}
// ============================================================================
// KeithleySCPIProtocol::~KeithleySCPIProtocol
// ============================================================================
KeithleySCPIProtocol::~KeithleySCPIProtocol (void)
{
std::cout << "KeithleySCPIProtocol::~KeithleySCPIProtocol <-" << std::endl;
std::cout << "KeithleySCPIProtocol::~KeithleySCPIProtocol ->" << std::endl;
}
// ============================================================================
// KeithleySCPIProtocol::set_range
// ============================================================================
void KeithleySCPIProtocol::set_range (std::string value)
{
std::string cmd_to_send("");