beckhoff TE1111 — 4.3 CoE / SoE / AoE

Basic principles As shown in the sample, a check takes place to ascertain whether the indication is valid and if yes, whether it was sent by the simulation device. If both conditions are met, it is a relayed mailbox message that requires a corresponding response. The IndexGroup indicates the mailbox protocol (16#8000F302 for CoE, 16#8000F420 for SoE). The sample described above can be downloaded here: https://infosys.beckhoff.com/content/1033/ TE1111_EtherCAT_Simulation/Resources/3268846987.zip Sending CoE Emergency Error Messages The sending of CoE Emergency error messages is carried out analogously as shown above via ADS Write to the NetId of the EtherCAT simulation device, PortNr. :

Port number of the terminal that is to send the emergency, IndexGroup : 0x00FF41, IndexOffset :0. Sending SoE Notifications The sending of SoE Notifications error messages takes place analogously as shown above via ADS Write to the NetId of the EtherCAT simulation device, PortNr. : Port number of the terminal that is to send the notification, IndexGroup : 0x00FF42, IndexOffset : results from the type definition TETHERCAT_SOE_ADS_IOFFS: typedef struct TETHERCAT_SOE_ADS_IOFFS { USHORT IDN; union { struct { BYTE DataState : 1; BYTE Name : 1; BYTE Attribute : 1; BYTE Unit : 1; BYTE Min : 1; BYTE Max : 1; BYTE Value : 1; BYTE Default : 1; }; BYTE Elements; }; BYTE DriveNo : 3; BYTE Reserved2 :

4; BYTE Command : 1; } ETHERCAT_SOE_ADS_IOFFS Example: 0x00401234 -> For the SoE IDN 1234 the value flag is addressed here. Routing of AoE to a PLC Registration of the mailbox recipient is identical to the description under CoE and SoE. The handling of AoE in the PLC also takes place in a similar structure, although several queries are involved, due to the functionality of AoE. A sample is shown below, which can be downloaded here:

https://infosys.beckhoff.com/ content/1033/TE1111_EtherCAT_Simulation/Resources/3268845323.zip fbAdsReadWriteInd(); IF fbAdsReadWriteInd.VALID = TRUE THEN MEMCPY(ADR(arrTmp), fbAdsReadWriteInd.DATAADDR, fbAdsReadWriteInd.WRTLENGTH); //copy of data in temp variable //evaluate destination of AeE command (e.g. terminal)-first 6 byte in arrTmp FOR Idx := 0 TO 5 DO arrDest[Idx] := arrTmp[Idx]; END_FOR IF smyDestId = F_CreateAmsNetId(arrDest) THEN //evaluate port (different physical ports or different services of terminal may be possible) IF fbAdsReadWriteInd.PORT = 16#1000 THEN //Io-Link Port 1 // evaluate command type - byte 16 :

write = 3, read = 2 IF arrTmp[16] = 3 THEN // write command //evaluate index group and index offset as shown in CoE and SoE //index group: evaluate service (e.g. object register of Io-Link Terminal) IF fbAdsReadWriteInd.IDXGRP = 16#8000F302 THEN IF fbAdsReadWriteInd.IDXOFFS = 16#80000000 THEN //adressing of service MEMCPY(ADR(arrTmp), fbAdsReadWriteInd.DATAADDR + 8, 8); //change destination net ID and source net ID MEMCPY(ADR(arrTmp) + 8, fbAdsReadWriteInd.DATAADDR, 8); arrTmp[18].0:= 1; (*set Respond Bit*) TE1111 16 Version: 1.5.3