ethercat_manager.h
Go to the documentation of this file.
1 #ifndef ETHERCAT_MANAGER_H
2 #define ETHERCAT_MANAGER_H
3 
4 #include <stdexcept>
5 #include <string>
6 
7 #include <stdint.h>
8 
9 #include <boost/scoped_array.hpp>
10 #include <boost/thread.hpp>
11 #include <boost/thread/mutex.hpp>
12 
14 {
15 
20 class EtherCatError : public std::runtime_error
21 {
22 public:
23  explicit EtherCatError(const std::string& what)
24  : std::runtime_error(what)
25  {}
26 };
27 
38 {
39 public:
49  EtherCatManager(const std::string& ifname);
50 
51  ~EtherCatManager();
52 
63  void write(int slave_no, uint8_t channel, uint8_t value);
64 
71  uint8_t readInput(int slave_no, uint8_t channel) const;
72 
79  uint8_t readOutput(int slave_no, uint8_t channel) const;
80 
81 private:
82  bool initSoem(const std::string& ifname);
83 
84  const std::string ifname_;
85  boost::scoped_array<uint8_t> iomap_;
86  boost::thread cycle_thread_;
87  mutable boost::mutex iomap_mutex_;
88  bool stop_flag_;
89 };
90 
91 }
92 
93 #endif
EtherCAT exception. Currently this is only thrown in the event of a failure to construct an EtherCat ...
This class provides a CPP interface to the SimpleOpenEthercatMaster library Given the name of an ethe...
unsigned char uint8_t
EtherCatError(const std::string &what)
boost::scoped_array< uint8_t > iomap_


robotiq_ethercat
Author(s): Jonathan Meyer
autogenerated on Tue Jun 1 2021 02:29:53