Infineon XMC4800 Getting Started

XMC4800
EtherCAT APP SSC
Slave Example
Getting Started V3.0
1
2
3
4
5
6
Overview and Requirements
Setup
Defining the interface of EtherCAT slave node
Implementation of the application
How to test – using TwinCAT2 as host
7
How to test – using TwinCAT3 as host
Copyright © Infineon Technologies AG 2016. All rights reserved.
2
1
2
3
4
5
6
Overview and Requirements
Setup
Defining the interface of EtherCAT slave node
Implementation of the application
How to test – using TwinCAT2 as host
7
How to test – using TwinCAT3 as host
Copyright © Infineon Technologies AG 2016. All rights reserved.
3
Overview
This example demonstrates the implementation of a EtherCAT slave node using the Beckhoff SSC Tool to generate the slave stack code for „XMC4800 Relax EtherCAT Kit“.
While reviewing this example you will see in output direction the EtherCAT
master controlling the 8 LEDs on the „XMC EtherCAT PHY Board“
and dimming LED2 of the Relax Kit. In input direction you will
monitor inside the master device the status of the buttons available on the Relax Kit. You will observe inside the source code how to modify the mapping of the data structures to the I/Os for your own
evaluations and testing. Furthermore you will learn how to modify
the data structures and generate a slave stack code which fits to your needs. In this example we will demonstrate how easy it is to setup a proper EtherCAT communication by using the EtherCAT APP.
Copyright © Infineon Technologies AG 2016. All rights reserved.
4
Requirements
XMC4800 Relax EtherCAT Kit
RJ45 Ethernet Cable
Windows Laptop installed
- DAVE v4 (Version4.1.4 or higher)
- TwinCAT2 or TwinCAT3 Master PLC
- Slave Stack Code Tool Version 5.12
Micro USB Cable (Debugger connector)
Copyright © Infineon Technologies AG 2016. All rights reserved.
5
Requirements - free downloads
TwinCAT2 (30 day trial; 32bit Windows
only)
Link: Download TwinCAT2
or
TwinCAT3 (no trial period; usability limited;
32bit and 64bit Windows)
Link: Download TwinCAT3
ATTENTION: According our experience TwinCAT is best compatible with Intel™ ethernet chipset. For details on compatibility with your hardware, additional driver and
general installation support please get into contact with your local
BECKHOFF support.
Copyright © Infineon Technologies AG 2016. All rights reserved.
6
Requirements - free downloads
DAVE (v4.1.4 or higher)
Link: Download DAVE (Version 4)
EtherCAT Slave Stack Code Tool Version 5.12
(ETG membership obligatory)
Link: Slave Stack Code Tool
Copyright © Infineon Technologies AG 2016. All rights reserved.
7
1
2
3
4
5
6
Overview and Requirements
Setup
Defining the interface of EtherCAT slave node
Implementation of the application
How to test – using TwinCAT2 as host
7
How to test – using TwinCAT3 as host
Copyright © Infineon Technologies AG 2016. All rights reserved.
8
Setup – Hardware
Micro USB cable Debugger connected to
X101 debug
connector
Ethernet Cable
connected to IN-port
Copyright © Infineon Technologies AG 2016. All rights reserved.
9
Setup – Import example project into DAVE
1. 2.
1 2
3
3.
Copyright © Infineon Technologies AG 2016. All rights reserved.
10
Setup – Import example project into DAVE
After the project import you will find this project folder structure.
1
The project is nearly complete for building, it only misses the
EtherCAT slave stack code. For
these files the Src folder has been already prepared.
2
The EtherCAT slave stack code
for the XMC4800 can be generated
by configuration files. These
1
configuration files are included in
2
the project already.
The following slides show in detail
how to define your EtherCAT slave node interface and to generate the slave stack code.
Copyright © Infineon Technologies AG 2016. All rights reserved.
11
1
2
3
4
5
6
Overview and Requirements
Setup
Defining the interface of EtherCAT slave node
Implementation of the application
How to test – using TwinCAT2 as host
7
How to test – using TwinCAT3 as host
Copyright © Infineon Technologies AG 2016. All rights reserved.
12
The flow to define the EtherCAT slave node
interface
1
1
Take the Excel Worksheet provided inside the example project to define your EtherCAT slave node interface.
2
The Beckhoff SSC-tool uses
2
3 4
the excel sheet as an input to generate the output-files.
3
The generated EtherCAT slave stack code does apply for the XMC4800.
4
The generated EtherCAT Slave Information file (ESI) does apply for the EtherCAT host. There the relevant interface information about the slave is stored.
Copyright © Infineon Technologies AG 2016. All rights reserved.
13
Defining the interface of EtherCAT slave node
1
1
Double click on the excel file
to open it.
2
Check the content of the file. The data defined in both I/O
2
directions is 4x16bit integers
and 8x1bit booleans.
3
For further details on how to define your own interface you may want to follow the
instructions inside EtherCAT Slave Design Quick Guide.pdf inside SSC
tool.
Copyright © Infineon Technologies AG 2016. All rights reserved.
14
1
2
3
4
5
6
Overview and Requirements
Setup
Defining the interface of EtherCAT slave node
Implementation of the application
How to test – using TwinCAT2 as host
7
How to test – using TwinCAT3 as host
Copyright © Infineon Technologies AG 2016. All rights reserved.
15
Generating Slave Stack Code and ESI file
1
2
1
Start the tool and create a
new project File >> New
2
Select the configuration file which you find inside the example project.
Copyright © Infineon Technologies AG 2016. All rights reserved.
16
Generating Slave Stack Code and ESI file
3 3
Select the Infineon device
inside the drop down list and confirm with the OK button. Your project will be created.
Copyright © Infineon Technologies AG 2016. All rights reserved.
17
Generating Slave Stack Code and ESI file
Check the settings inside SlaveInformation: vendor ID, vendor name,
product ID and product code are customer specific and are used by the host
to identify the slave.
Define revision number, serial number, device name, HW/SW version
according to your needs.
The vendor ID/name and product code assigned to infineon may be used for
evaluation purpose only. For productive purpose your own vendor ID/name
assigned by the EtherCAt Technology Group is obligatory.
Copyright © Infineon Technologies AG 2016. All rights reserved.
18
Generating Slave Stack Code and ESI file
4 4
Import the EXCEL-sheet
which defines the interface of your EtherCAT node.
5
Select the EXCEL-file
5
provided inside the example project.
Copyright © Infineon Technologies AG 2016. All rights reserved.
19
Loading...
+ 42 hidden pages