Build an EtherCAT Slave
Quick Build EtherCAT Slave
Esmacat is an easy yet powerful EtherCAT solution for robot mechatronics developed by Harmonic Bionics. It provides a full EtherCAT hardware and software solution for Master and Slave devices which allows developers to set up and run an EtherCAT application within minutes. It also supports Power-over-EtherCAT (POE) technology which allows high-speed communication and logic-power supply over a single Ethernet cable simplifying the cabling and wiring needs of the system significantly.
EtherCAT Arduino Shield by Esmacat (EASE) is a shield which can be used to build a Slave device. It stacks onto Mbed boards with form factor of Arduino UNO. The Mbed Base board communicates with EASE over SPI. EASE communicates with the Master over EtherCAT. Multiple EASE boards can be connected with Ethernet cables in a daisy-chain topology.
Information about the hardware needs and setup is provided in the link below. https://os.mbed.com/users/esmacat/code/EASE_Example/wiki/Hardware-Setup
Information about the structure of the system and it's software is provided in the link below. https://os.mbed.com/users/esmacat/code/EASE_Example/wiki/Software
Revision 1:ee9b73e47960, committed 2020-02-06
- Comitter:
- pratima_hb
- Date:
- Thu Feb 06 22:33:12 2020 +0000
- Parent:
- 0:ba190577ec8a
- Commit message:
- Updated the Example as per the datatype updates in the EsmacatShield Library.
Changed in this revision
EsmacatShield.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r ba190577ec8a -r ee9b73e47960 EsmacatShield.lib --- a/EsmacatShield.lib Thu Jan 30 16:11:22 2020 +0000 +++ b/EsmacatShield.lib Thu Feb 06 22:33:12 2020 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/users/pratima_hb/code/EsmacatShield/#b66c3e4ce9f5 +https://os.mbed.com/users/pratima_hb/code/EsmacatShield/#77c2a6061e77
diff -r ba190577ec8a -r ee9b73e47960 main.cpp --- a/main.cpp Thu Jan 30 16:11:22 2020 +0000 +++ b/main.cpp Thu Feb 06 22:33:12 2020 +0000 @@ -1,10 +1,43 @@ +/** + ****************************************************************************** + * @file main.cpp + * @date February 06, 2020 + * @brief mbed test application - Esmacat Shield(EASE) working together with + * Base Board with Arduino UNO form factor as EtherCAT slave. + * With the successful execution of this code the LED on EASE should + * blink. It should also estabilish data transfer between the EtherCAT + * Master of Esmacat on the PC. + * For further information please refer to the tutorials at + * https://www.esmacat.com/tutorials + ****************************************************************************** + + Copyright (c) 2020 https://www.esmacat.com/ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + EsmacatShield.h - Library for using EtherCAT Arduino Shield by Esmacat(EASE). + Created by Esmacat, 01/22/2020 + +******************************************************************************* +* @file EsmacatShield.h +******************************************************************************* +*/ #include "mbed.h" #include <EsmacatShield.h> //Include EsmacatShield Library int counter; -int v[8]; //an array of integer is declared for reading the +int16_t v[8]; //an array of integer is declared for reading the //data packet of EtherCAT from EASE 8 registers Serial pc(USBTX, USBRX); // Configuring the serial port to host PC @@ -31,7 +64,7 @@ for (int i=0;i<8;i++) //Print out read registers to host PC terminal { pc.printf("%d",i); - pc.printf("\t"); + pc.printf(" "); pc.printf("%d",v[i]); pc.printf("\n"); }