Creating an application without GOAL

This chapter describes all necessary steps for creating an application for the EtherCAT library that runs without GOAL.

Files created by the Industrial Communication Creator

The Industrial Communication Creator (ICC) must be used to specify the options for the library and to define the layout of the object dictionary.
Please refer to the manual of the ICC for details.

The following source files are created:

File

Description

File

Description

ecat_conf.h

contains all configuration macros

ec_od.c

contains the object dictionary tables

ec_objects.{c|h}

contains all application variables of the object dictionary

Table: Source code files generated by the ICC

 

These files are considered to be part of the application. Other files generated by the ICC are ignored for this chapter.

The object dictionary either has managed variables or application variables.

Managed variables are only accessible via the OD API of the library.
Application variables are declared in ec_objects.{c|h} and can be used directly.

Application modules

The examples delivered with the EtherCAT library provide a good starting point for developing your own application.

IMPORTANT: Always include ecat_conf.h first before including any other EtherCAT header files.

By including ec_header.h you have access to all public functions and defines. Additionally you can include ec_objects.h if you want to use the application variables of the object dictionary.

The file main.c demonstrates how to initialize and use the EtherCAT library. Since you probably have your own "main.c" you will have to merge the setup and main loop into your own files.

Other files contained in the example directory demonstrate how to implement the indication functions and how to use other API functions.

File

Demonstration

File

Demonstration

usr_coe.c

 

 

 

 

 

 

 

SDO indication

Process Data Indication

Data Link Layer event indication

DC indication

ESM indications

PDO bypass functions

User timer event

Emergency message generation

usr_dynod.c

creating dynamic objects

usr_eeprom.c

implementing virtual EEPROM for EEPROM emulation (if applicable)

usr_eoe.c

receiving, processing, transmitting Ethernet frames (Ping server)

usr_foe.c

reading and writing (virtual) files

virtual_objects.c

implementing virtual objects

Table: files of sample application