The source code obtained by using the Slave Configuration tool of double blessing has the following
1 Main code
Ecatappl.c
Ecatappl.h
Ecatappl:ethercat from the application layer interface, the entire protocol stack runs the core module,
EtherCAT slave state machine and process data interface. The definition of the Main () function, the input and output path data
Object mapping processing, ESC and processor local memory input and output process data exchange, etc.;
ecatslv.c
Ecatslv.h
ECATSLV: Processes the EtherCAT state machine module. The state machine conversion request is initiated by the master
The station writes the request state to the A1control register, retrieving the current form from the query
To pass the register value as a parameter into the Al_controlind () function, which
For the core function to handle the transformation of the state machine, configure the opening of the SM channel according to the state of the master request
or off, check that the SM channel parameters are configured correctly, and so on.
Coeappl.c
Coeappl.h
The application layer interface module for the Coeappl:coe service. The actual application of the COE service is handled to
and the processing of the Coe object dictionary. Includes initialization of object dictionaries, adding objects to object dictionaries, moving
The implementation of a handler function, except for an entry in the object dictionary and a clear object dictionary.
Mailbox.h
Mailbox.c
Mailbox: Process the EtherCAT Mailbox Service module. Including the initialization of the mailbox communication interface,
Mailbox Channel parameter configuration, according to the current state machine to turn on or off the mailbox service, mailbox communication loss
Post-Failure mailbox repeat request, mailbox data read and write, and different service classes based on master request
Call the corresponding service function to deal with, this article mainly studies the COE mailbox service type processing.
Objdef.c
Objdef.h
Objdef: Access the Coe object Dictionary module. Read-write Object dictionary, get the object dictionary entrance,
and the specific processing function of the object dictionary is implemented by the module.
Sdoserv.c
Sdoserv.h
SDO Service processing module. Processing of all SDO and SDO information services, including
The main station sends the upload, downloads the SDO service request processing, after processing completes the SDO response data by
The main station to actively read.
Mcihw.h
Parallel Controller Interface module. The microcontroller and ESC in parallel mode are defined.
interface function, which is called when the upper application communicates, and the exchange of the underlying data is completed.
6,467ecatsoe.c
4,006 ecatsoe.h
Implementing SOE functionality in EtherCAT This file shows a short example
38,440testappl.c
29,615 testappl.h
The TESTAPPL.C test application is a specific slave stack that provides the majority of the specified EtherCAT
Features and generative mechanisms, which are from the behavior of the station do not conform to the standard. This can be used to check the behavior of the slave that the main behavior is not correct.
Reaction
Sdoserv.c
Sdoserv.h
SDOSERV:SDO Service processing module. Processing of all SDO and SDO information services, including
The main station sends the upload, downloads the SDO service request processing, after processing completes the SDO response data by
Main station to actively read
11,044emcy.c
4,598 Emcy.h
Emergency event Handling
Ecat_def.h
Slavesample Code Configuration defines
Sample code configuration definition from station
2 interface-related
(User applicationfiles (el9800appl.*,cia402appl.*,...)
17,575el9800appl.c
23,075 el9800appl.h
* This application consists of three function modules: * Digital input <br>* digital output <br>* analog input <br>
* The object of the module is defined by the ETG.
Cia402appl.c
Cia402appl.h
CIA402APPL implementation of the CIA402 driven profile sample from the stack code
in [1]. This implementation provides interface application-layer communication between motion controllers.
The following features are supported:
-cia402 objects (see Chapter 8.1 objects)
-cia402 state machine (see Chapter 8.2 State machine)
This supports synchronous loop locations (CSPs) and synchronous loops
Speed (CSV) mode of operation. Reaction
3
PDI and Hardwareaccess functions (el9800hw.*; MCIHW.*;FC1 1 00hw.*)
40,016el9800hw.c
8,199 el9800hw.h
* \ addtogroup EL9800_HW el9800 platform (serial key access)
Define access to el9800 specific peripherals and and ESC (SPI)
9,572 fc1100hw.c
4,698 fc1100hw.h
Hardware access on the WIN32 platform fc1100
Mcihw.c
MCIHW: Parallel Controller Interface module. The microcontroller and ESC in parallel mode are defined.
interface function, which is called when the upper application communicates, and the exchange of the underlying data is completed.
19,707 esc.h
EtherCAT Slave Controller Relateddefines and Types
EtherCAT slave controller-related definitions and types
4 other
10,624SAMPLEAPPL.C
6,379 sampleappl.h
Sample application Sampleappl.c:hardware Independent sample application
Sample: Sample SAMPLEAPPL.C Hardware-independent application
663 EtherCATSampleLibrary.h
10,555sampleapplicationinterface.c
6,322 SampleApplicationInterface.h
Creates an interface to being used in an externalproject
An interface that is used to create an external project
Bootmode.c
Bootmode.h
Boot mode virtual function
403,968 TcHelper.dll
829 TcHelper.h
2,406 TcHelper.lib
//below if a block creation macro is defined to make the exit standard method//from a DLL simple. All files are defined on this DLL with the Tchelper_exports compile//command line symbol. This symbol should not be defined in any project//using this DLL. This way the source files for any other project include this file//Tchelper_api function imported from a DLL, and this DLL sees the symbol//definition of this macro is exported.
Diag.c
Diag.h
This file contains the Diagnostic object processing
5 related code for other protocols (slightly)
AOEAPPL.C aoeappl.h ecataoe.c ecataoe.h ecatcoe.c ecatcoe.h ecateoe.c ecateoe.h ecatfoe.c ecat Foe.h foeappl.cfoeappl.h eoeappl.c eoeappl.h
The EtherCAT Slave code package provided by double blessing is resolved