00001 #ifndef ETHERCAT_DEMO_IO_HPP
00002 #define ETHERCAT_DEMO_IO_HPP
00003
00004 #include <vector>
00005 #include <rtt/RTT.hpp>
00006
00007 #include <rtt/TaskContext.hpp>
00008 #include <rtt/Ports.hpp>
00009 #include <rtt/Event.hpp>
00010 #include <rtt/Properties.hpp>
00011 #include <rtt/Command.hpp>
00012
00013 #include <rtt/dev/AnalogOutput.hpp>
00014 #include <rtt/dev/DigitalOutput.hpp>
00015
00016 #include <ocl/OCL.hpp>
00017
00018 struct netif;
00019
00020 namespace OCL
00021 {
00025 class EthercatDemoIO : public RTT::TaskContext
00026 {
00027
00028 Property<std::string> rteth;
00029 Method <bool(double)> gen_sin;
00030 bool mgen_sin(double);
00031 Method <void(void)> stop_master;
00032 void mstop_master(void);
00033 struct netif *ni;
00034 int cnt, cnt_dig;
00035 int voltage_i;
00036 float voltage_f, time, sinus_freq;
00037
00038
00039
00040 public:
00041 EthercatDemoIO(std::string name);
00042 ~EthercatDemoIO();
00043
00048 virtual bool startup();
00049
00053 virtual void update();
00054
00058 virtual void shutdown();
00059
00060 };
00061 }
00062 #endif // EthercatDemoIO