2 #include "SutterController.h"
3 #include "helpers\ScopeException.h"
5 #include "controllers\ScopeLogger.h"
7 #ifdef SCOPE_USE_SUTTER_XYZSTAGE
11 std::mutex SutterController::mutex;
13 SutterController::SutterController(
const std::wstring& _comstring)
14 : comstring(_comstring) {
17 SerialConnection& SutterController::Ctrl() {
18 return CreateInstance(comstring);
21 void SutterController::CheckError(
const std::vector<BYTE>& _received) {
23 if ( _received.back() != 0x0D )
24 throw ScopeException(
"SutterController::CheckError");
27 std::vector<BYTE> SutterController::Command(
const std::string& _cmd,
const uint32_t& _answerbytes) {
28 std::lock_guard<std::mutex> lock(mutex);
29 if ( _cmd.back() !=
'\r' ) {
30 DBOUT(L
"SutterController::Command command not terminated by CR!");
31 return std::vector<BYTE>(_answerbytes, 0);
36 std::vector<BYTE> received(Ctrl().Receive(_answerbytes));
41 SerialConnection& SutterController::CreateInstance(
const std::wstring& _comstring) {
43 std::wstring realcomstring = L
"//.//" + _comstring;
45 static std::unique_ptr<SerialConnection> connection(
new SerialConnection(realcomstring));
This is the include file for standard system include files, or project specific include files that ar...
bool CheckError(const int32 &error)
Checks return value of NI DAQmx function for error, prints out error information and throws an except...
#define DBOUT(s)
A debug output to the debug console.
Various helper functions and classes for Scope.