Beckhoff ET9300 User Manual

Browse online or download User Manual for Equipment Beckhoff ET9300. BECKHOFF ET9300 User Manual

  • Download
  • Add to my manuals
  • Print

Summary of Contents

Page 1 - Date: 2015-01-13

Version 1.7 Date: 2015-01-13 Application Note ET9300 (EtherCAT Slave Stack Code)

Page 2 - LEGAL NOTICE

8 Application Note ET9300 2 Terms, Definition, Abbreviation Base Datatypes -- CoE Datatypes defined in ETG.1000.6 Entry – in conclusion with o

Page 3

Application Note ET9300 9 3 Getting Started This is a step by step instruction how to start the EtherCAT slave development with the Slave Stac

Page 4

10 Application Note ET9300 5. Create an ESI file according to the settings in step 4. 6. Make the ESI file available in the ESI cache of the

Page 5

Application Note ET9300 11 4 Code Structure The EtherCAT slave stack as seen in Figure 1 consists of three parts: - PDI/Hardware abstraction

Page 6

12 Application Note ET9300 5 Hardware Access The Slave Stack Code is executable on multiple platforms and controller architectures. This chap

Page 7

Application Note ET9300 13 slave project. In general the hardware access implementation needs to support the following features: - ESC read/wr

Page 8

14 Application Note ET9300 Table 2: Recommended Hardware Configurations Platform EL9800_HW PIC24 PIC18 MCI_HW FC1100_HW CONTROLLER_16BIT CONTRO

Page 9 - 1 References

Application Note ET9300 15 Platform EL9800_HW PIC24 PIC18 MCI_HW FC1100_HW CONTROLLER_16BIT CONTROLLER_32BIT ESC_16BIT_ACCESS ESC_32BIT_ACCESS

Page 10

16 Application Note ET9300 5.1 Interrupt Handler The following functions are provided by the generic Slave Stack Code (defined in ecatappl.h)

Page 11 - 3 Getting Started

Application Note ET9300 17 5.2.1 Generic Prototype: UINT16 HW_Init(void) Parameter void Return 0 if initialization was successful > 0 if e

Page 12

II Application Note ET9300 LEGAL NOTICETrademarks Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE® and XFC® are registered tra

Page 13 - 4 Code Structure

18 Application Note ET9300 Prototype: void HW_SetALEventMask(UINT16 intMask) Parameter “intMask” Interrupt mask (enabled interrupt shall be o

Page 14 - 5 Hardware Access

Application Note ET9300 19 Prototype: TSYNCMAN * HW_GetSyncMan(UINT8 channel) Parameter “channel” SyncManager channel Return Pointer to the S

Page 15

20 Application Note ET9300 5.2.2 Read Access Prototype: void HW_EscRead(MEM_ADDR *pData, UINT16 Address, UINT16 Len ) Parameter “pData” Pointe

Page 16

Application Note ET9300 21 Prototype: void HW_EscReadDWordIsr(UINT32 DWordValue, UINT16 Address) Parameter “DWordValue” Local 32Bit variable wh

Page 17

22 Application Note ET9300 Prototype: void HW_EscReadByte(UINT8 ByteValue, UINT16 Address) Parameter “ByteValue” Local 8Bit variable where the

Page 18

Application Note ET9300 23 5.2.3 Write Access Prototype: void HW_EscWrite(MEM_ADDR *pData, UINT16 Address, UINT16 Len ) Parameter “pData” Poin

Page 19

24 Application Note ET9300 Prototype: void HW_EscWriteDWordIsr(UINT32 DWordValue, UINT16 Address) Parameter “DWordValue” Local 32Bit variable w

Page 20

Application Note ET9300 25 Prototype: void HW_EscWriteByteIsr(UINT8 ByteValue, UINT16 Address) Parameter “ByteValue” Local 8Bit variable which

Page 21

26 Application Note ET9300 6 Application This chapter includes an overview over the default (sample) applications, the application interface a

Page 22

Application Note ET9300 27 Prototype: void ECAT_StateChange(UINT8 alStatus, UINT16 alStatusCode) Parameter alStatus Requested Al Status alStat

Page 23

Application Note ET9300 1 DOCUMENT HISTORY Version Comment 1.0 Start document 1.1 Chapter 4 “Hardware access”. Define descriptions; prototypes

Page 24

28 Application Note ET9300 Prototype: UINT16 (* pAPPL_EEPROM_Write)(UINT32 wordaddr) Parameter Wordaddr start word address within the EEPROM

Page 25

Application Note ET9300 29 Prototype: UINT16 APPL_StopMailboxHandler(void) Parameter Void Return See generic ESM return code description Descri

Page 26

30 Application Note ET9300 Prototype: UINT16 APPL_GenerateMapping (UINT16 *pInputSize, UINT16 *pOutputSize) Parameter Pointer to two 16bit vari

Page 27

Application Note ET9300 31 Name pEEPROM Type UINT8 * Description Pointer to the EEPROM buffer, it is only required if EEPROM emulation is enabl

Page 28 - 6 Application

32 Application Note ET9300 - 32Bit Output Counter (0x7010) If the Output Counter is 0 the Input Counter is incremented with every application

Page 29

Application Note ET9300 33 /************************************************************************** * Object 0x7010: outp

Page 30

34 Application Note ET9300 #ifdef _SAMPLE_APPLICATION_ = {2/*the object has now two entries*/, {0x70100120,0x70100220/* Reference to object 0x

Page 31

Application Note ET9300 35 SyncManager). NOTE: if one of the values mismatch with the information in the ESI file the slave will abort the stat

Page 32

36 Application Note ET9300 <Index>#x1601</Index> <Name>RxPDO</Name> <Entry> <Index>#x7010</Ind

Page 33

Application Note ET9300 37 <Sm DefaultSize="8" StartAddress="#x1800" ControlByte="#x64" Enable="1"&

Page 34

2 Application Note ET9300 CONTENTS 1 References 7 2 Terms, Definition, Abbreviation 8 2.1 Abbreviation 8 3 Getting Started 9 3.1 SSC T

Page 35

38 Application Note ET9300 </SubItem> </DataType> c. Update the object 0x7010. <Object> <Index>#x7010</Index>

Page 36

Application Note ET9300 39 </Flags> </SubItem> <SubItem> <SubIdx>2</SubIdx> <Name>SubIndex

Page 37

40 Application Note ET9300 <Info> <DefaultData>20000060</DefaultData> </Info> </SubItem>

Page 38

Application Note ET9300 41 7 Objects Objects are slave application data (e.g. variables) which can be accessed by the EtherCAT master via CoE

Page 39

42 Application Note ET9300 _REC_OBJ_DEF RecObj; 7.3 Entry descriptions A single entry description is defined in TSDOINFOENTRYDESC. All entry d

Page 40

Application Note ET9300 43 Example: Object name (Object Code ARRAY) UCHAR ArrObjName[] = "Array Obj"; Example: Object name (Object

Page 41

44 Application Note ET9300 Member Data type Description Write Pointer to Write Function. The prototype is listed below. This function will be

Page 42

Application Note ET9300 45 Index Range Description 0xA000 – 0xAFFF Diagnosis Area 0xB000 – 0xBFFF Service Transfer Area 0xC000 – 0xEFFF Reserve

Page 43 - 7 Objects

46 Application Note ET9300 {DEFTYPE_OCTETSTRING, 8*SIZEOF(sEnum0801_Value00), ACCESS_READ | OBJACCESS_NOPDOMAPPING}, {DEFTYPE_OCTETSTRING

Page 44

Application Note ET9300 47 8 Mailbox 8.1 FoE (File Transfer over EtherCAT) FoE can be used to download and upload a file to an EtherCAT devic

Page 45

Application Note ET9300 3 9.1 Supported Sync Modes 55 9.1.1 FreeRun 57 9.1.2 SyncManager 57 9.1.3 SyncManager/Sync0 58 9.1.4 SyncManag

Page 46

48 Application Note ET9300 EOE_SendFrameReq()SendFragment()MBX_MailboxSendReq()Pending frame?YesFull Mbx buffer?YesFrame complete?NoStore datag

Page 47

Application Note ET9300 49 EOE_ServiceInd()Init RequestYesYesNoNoCopy frame fragment to local bufferThis function is called from the generic ma

Page 48

50 Application Note ET9300 3.) Write binary to the PIC controller of the Evaluation Kit (see Application Note EL9800 [3] ). 4.) Change EoE fl

Page 49 - 8 Mailbox

Application Note ET9300 51 Figure 8: Network card settings 3.) Save settings a. Configure device b. Open TwinCAT c. Scan Network d. Selec

Page 50 - Figure 5: Send EoE datagram

52 Application Note ET9300 Figure 10: EoE EtherCAT Slave Settings 4.) Set network at least to PRE-OP (mailbox communication needed) 5.) Open

Page 51 - STATIC_ETHERNET_BUFFER“

Application Note ET9300 53 Figure 12: EoE Example 2 (Schema) Steps 1 to 3 are equal to EoE Example 1 (chapter 8.2.2.1). 4.) Enable IP Routing

Page 52

54 Application Note ET9300 Figure 14: Enable IP Routing WinCE 5.) Restart the PC 6.) Add Route on the external PC a. Command: route ADD 192

Page 53

Application Note ET9300 55 9 Synchronization The Slave Stack Code supports different modes of synchronisation which are based on three physica

Page 54

56 Application Note ET9300 Table 7: Supported Sync Modes Sync Type AL_EVENT_ENABLED DC_SUPPORTED Sync0/1 Activation (Reg. 0x981) Sync0 Cycle ti

Page 55

Application Note ET9300 57 9.1.1 FreeRun In this mode there is no slave application synchronisation (see Figure 16: Free Run). The function “P

Page 56

4 Application Note ET9300 13.4.3 ObjectCode 88 13.4.4 SI (Subindex) 89 13.4.5 DataType 89 13.4.6 Default/Min/Max 90 13.4.7 M/O/C, B/S

Page 57 - 9 Synchronization

58 Application Note ET9300 9.1.3 SyncManager/Sync0 This mode is recommended for most applications when the Sync0-event is used for synchroniza

Page 58

Application Note ET9300 59 9.1.5 Sync0 In this mode the slave application is started on Sync0 (see Figure 20: Sync0 Synchronization). To reduc

Page 59 - Inputs latch

60 Application Note ET9300 Cycles). The relation between Sync0 and the bus cycle is configured by the ESI element:CycleTimeSync0@Factor. Possib

Page 60 - Sync0 Sync0

Application Note ET9300 61 10 CiA402 drive profile Since version 4.30 the Slave Stack Code contains a sample implementation of the CiA402 driv

Page 61

62 Application Note ET9300 Index Object name Variable in source code Comment/Description 0x6040 Controlword objControlWord object for the outpu

Page 62 - Start Input Latch

Application Note ET9300 63 Figure 23: CiA402 state transitions and option codes

Page 63

64 Application Note ET9300 Table 9: State machine The transition number in Table 8 referring to the transition number in Figure 23.[1] 10.3 O

Page 64

Application Note ET9300 65 Figure 24: Axis configuration NOTE: This sample doesn’t provide a target value overflow control! 10.4 TwinCAT set

Page 65 - Application Note ET9300 63

66 Application Note ET9300 Figure 25: Set device variable without PLC link 10.4.1 Automatic network setup The TwinCAT System Manger provide

Page 66

Application Note ET9300 67 Figure 27: Scan for new EtherCAT devices with TwinCAT 3 After the network scan is complete a message box appears wi

Page 67

Application Note ET9300 5 FIGURES Figure 1: EtherCAT Slave Stack Code ...

Page 68

68 Application Note ET9300 Figure 29: TwinCAT 3 CiA402 axis setup Add a new EtherCAT device and append the CiA402 description (Figure 30). Fi

Page 69

Application Note ET9300 69 object index Type variable name device NC axis 0x6064 input Actual position “Enc_In” -> “nInData1” For the Stausw

Page 70 - Figure 30: Add CiA402 device

70 Application Note ET9300 Figure 32: Encoder scaling The velocity output scaling is calculated with the following formula: velo.scaling = (2^

Page 71

Application Note ET9300 71 11 TestApplication The test application is a specific slave stack which provides most of the specified EtherCAT sla

Page 72 - Figure 33: Velocity scaling

72 Application Note ET9300 Attribute Value Object Code ARRAY Max SubIndex 16 (7if build for EL9800) Table 14: Test Control Object Entries Su

Page 73 - 11 TestApplication

Application Note ET9300 73 11.3 Mailbox Tests (0x2010 – 0x201F) Table 17: Test Object 0x2010 (Mailbox Group 1) 11.4 CoE Tests (0x2020 – 0x20

Page 74

74 Application Note ET9300 11.6 Generic Objects The objects described in this chapter are used to test the correct SDO handling by the slave a

Page 75

Application Note ET9300 75 SI8 UINT8 RO Default value:0x88 Bit types are based on unsigned short) SI9 BIT2 WO Default value:0x1 SI10 BIT2 RW D

Page 76

76 Application Note ET9300 SI1 – 254 OCTET_STRING RW The first WORD of SI1 contains the Bitlength of each entry. The value can also be updated

Page 77

Application Note ET9300 77 12 Tool The Slave Stack Code Tool allows creating new slave files depending on user specific requirements and setti

Page 78

6 Application Note ET9300 TABLES Table 1: Hardware Related Settings ...

Page 79 - 12 Tool

78 Application Note ET9300 12.2 Main User Interface Elements 12.2.1 Tool Bar 12.2.1.1 File The file menu (Figure 35: Configurator File Menu)

Page 80

Application Note ET9300 79 [Project Update] Check for new Slave Stack Code version and update the current project. For further information see

Page 81 - Figure 39: Tool Menu

80 Application Note ET9300 Figure 40: Tool Options - Generic o [Open last project on startup] The last slave project is reloaded on the nex

Page 82 - Figure 40: Tool Options

Application Note ET9300 81 o [Add comment if obsolete code was skipped] Specify if a source code comment shall be added when code was deleted

Page 83

82 Application Note ET9300 [About] Show information about the SSC Tool. [Contact] Create a new email to [email protected] with your stan

Page 84

Application Note ET9300 83 [Add File(s)] Add one or more files to the project. These files will not evaluated and just copied to the output fo

Page 85

84 Application Note ET9300 Figure 47: Configurator Create Files [Cancel] Close dialog without creating new files [Close] Close dialog when new

Page 86

Application Note ET9300 85 [offline] Load SSC files from a local SSC zip archive. Both options require an external archive tool (7-Zip, WinRAR®

Page 87

86 Application Note ET9300 Importing a Configuration can either be done via the new project dialog (Figure 50: New Project | Import Configurati

Page 88

Application Note ET9300 87 13 OD Tool The SSC OD Tool converts an application definition file to slave application files for the Beckhoff Slav

Page 89 - SSC OD Tool

Application Note ET9300 7 1 References [1] ETG.6010 Implementation Guideline for the CiA402 Drive Profile (www.ethercat.org/ETG6010) [2] ETG

Page 90

88 Application Note ET9300 The slave application data is organized in objects (see chapter 7). Only objects in the manufacturer specific range

Page 91

Application Note ET9300 89 13.4.4 SI (Subindex) The Subindex can be either a decimal or hexadecimal value from 1 to 255. In case of an entry r

Page 92

90 Application Note ET9300 Index Name Base Data Type Bit Size 0x000A OCTET_STRING ARRAY [0..n] OF BYTE 8*(n+1) 0x000B UNICODE_STRING ARRAY [0.

Page 93

Application Note ET9300 91 Example Table 24 shows an Enum definition example. Table 24: Enum definition Table 25 shows an example for an entry

Page 94 - 14 EEPROM Handling

92 Application Note ET9300 14 EEPROM Handling To identify an EtherCAT slave and to provide parameter (e.g. process data, supported mailbox pro

Page 95

Application Note ET9300 93 Figure 56: EEPROM Programmer | File Slaves menu (Figure 57: EEPROM Programmer | Slaves): [Scan]: Scans for connecte

Page 96 - 15 Bootloader

94 Application Note ET9300 15 Bootloader The SSC is prepared to be used as the base code for a Bootloader implementation. The basic bootloader

Page 97 - Appendix

Application Note ET9300 95 Appendix Support and Service Beckhoff and their partners around the world offer comprehensive support and service, m

Comments to this Manuals

No comments