BECKHOFF ET9300 User Manual

Page 34

Advertising
background image

32

Application Note ET9300

-

32Bit Output Counter (0x7010)

If the Output Counter is 0 the Input Counter is incremented with every application cycle by 1,
otherwise the Input Counter is the Output Counter +1.

Process data of the new application:

-

32Bit Input Counter (0x6000)

-

32Bit Result (0x6010)

-

Output Values (0x7010)

SI1: Value1 (32Bit)

SI2: Value2 (32Bit)

0x6010 is the sum of 0x7010.1 and 0x7010.2. 0x6000 is incremented with every application
cycle.

Initial Steps:

The initial steps describe how to create the basic sample application for the Beckhoff EL9800
EtherCAT evaluation board. Proceed with the “Adaption steps” if the basic sample application
already exists (even if it was created for another platform).

1. Follow the steps 1-7 in chapter 3.1SSC Tool.

2.

Select the custom configuration “EL9800 | 8Bit Digital I/O, 16Bit Analog Input”

3.

Select group “Application”

a.

Set “EL9800_APPLICATION” to 0

b.

Set “SAMPLE_APPLICATION” to 1

4. Save the project and create new slave files (Project -

> “Create new Slave Files”)

5.

Program the slave EEPROM based on the created ESI file (see “APPLICATION NOTE EL9800”
for further details)

6.

Create an MPLAB project with the create source files (see “APPLICATION NOTE EL9800” for
further details)

Adaption steps:

1. File: sampleappl.h

Create the entry description, the object name and the variable for the “32Bit Result” process data.

/**************************************************************************
* Object 0x6010: result object
**************************************************************************/

#ifdef _OBJD_

/* Entry description */

OBJCONST TSDOINFOENTRYDESC OBJMEM EntryDesc0x6010 = {DEFTYPE_UNSIGNED32,
0x10, ACCESS_READ | OBJACCESS_TXPDOMAPPING};

/* Object name */

OBJCONST UCHAR OBJMEM aName0x6010[] = "Result";
#endif //#ifdef _OBJD_

/* Variable to handle the object data */

PROTO UINT32 ResultObj6010;

2. File: sampleappl.h

Change the existing definition of object 0x7010 (32Bit Output Counter) to a record object which
handles more than one process data (the new object shall include two variables (entries)).
The variable for the entry description is changed to an array and the description for SubIndex0
and for the second variable is added.
The name variable is enhanced by the names for the entries (each “subname” is terminated by
“\000” and the whole string is terminated by “\377”).
For the object data itself a structure including a variable for the subindex0 and the two process
data variables is defined.
See chapter 11 for detailed information regarding the definitions.

Advertising