Dies ist eine alte Version des Dokuments!
The „ecmasterlib“ offer an easy way to use EtherCAT with EEROS or in a standalone project.
You may need to implement your own interfaces for other drives and terminals.
Once the EtherCAT stack has been installed and the demo application is running, the ecmasterlib can be installed.
$ cd path/to/working/directory $ git clone https://gitlab.ost.ch/tech/inf/public/ecmasterlib $ cd ecmasterlib $ mkdir externalLib $ cp ''<classB_path>''/SDK/LIB/Linux/x64/libAtemRasSrv.a externalLib $ cp ''<classB_path>''/SDK/LIB/Linux/x64/libEcMaster.a externalLib $ mkdir build-x86-64 $ cd build-x86-64 $ cmake -DCMAKE_INSTALL_PREFIX=/absolute/path/to/working/directory/install-x86-64 .. $ make $ make install
The examples show how to use the interfaces, e.g.
ecmasterlib::device::beckhoff::EL1008 inputs{}; auto &stack = ecmasterlib::EcMasterlibMain::createInstance(argc, argv, inputs); std::cout << inputs[0] << std::endl; // reads first digital input channel
You create an interface instance which must be passed to the EtherCAT stack. See the examples within ecmasterlib. Elmo drives could be used as follows
ecmasterlib::device::Elmo drive{}; auto &stack = ecmasterlib::EcMasterlibMain::createInstance(argc, argv, drive); sleep(10); std::cout << "init start\n"; drive.init([&stack]() { stack.sync(); }); drive.setMode(ecmasterlib::device::Elmo::Mode::PROFILE_VELOCITY); drive.setTargetVelocity(1000); drive.setMaximumTorque(300); std::cout << "loop start\n"; while(stack.isRunning()) { std::cout << "Current Position: " << drive.getPosition() << '\n'; sleep(1); }
The components EtherCATInterfaceElmo_config, getDrivesBlock and setDrivesBlock need to be adjusted whenever you change the variables, which are transmitted via PDOs (periodic sent/received messages by the EtherCAT bus). These components must also be adapted when creating a new EEROS application.
interface is specific for Gold Twitter drives from ElmoMC. Other drives (i.e. Maxon Maxpos 50/5) need a different interface.
You may copy and adapt EtherCATInterfaceElmo for your drive type.
EEROS > EtherCATInterfaceElmo > ecmasterlib & EtherCATInterfaceBase > Acontis Stack