Scope
XYControlStanda.h
1 #pragma once
2 
3 #include "ScopeDefines.h"
4 
5 // Only use this code if we need it
6 #ifdef SCOPE_USE_STANDA_XYFPUSTAGE
7 
8 #include "XYControl.h"
9 #include "USMCDLL.h"
10 
11 // Link to the Standa library. The path to that library has to be in your Scope properties->Linker->General->"Additional library directories" path!
12 #pragma comment(lib, "USMCDLL.lib")
13 
14 // Forward declaration
15 namespace scope{
16  namespace parameters {
17  class XYControlStanda;
18  }
19 }
20 
21 namespace scope {
22 
25 class XYControlStanda :
26  public XYControl {
27 
28 protected:
30  std::mutex mutex;
31 
33  std::array<DWORD, 2> dev;
34 
36  float speed;
37 
39  double microsteps_per_micron;
40 
43  USMC_Devices devices;
44  USMC_State state;
45  USMC_StartParameters stprms;
46  USMC_Parameters prms;
47  USMC_Mode mode;
48  USMC_EncoderState enstate;
51 protected:
53  void InitAxis(const DWORD& _device);
54 
56  void CheckError(const DWORD& errorcode);
57 
59  void TurnOffAndSaveToFlash(const DWORD& _device);
60 
61 public:
62  XYControlStanda();
63 
65  ~XYControlStanda();
66 
68  virtual void Initialize(parameters::XYControlStanda& _params);
69 
71  virtual void StartPolling() override;
72 
73  virtual void UpdatePositionValues() override;
74 
76  virtual void SetZero() override;
77 
80  virtual void MoveRelative(const double& _xrel, const double& _yrel) override;
81 
84  virtual void MoveAbsolute(const double& _xabs, const double& _yabs) override;
85 
87  std::wstring GetParameters();
88 
90  std::wstring GetMode();
91 
93  std::wstring GetState();
94 
96  std::wstring GetStartParameters();
97 };
98 
99 }
100 
101 #endif
bool CheckError(const int32 &error)
Checks return value of NI DAQmx function for error, prints out error information and throws an except...
Definition: DAQmxTask.cpp:9