ethercat sdk provided by rt-labs · slave editor project (10) generated output: • utypes,...

28
EtherCAT SDK provided by rt-labs Visit us at : http://www.rt-labs.com/ https://github.com/OpenEtherCATsociety

Upload: others

Post on 17-Sep-2020

21 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

EtherCAT SDK provided by rt-labs

Visit us at :

http://www.rt-labs.com/

https://github.com/OpenEtherCATsociety

Page 2: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

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

Page 3: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Run DAVE

Page 4: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Install EtherCAT SDK from rt-labsHelp-> Install New Software-> Select EtherCAT SDK ZIP

Get here:

Page 5: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Add the SOES slave stack projectFile->Import->General->Existing Projects into workspace->Select archive file

Get here:

Page 6: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Create the EtherCAT slave applicationFile->New->DAVE Project-><Projet Type of your choice>

Page 7: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Choose XMC4300 or XMC4800

Page 8: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Link the the slave stack projectFile->Import->General->File system, check ”Create links in workspace”

Page 9: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Add slave stack includes<Project>->Properties->C/C++ Build->Settings

Page 10: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

EtherCAT SDK - Slave editor projectFile->Other->EtherCAT->EtherCAT Slave Description

Page 11: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Slave editor project (2)Create a slave description project file and whre to place it.

Page 12: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Slave editor project (3)Enter the base parameters

Page 13: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Slave editor project (4)Slave TAB: Edit and add base parameters

Page 14: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Slave editor project (5)Configuartion TAB: Basic configuration setting

Page 15: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Slave editor project (6)EEPROM TAB: Use this PDI Control settings, they’re aligned with ReadOnly ESC values.

Page 16: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Slave editor project (7)Application TAB: Add application IO for PDO range 0x6000 and 0x7000, parameters for 0x8000.

Page 17: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Slave editor project (8)Object Dictionary TAB: Overview of the resulting Object Dictinay

Page 18: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Slave editor project (9)Generate output: - for ESI data XML & EEPROM, - C code, Object Dictionary & Slave application

Page 19: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

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.

Page 20: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

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

Page 21: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Finialize the Slave ApplicationAdd application code in a NOT generated file. We add the xmc4300 LED and Buttons.

linked

Page 22: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

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.

Page 23: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

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

Page 24: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

EtherCAT SDK - EtherCAT ExplorerWindow->Perspective->Open perspective->Other->EtherCAT Explorer

Select NIC, available adapters, Ethercat Explorer require Winpcap.

Page 25: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

EtherCAT SDK - EtherCAT ExplorerStart the master with the arrow. An started master is shutdown with the arrow.

Page 26: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

EtherCAT SDK - EtherCAT ExplorerExlpore the slave process data, button press =1.

Page 27: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

EtherCAT SDK - EtherCAT ExplorerExlpore the slave Object Dictionary. Refresh values with arrow

Page 28: EtherCAT SDK provided by rt-labs · Slave editor project (10) Generated output: • utypes, typesfor user defined application data • _objectlist.c, Object

Final step – run CTT