Upload
others
View
40
Download
2
Embed Size (px)
Citation preview
EtherCAT SDK provided by rt-labs
Visit us at :
http://www.rt-labs.com/
https://github.com/OpenEtherCATsociety
EtherCAT the simple way
1. Install DAVE , get @
2. Install EtherCAT SDK , get@
3. EtherCAT slave stack SOES for XMC4, get @
4. Create your application
Run DAVE
Install EtherCAT SDK from rt-labsHelp-> Install New Software-> Select EtherCAT SDK ZIP
Get here:
Add the SOES slave stack projectFile->Import->General->Existing Projects into workspace->Select archive file
Get here:
Create the EtherCAT slave applicationFile->New->DAVE Project-><Projet Type of your choice>
Choose XMC4300 or XMC4800
Link the the slave stack projectFile->Import->General->File system, check ”Create links in workspace”
Add slave stack includes<Project>->Properties->C/C++ Build->Settings
EtherCAT SDK - Slave editor projectFile->Other->EtherCAT->EtherCAT Slave Description
Slave editor project (2)Create a slave description project file and whre to place it.
Slave editor project (3)Enter the base parameters
Slave editor project (4)Slave TAB: Edit and add base parameters
Slave editor project (5)Configuartion TAB: Basic configuration setting
Slave editor project (6)EEPROM TAB: Use this PDI Control settings, they’re aligned with ReadOnly ESC values.
Slave editor project (7)Application TAB: Add application IO for PDO range 0x6000 and 0x7000, parameters for 0x8000.
Slave editor project (8)Object Dictionary TAB: Overview of the resulting Object Dictinay
Slave editor project (9)Generate output: - for ESI data XML & EEPROM, - C code, Object Dictionary & Slave application
Slave editor project (10)Generated output:
• utypes, typesfor user defined application data
• <slave_editor project>_objectlist.c, Object Dictionary
• <slave_editor project>_slave.[c,h], slave stack application
functions and declarations
• <slave_editor project>_slave.bin, EEPROM
• <slave_editor project>_slave.xml, ESI file
Don’t EDIT this files since the will be overwritten if
Code is generated again.
Finialize the Slave ApplicationAdd calls to the SOES slave stack , soes_init and soes.
Stack generated application code needto be defined, cb_set_LEDs & cb_get_Buttons.
The emulated EEPROM needs to be linked
Finialize the Slave ApplicationAdd application code in a NOT generated file. We add the xmc4300 LED and Buttons.
linked
Create linkable EEPROM and linkAdd and pre-build option to copy and create a linkable object file.
The only required change is to add your EEPROM bin in the copy command, eg. replace xmc4300_slave.bin with your name.
Add the resulting object fileto the linker.
Continue, Build and Debug, Edit, Buildand Debug
• The whole idea with the slave editor is to keep EEPROM, ESI and OD aligned, youshould always be CTT ready.
• To continue editing, just double click the Slave Editor project file, re-generate the code, build and debug.
• Test the slave with EherCAT SDK – EthcerCAT Explorer
EtherCAT SDK - EtherCAT ExplorerWindow->Perspective->Open perspective->Other->EtherCAT Explorer
Select NIC, available adapters, Ethercat Explorer require Winpcap.
EtherCAT SDK - EtherCAT ExplorerStart the master with the arrow. An started master is shutdown with the arrow.
EtherCAT SDK - EtherCAT ExplorerExlpore the slave process data, button press =1.
EtherCAT SDK - EtherCAT ExplorerExlpore the slave Object Dictionary. Refresh values with arrow
Final step – run CTT