Commands ¶ ReadEEpromData (FunctionBlock) ReadIdentification (FunctionBlock) ReadMemory (FunctionBlock) ReadPacket (Method) ReadNbrSlaves (FunctionBlock) ReadWriteEEprom (FunctionBlock) WriteAliasAddress (FunctionBlock) WriteMemory (FunctionBlock) ReadPacket (Method)
ReadEEpromData (FB) ¶ FUNCTION_BLOCK ReadEEpromData EXTENDS ETrigA Reads the first 56 Bytes of the EEprom and extract some data from the byte array InOut: Scope Name Type Initial Comment Inherited from Input xExecute BOOL Rising edge: Action starts Falling edge: Resets outputs If a falling edge occurs before the function block has completed its action, the outputs operate in the usual manner and are only reset if either the action is completed or in the event of an error. In this case, the corresponding output values ( xDone , xError , iError ) are present at the outputs for exactly one cycle. ETrigA xAbort BOOL TRUE : Action is stopped immediately and all outputs are reset to their initial values. ETrigA Output xDone BOOL TRUE : Action successfully completed ETrigA xBusy BOOL TRUE : Function block active ETrigA xError BOOL TRUE : Error occurred, function block aborts action FALSE : No error ETrigA xAborted BOOL TRUE : Action aborted by user ETrigA Input usiCom USINT 1 index of master 1: first Ethercat master wSlaveIndex WORD index position to read eeprom data from 0,1… udiTimeOut UDINT Timeout for operation in ms Output dwVendorID DWORD the vendor id for the slave dwProductID DWORD the product id for the slave dwRevisionID DWORD the revision id for the slave dwSerialNo DWORD the serial number for the slave wAliasAddress WORD the alias address for the slave (either eeprom 16#12 or with AL status register 16#134) dwPortStatus DWORD Port Status of the slave (register 16#110 in upper word, register 16#0007 in lower word) wRcvMbxOffset WORD Offset of receive mailbox wRcvMbxSize WORD Size of receive mailbox wSndMbxOffset WORD Offset of send mailbox wSndMbxSize WORD Size of send mailbox byMailboxProtocol BYTE Flags for mailbox (CoE, SoE etc.)
ReadIdentification (FB) ¶ FUNCTION_BLOCK ReadIdentification EXTENDS ETrigA Reads the identification data from a EtherCAT slave InOut: Scope Name Type Initial Comment Inherited from Input xExecute BOOL Rising edge: Action starts Falling edge: Resets outputs If a falling edge occurs before the function block has completed its action, the outputs operate in the usual manner and are only reset if either the action is completed or in the event of an error. In this case, the corresponding output values ( xDone , xError , iError ) are present at the outputs for exactly one cycle. ETrigA xAbort BOOL TRUE : Action is stopped immediately and all outputs are reset to their initial values. ETrigA Output xDone BOOL TRUE : Action successfully completed ETrigA xBusy BOOL TRUE : Function block active ETrigA xError BOOL TRUE : Error occurred, function block aborts action FALSE : No error ETrigA xAborted BOOL TRUE : Action aborted by user ETrigA Input usiCom USINT 1 index of master 1: first Ethercat master wSlaveIndex WORD index position to read identifcation from 0,1. udiTimeOut UDINT Timeout for operation in ms xReadReg0x12 BOOL Flag if register 0x12 (station alias) should be read xReadReg0x134 BOOL Flag if register 0x134 (explicit device identification) should be read xReadRegAdo BOOL Flag if register Ado should be read wAdo WORD The address of the ado identification Output wStationAlias WORD Result for Register 0x12 wReg134 WORD Result for 0x134 wAdoValue WORD Result für ADO identification
ReadMemory (FB) ¶ FUNCTION_BLOCK ReadMemory EXTENDS ETrigA This function block is for reading the memory of EtherCAT Slaves. Example: Following example code reads the register 0x130 (current status) PROGRAM PLC_PRG VAR etcreadmemory : ReadMemory ; wStatus : WORD ; xRead : BOOL ; END_VAR etcreadmemory ( xExecute := xRead , usiCom := 1 , wSlaveAddress := 1002 , xAutoIncAdr := FALSE , xBroadcast := FALSE , uiMemOffset := 16#130 , iSize := 2 , pDest := ADR ( wStatus ), udiTimeout := 500 ); InOut: Scope Name Type Initial Comment Inherited from Input xExecute BOOL Rising edge: Action starts Falling edge: Resets outputs If a falling edge occurs before the function block has completed its action, the outputs operate in the usual manner and are only reset if either the action is completed or in the event of an error. In this case, the corresponding output values ( xDone , xError , iError ) are present at the outputs for exactly one cycle. ETrigA xAbort BOOL TRUE : Action is stopped immediately and all outputs are reset to their initial values. ETrigA Output xDone BOOL TRUE : Action successfully completed ETrigA xBusy BOOL TRUE : Function block active ETrigA xError BOOL TRUE : Error occurred, function block aborts action FALSE : No error ETrigA xAborted BOOL TRUE : Action aborted by user ETrigA Input usiCom USINT 1 index of master 1: first Ethercat master wSlaveAddress WORD address either auto increment address or physical address of device xAutoIncAdr BOOL flag that determines which way to use the given address xBroadcast BOOL flag if broadcast read should be used, if true then wSlaveAddress and bAutoIncAdr are not used uiMemOffset UINT offset of memory iSize INT bytes to read pDest POINTER TO BYTE buffer to store the data udiTimeOut UDINT Timeout for operation in ms Output uiWorkingCounter UINT working counter of received command Methods: ReadPacket Structure: ReadPacket (Method)
ReadMemory.ReadPacket (METH) ¶ METHOD ReadPacket : BOOL InOut: Scope Name Type Return ReadPacket BOOL Input bReset BOOL
ETCSlaveStack.ConfigVendorID (PROP) ¶ PROPERTY ConfigVendorID : DWORD returns the vendor id from the configration
DynamicConfig ¶ AddCoEInit (Method) AddFMMU (Method) AddSoEInit (Method) AddSyncManager (Method) AlignFMMU (Method) ChangeFMMU (Method) ChangeSyncManager (Method) ClearCoEInit (Method) ClearSoEInit (Method) GetFMMU (Method) GetSyncManager (Method) HasCoEInit (Method) InputBitOffset (Property) InputBitSize (Property) InputData (Property) NbrFMMU (Property) NbrSyncManager (Property) OutputBitOffset (Property) OutputBitSize (Property) OutputData (Property) SetAssignToPDI (Method) SetConfigData (Method) SetDCSettings (Method) SetEoeSettings (Method) SetLatchSettings (Method) SetOptional (Method) SetStartupChecks (Method) SetSyncUnit (Method) SetTimeouts (Method) SetUseLrdLwr (Method) SetWatchdog (Method) Sync0ShiftTimeInputBased (Property)
ETCSlaveStack.AddCoEInit (METH) ¶ METHOD AddCoEInit Adds a CoE Init command to the slave Example: pSlave ^. AddCoEInit ( 16#1C12 , 2 , 2 , 16#1600 , 1000 , FALSE , FALSE ); InOut: Scope Name Type Initial Comment Input wIndex WORD Index of object bySubIndex BYTE SubIndex of object uiDataLength UINT Length of data dwData XWORD pointer to data udiTimeOut UDINT timeout in milliseconds bCompleteAccess BOOL true if complete access should be used (subindex must be zero) bAllocMemory BOOL FALSE for uiDataLength > 4 bytes. allocate dynamic memory and copy content from dwData to dynamic memory.
ETCSlaveStack.AddFMMU (METH) ¶ METHOD AddFMMU Adds a FMMU to the slave Example: pSlave ^. AddFMMU ( 0 , 4 , 0 , 7 , 16#1000 , 0 , 2 , 1 ); InOut: Scope Name Type Comment Input dwGlobalStartAddress DWORD only used in manual mode, depnding of the master global settings wLength WORD Length of FMMU in Bytes usiStartBit USINT Startbit of FMMU usiEndBit USINT Endbit of FMMU wPhysStartAddress WORD Physical start adress usiPhysStartBit USINT Physical start bit usiAccess USINT read bit 0 write bit 1 dwFlags DWORD bit 0 channel enable
ETCSlaveStack.AddSoEInit (METH) ¶ METHOD AddSoEInit Adds a SoE Init command to the slave InOut: Scope Name Type Comment Input wIDN WORD IDN of object uiDataLength UINT length to write dwData XWORD pointer to data udiTimeOut UDINT timeout in milliseconds wChannel WORD channel for drives (0: first drive; 1: second drive)