Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
embedded_systems:ethercat:ecmasterlib [2021-09-30 09:11] – angelegt Urs Graf | embedded_systems:ethercat:ecmasterlib [2021-11-22 15:34] (aktuell) – Urs Graf | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== ecmasterlib ====== | ====== ecmasterlib ====== | ||
===== Overview ===== | ===== Overview ===== | ||
- | {{ : | ||
- | The //" | + | The //" |
- | * **EEROS**: The robotic framework | ||
* **EtherCAT stack**: The EtherCAT stack from Acontis, see [[embedded_systems: | * **EtherCAT stack**: The EtherCAT stack from Acontis, see [[embedded_systems: | ||
- | * **ecmasterlib**: | + | * **ecmasterlib**: |
- | * **EtherCATInterfaceElmo**: An interface | + | * **Elmo.hpp**: An interface for Elmo drives |
- | * **getDrivesBlock**: It has a signal output | + | * **Beckhoff/ |
- | * **setDrivesBlock**: It has a signal input for every PDO output | + | |
+ | * **Beckhoff/ | ||
+ | * **Beckhoff/ | ||
+ | You may need to implement your own interfaces for other drives and terminals. | ||
===== Installation ===== | ===== Installation ===== | ||
- | Please make sure that you have previously installed the EtherCAT stack software and EEROS beforehand. Install EEROS as described in [[http:// | ||
- | < | ||
- | ... | ||
- | cmake -DCMAKE_INSTALL_PREFIX=/ | ||
- | ... | ||
- | </ | ||
- | |||
- | ==== Install ecmasterlib ==== | ||
Once the EtherCAT stack has been installed and the demo application is running, the // | Once the EtherCAT stack has been installed and the demo application is running, the // | ||
< | < | ||
$ cd path/ | $ cd path/ | ||
- | $ git clone https://github.com/ntb-ch/ | + | $ git clone https://gitlab.ost.ch/ |
$ cd ecmasterlib | $ cd ecmasterlib | ||
$ mkdir externalLib | $ mkdir externalLib | ||
$ cp ''< | $ cp ''< | ||
$ cp ''< | $ cp ''< | ||
- | $ mkdir build-x86-64 | ||
- | $ cd build-x86-64 | ||
- | $ cmake -DCMAKE_INSTALL_PREFIX=/ | ||
- | $ make | ||
- | $ make install | ||
- | </ | ||
- | |||
- | ==== Install EtherCATInterfaceElmo ==== | ||
- | < | ||
- | $ cd path/ | ||
- | $ git clone https:// | ||
- | $ cd EtherCATInterfaceElmo | ||
$ mkdir build-x86-64 | $ mkdir build-x86-64 | ||
$ cd build-x86-64 | $ cd build-x86-64 | ||
Zeile 51: | Zeile 32: | ||
===== Functionality ===== | ===== Functionality ===== | ||
- | The //" | + | The examples show how to use the interfaces, e.g. |
- | This method: | + | <code cpp> |
- | * Copies the received data from the stack into the receive buffer of //"ecmasterlib"// | + | ecmasterlib: |
- | * Copies the data to be sent from the send buffer of //" | + | auto &stack = ecmasterlib:: |
- | The receive and send buffers of //" | + | std::cout << inputs[0] << std:: |
+ | </code> | ||
+ | You create an interface instance which must be passed to the EtherCAT stack. See the examples within [[https:// | ||
+ | <code cpp> | ||
+ | ecmasterlib:: | ||
+ | auto &stack = ecmasterlib:: | ||
+ | sleep(10); | ||
+ | std::cout << "init start\n"; | ||
+ | drive.init([& | ||
+ | drive.setMode(ecmasterlib:: | ||
+ | drive.setTargetVelocity(1000); | ||
+ | drive.setMaximumTorque(300); | ||
- | The //" | + | std::cout << "loop start\n" |
- | + | while(stack.isRunning()) { | |
- | When an //"ecmasterlib"// object is created, an instance | + | |
- | The stack is started in the same way as in the //" | + | |
- | + | } | |
- | + | </code> | |
- | + | ||
- | ===== Adaptions ===== | + | |
- | ==== Overview ==== | + | |
- | The components | + | |
- | These components must also be adapted when creating a new EEROS application. | + | |
- | ==== Steps ==== | + | See [[embedded_systems: |
- | - Study produced ENI file carefully (use XML viewer). Under < | + | ===== Modifications ===== |
- | - Adjust headerfile accordingly, | + | If you switch to other drives or terminals or if you want to transmit a different set of PDOs, you have to undertake the following steps |
- | - Make necessary adaptions in // | + | - Create or modify ENI-Files |
+ | - Create or modify interface files accordingly | ||
- | ===== Attachment ===== | ||
- | {{: |