ECMC: EtherCAT open source motion control.
Motion control based on the open source EtherCAT master (www.etherlab.org). The motion package is integerated into the ESS EPCIS environment (E3).
Loading...
Searching...
No Matches
Functions
ecmcEthercat.h File Reference

EtherCAT commands. More...

Go to the source code of this file.

Functions

int ecSetMaster (int masterIndex)
 Selects EtherCAT master to use.
.
 
int ecResetMaster (int masterIndex)
 Retry configuring slaves for an selected EtherCAT master.
.
 
int ecAddSlave (uint16_t alias, uint16_t position, uint32_t vendorId, uint32_t productCode)
 Adds an EtherCAT slave to the hardware configuration.
.
 
int ecAddSyncManager (int slaveIndex, int direction, uint8_t syncMangerIndex)
 obsolete command. Use ecAddEntryComplete() command instead.

 
int ecAddPdo (int slaveIndex, int syncManager, uint16_t pdoIndex)
 obsolete command. Use ecAddEntryComplete() command instead.

 
int ecAddEntryComplete (uint16_t slaveBusPosition, uint32_t vendorId, uint32_t productCode, int direction, uint8_t syncMangerIndex, uint16_t pdoIndex, uint16_t entryIndex, uint8_t entrySubIndex, uint8_t bits, char *entryIDString, int signedValue)
 
int ecAddEntry (uint16_t slaveBusPosition, uint32_t vendorId, uint32_t productCode, int direction, uint8_t syncMangerIndex, uint16_t pdoIndex, uint16_t entryIndex, uint8_t entrySubIndex, char *datatype, char *entryIDString, int updateInRealTime)
 Adds an EtherCAT slave to the hardware configuration.
.
 
int ecAddSdoAsync (uint16_t slaveBusPosition, uint16_t entryIndex, uint8_t entrySubIndex, char *datatype, char *idString)
 Adds an async SDO object.
.
 
int ecAddMemMapDT (char *ecPath, size_t byteSize, int direction, char *dataType, char *memMapIDString)
 Adds a memory map object to access data directly from EtherCAT domain. This is the preferred syntax.
.
 
int ecAddMemMap (uint16_t startEntryBusPosition, char *startEntryIDString, size_t byteSize, int direction, char *memMapIDString)
 Adds a memory map object to access data directly from EtherCAT
domain. Support for this syntax might be dropped in newer releases.
Please use new syntax.
.
 
int ecAddDataDT (char *ecPath, size_t entryByteOffset, size_t entryBitOffset, int direction, char *dataType, char *idString)
 Adds a data item object to access data directly from EtherCAT domain. This object type only support scalars (not arrays). For arrays see memmaps.
.
 
int ecGetMemMapId (char *memMapIDString, int *id)
 Get index of a memmap object based on its name id string.
 
int ecSlaveConfigDC (int slaveBusPosition, uint16_t assignActivate, uint32_t sync0Cycle, int32_t sync0Shift, uint32_t sync1Cycle, int32_t sync1Shift)
 Configure slave DC clock.
.
 
int ecSelectReferenceDC (int masterIndex, int slaveBusPosition)
 Select EtherCAT reference clock.
.
 
int ecAddSdo (uint16_t slaveBusPosition, uint16_t sdoIndex, uint8_t sdoSubIndex, uint32_t value, int byteSize)
 Adds a Service Data Object for writing.
 
int ecAddSdoDT (uint16_t slavePosition, uint16_t sdoIndex, uint8_t sdoSubIndex, char *valueString, char *datatype)
 Adds a Service Data Object for writing.
 
int ecAddSdoComplete (uint16_t slaveBusPosition, uint16_t sdoIndex, const char *valueBuffer, int byteSize)
 Adds a Service Data Object for writing.
 
int ecAddSdoBuffer (uint16_t slavePosition, uint16_t sdoIndex, uint8_t sdoSubIndex, const char *valueBuffer, int byteSize)
 Adds a Service Data Object for writing.
 
int ecWriteSdo (uint16_t slavePosition, uint16_t sdoIndex, uint8_t sdoSubIndex, uint32_t value, int byteSize)
 Write to a Service Data Object.
 
int ecSetDomAllowOffline (int allow)
 Allow domain to be offline.
 
int ecSetEcAllowOffline (int allow)
 Allow master to be offline.
 
int ecAddDomain (int rateCycles, int offsetCycles)
 Add domain.
 
int ecReadSdo (uint16_t slavePosition, uint16_t sdoIndex, uint8_t sdoSubIndex, int byteSize, uint32_t *value)
 Write to a Service Data Object.
 
int ecVerifySdo (uint16_t slavePosition, uint16_t sdoIndex, uint8_t sdoSubIndex, uint32_t verValue, int byteSize)
 Verify a Service Data Object.
 
int ecReadSoE (uint16_t slavePosition, uint8_t driveNo, uint16_t idn, size_t byteSize, uint8_t *value)
 Read SoE
.
 
int ecWriteSoE (uint16_t slavePosition, uint8_t driveNo, uint16_t idn, size_t byteSize, uint8_t *value)
 Write SoE
.
 
int ecSlaveConfigWatchDog (int slaveBusPosition, int watchdogDivider, int watchdogIntervals)
 Configure Slave watch dog.
.
 
int ecApplyConfig (int masterIndex)
 Apply hardware configuration to master.
.
 
int writeEcEntry (int slaveIndex, int entryIndex, uint64_t value)
 Writes a value to an EtherCAT entry.
.
 
int writeEcEntryIDString (int slaveBusPosition, char *entryIdString, uint64_t value)
 Writes a value to an EtherCAT entry addressed by slaveBusPosition and entryIdString.
.
 
int readEcEntry (int slaveIndex, int entryIndex, uint64_t *value)
 Read a value from an EtherCAT entry.
.
 
int readEcEntryIDString (int slavePosition, char *entryIDString, uint64_t *value)
 Read a value from an EtherCAT entry addressed by slaveBusPosition and entryIdString.
.
 
int readEcEntryIndexIDString (int slavePosition, char *entryIDString, int *value)
 Read the object Index of an entry addressed by slaveBusPosition and entryIdString.
.
 
int readEcSlaveIndex (int slavePosition, int *value)
 Read the object Index of an slave addressed by slaveBusPosition.
.
 
int readEcMemMap (const char *memMapIDString, uint8_t *data, size_t bytesToRead, size_t *bytesRead)
 Read EtherCAT memory map object.
 
int ecSetEntryUpdateInRealtime (uint16_t slavePosition, char *entryIDString, int updateInRealtime)
 Set update in realtime bit for an entry.
 
int ecSetDiagnostics (int enable)
 Enable EtherCAT bus diagnostics.
.
 
int ecSetDomainFailedCyclesLimit (int cycles)
 Set allowed bus cycles in row of none complete domain data transfer.
.
 
int ecResetError ()
 Reset error on all EtherCat objects.
.
 
int ecEnablePrintouts (int value)
 Enable diagnostic printouts from EtherCAT objects.
.
 
int ecSetDelayECOkAtStartup (int milliseconds)
 Delay ethercat OK status for a time.
 
int ecPrintAllHardware ()
 Prints all hardware connected to selected master.
.
 
int ecPrintSlaveConfig (int slaveIndex)
 Prints hardware configuration for a selected slave.
.
 
int linkEcEntryToEcStatusOutput (int slaveIndex, char *entryIDString)
 Links an EtherCAT entry to the ethecat master object for hardware status output
.
 
int ecVerifySlave (uint16_t alias, uint16_t slavePos, uint32_t vendorId, uint32_t productCode, uint32_t revisionNum)
 Verfy slave at position.
 
int ecGetSlaveVendorId (uint16_t alias, uint16_t slavePos, uint32_t *result)
 Read vendor id of selected ethercat slave.
 
int ecGetSlaveProductCode (uint16_t alias, uint16_t slavePos, uint32_t *result)
 Read product code of selected ethercat slave.
 
int ecGetSlaveRevisionNum (uint16_t alias, uint16_t slavePos, uint32_t *result)
 revision number id of selected ethercat slave
 
int ecGetSlaveSerialNum (uint16_t alias, uint16_t slavePos, uint32_t *result)
 Read serial number of selected ethercat slave.
 
int ecUseClockRealtime (int useClkRT)
 Use CLOCK_REALTIME.
 

Detailed Description

EtherCAT commands.

Function Documentation

◆ ecAddDataDT()

int ecAddDataDT ( char * ecPath,
size_t entryByteOffset,
size_t entryBitOffset,
int direction,
char * dataType,
char * idString )

Adds a data item object to access data directly from EtherCAT domain. This object type only support scalars (not arrays). For arrays see memmaps.
.

The start of the data item is addressed by a previously configured EtherCAT entry, byte-, bit-offset and data type.

Parameters
[in]ecPathIdentification string of the start EtherCAT
  • entry (example "ec0.s1.AI_1").
[in]entryByteOffsetoffset in bytes.
[in]entryBitOffsetadditional offset in bits
[in]directionData transfer direction..
direction = 1: Output (from master).
direction = 2: Input (to master).
[in]dataTypeDataType of ethercat data:
B1: 1-bit
B2: 2-bits (lsb)
B3: 3-bits (lsb)
B4: 4-bits (lsb)
U8: Unsigned 8-bit
S8: Signed 8-bit
U16: Unsigned 16-bit
S16: Signed 16-bit
U32: Unsigned 32-bit
S32: Signed 32-bit
U64: Unsigned 64-bit
S64: Signed 64-bit
F32: Real 32-bit
F64: Double 64-bit
[in]idStringIdentification string used for addressing the object. ("ec<masterid>.s<slaveid>" will be used as prefix)
Returns
0 if success or otherwise an error code.
Note
Example: Add an EtherCAT input data item of type B1 with 0 bytes offset and 2 bits offset, starting at entry "ec0.s2.byte09"
"Cfg.EcAddDataDT(ec0.s2.byte09,0,2,B1,a_bit)" //Command string to ecmcCmdParser.c

◆ ecAddDomain()

int ecAddDomain ( int rateCycles,
int offsetCycles )

Add domain.

Parameters
[in]rateexecute domain in this rate (cycles)
[in]offsetoffset cycles
Returns
0 if success or otherwise an error code.
Note
Example: Add a domain that executes every 10:th cycles with an offset off 1 cycle: "Cfg.EcAddDomain(10,1)" //Command string to ecmcCmdParser.c

◆ ecAddEntry()

int ecAddEntry ( uint16_t slaveBusPosition,
uint32_t vendorId,
uint32_t productCode,
int direction,
uint8_t syncMangerIndex,
uint16_t pdoIndex,
uint16_t entryIndex,
uint8_t entrySubIndex,
char * datatype,
char * entryIDString,
int updateInRealTime )

Adds an EtherCAT slave to the hardware configuration.
.

Each added slave will be assigned an additional index which will be zero for the first successfully added slave and then incremented for each successful call to "Cfg.EcAddSlave()".

Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveBusPosition = 0..65535: Addressing of normal EtherCAT slaves.
[in]vendorIdIdentification value for slave vendor.
vendorId = 0x2: Beckhoff.
vendorId = 0x48554B: Kendrion Kuhnke Automation GmbH.
[in]productCodeProduct identification code.
productCode=0x13ed3052: EL5101 incremental encoder input.
[in]directionData transfer direction..
direction = 1: Output (from master).
direction = 2: Input (to master).
[in]syncMangerIndexIndex of sync manager.
[in]pdoIndexIndex of process data object. Needs to be entered in hex format.
[in]entryIndexIndex of process data object entry. Needs to be entered in hex format.
[in]entrySubIndexIndex of process data object sub entry. Needs to be entered in hex format.
[in]dataTypeDataType of ethercat data:
B1: 1-bit
B2: 2-bits (lsb)
B3: 3-bits (lsb)
B4: 4-bits (lsb)
U8: Unsigned 8-bit
S8: Signed 8-bit
U16: Unsigned 16-bit
S16: Signed 16-bit
U32: Unsigned 32-bit
S32: Signed 32-bit
U64: Unsigned 64-bit
S64: Signed 64-bit
F32: Real 32-bit
F64: Double 64-bit
[in]entryIDStringIdentification string used for addressing the entry.
[in]updateInRT1 if value should be updated in realtime 0
normally set to zero for entries that are
covered in memmaps.
Note
All configuration data can be found in the documentation of the slave, in the ESI slave description file or by using the etherlab (www.etherlab.org) ethercat tool.
Returns
0 if success or otherwise an error code.
Note
Example: Add an EtherCAT entry for the actual position of an EL5101 incremental encoder card.
"Cfg.EcAddEntry(2,0x2,0x13ed3052,2,3,0x1a03,0x6010,0x10,U16,POSITION,1)" //Command string to ecmcCmdParser.c
Example: Add an EtherCAT entry for the velocity setpoint of an EL7037 stepper drive card.
"Cfg.EcAddEntry(7,0x2,0x1b7d3052,1,2,0x1604,0x7010,0x21,S16, VELOCITY_SETPOINT,1)" //Command string to ecmcCmdParser.c

◆ ecAddEntryComplete()

int ecAddEntryComplete ( uint16_t slaveBusPosition,
uint32_t vendorId,
uint32_t productCode,
int direction,
uint8_t syncMangerIndex,
uint16_t pdoIndex,
uint16_t entryIndex,
uint8_t entrySubIndex,
uint8_t bits,
char * entryIDString,
int signedValue )

\breif Adds an EtherCAT slave to the hardware configuration.
Each added slave will be assigned an additional index which will be zero for the first successfully added slave and then incremented for each successful call to "Cfg.EcAddSlave()".

Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveBusPosition = 0..65535: Addressing of normal EtherCAT slaves.
[in]vendorIdIdentification value for slave vendor.
vendorId = 0x2: Beckhoff.
vendorId = 0x48554B: Kendrion Kuhnke Automation GmbH.
[in]productCodeProduct identification code.
productCode=0x13ed3052: EL5101 incremental encoder input.
[in]directionData transfer direction..
direction = 1: Output (from master).
direction = 2: Input (to master).
[in]syncMangerIndexIndex of sync manager.
[in]pdoIndexIndex of process data object. Needs to be entered in hex format.
[in]entryIndexIndex of process data object entry. Needs to be entered in hex format.
[in]entrySubIndexIndex of process data object sub entry. Needs to be entered in hex format.
[in]bitsBit count.
[in]entryIDStringIdentification string used for addressing the entry.
[in]signedValue1 if value is of signed type otherwise 0
Note
All configuration data can be found in the documentation of the slave, in the ESI slave description file or by using the etherlab (www.etherlab.org) ethercat tool.
Returns
0 if success or otherwise an error code.
Note
Example: Add an EtherCAT entry for the actual position of an EL5101 incremental encoder card.
"Cfg.EcAddEntryComplete(2,0x2,0x13ed3052,2,3,0x1a03,0x6010,0x10,16,POSITION)" //Command string to ecmcCmdParser.c
Example: Add an EtherCAT entry for the velocity setpoint of an EL7037 stepper drive card.
"Cfg.EcAddEntryComplete(7,0x2,0x1b7d3052,1,2,0x1604,0x7010,0x21,16, VELOCITY_SETPOINT)" //Command string to ecmcCmdParser.c

◆ ecAddMemMap()

int ecAddMemMap ( uint16_t startEntryBusPosition,
char * startEntryIDString,
size_t byteSize,
int direction,
char * memMapIDString )

Adds a memory map object to access data directly from EtherCAT
domain. Support for this syntax might be dropped in newer releases.
Please use new syntax.
.

The start of the memory map is addressed by a previously configured EtherCAT entry and a size.

Parameters
[in]startEntryBusPositionPosition of the EtherCAT slave on the bus where the start entry is configured.
startEntryBusPosition = 0..65535: Addressing of normal EtherCAT slaves.
[in]startEntryIDStringI Identification string of the start EtherCAT
  • entry.
[in]byteSizeSize of memory map objects (size to access).
[in]directionData transfer direction..
direction = 1: Output (from master).
direction = 2: Input (to master).
[in]entryIDStringIdentification string used for addressing the object.
Returns
0 if success or otherwise an error code.
Note
Example: Add an EtherCAT input memory map of size 200 bytes starting at entry "AI1" on slave 10. Name the memory map WAVEFORM. Type argument is excluded.
"Cfg.EcAddMemMap(10,AI1,200,2,ec0.mm.WAVEFORM)" //Command string to ecmcCmdParser.c

◆ ecAddMemMapDT()

int ecAddMemMapDT ( char * ecPath,
size_t byteSize,
int direction,
char * dataType,
char * memMapIDString )

Adds a memory map object to access data directly from EtherCAT domain. This is the preferred syntax.
.

The start of the memory map is addressed by a previously configured EtherCAT entry and a size.

Parameters
[in]ecPathIdentification string of the start EtherCAT
  • entry (example "ec0.s1.AI_1").
[in]byteSizeSize of memory map objects (size to access).
[in]directionData transfer direction..
direction = 1: Output (from master).
direction = 2: Input (to master).
[in]dataTypeDataType of ethercat data:
U8: Unsigned 8-bit
S8: Signed 8-bit
U16: Unsigned 16-bit
S16: Signed 16-bit
U32: Unsigned 32-bit
S32: Signed 32-bit
U64: Unsigned 64-bit
S64: Signed 64-bit
F32: Real 32-bit
F64: Double 64-bit
[in]memMapIdStringIdentification string used for addressing the object.
Returns
0 if success or otherwise an error code.
Note
Example: Add an EtherCAT input memory map of size 200 bytes of type S32 starting at entry "AI1" on slave 10 with name WAVEFORM.

"Cfg.EcAddMemMapDT(ec0.s10.AI1,200,2,S32,ec0.s10.mm.WAVEFORM)" //Command string to ecmcCmdParser.c

◆ ecAddSdo()

int ecAddSdo ( uint16_t slaveBusPosition,
uint16_t sdoIndex,
uint8_t sdoSubIndex,
uint32_t value,
int byteSize )

Adds a Service Data Object for writing.

Adds a Service Data Object for writing to the sdo registers of EtherCAT slaves. An sdo object will be added to the hardware configuration. The writing will occur when the hardware configuration is applied.

Note
This command can only be used in configuration mode.
Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = 0..65535: Addressing of EtherCAT slaves.
[in]sdoIndexIndex of service data object. Needs to be entered in hex format.
[in]sdoSubIndexSub index of service data object . Needs to be entered in hex format.
[in]valueValue to write.
[in]byteSizeByte count to write.
Note
All configuration data can be found in the documentation of the slave, in the ESI slave description file or by using the etherlab (www.etherlab.org) ethercat tool.
Returns
0 if success or otherwise an error code.
Note
Example: Write 1A (1000mA) to maximum current of the EL7037 stepper drive card on slave position 2.
"Cfg.EcAddSdo(2,0x8010,0x1,1000,2)" //Command string to ecmcCmdParser.c

◆ ecAddSdoAsync()

int ecAddSdoAsync ( uint16_t slaveBusPosition,
uint16_t entryIndex,
uint8_t entrySubIndex,
char * datatype,
char * idString )

Adds an async SDO object.
.

Adds a SDO object for SDO read and write during realtime.

Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveBusPosition = 0..65535: Addressing of normal EtherCAT slaves.
[in]indexIndex of process data object entry. Needs to be entered in hex format.
[in]subIndexIndex of process data object sub entry. Needs to be entered in hex format.
[in]dataTypeDataType of ethercat data:
U8: Unsigned 8-bit
S8: Signed 8-bit
U16: Unsigned 16-bit
S16: Signed 16-bit
U32: Unsigned 32-bit
S32: Signed 32-bit
U64: Unsigned 64-bit
S64: Signed 64-bit
F32: Real 32-bit
F64: Double 64-bit
[in]idStringIdentification string used for addressing the entry.
Returns
0 if success or otherwise an error code.
Note
Example: Add an SDO for async reads and writes in runtime.
Setting the input 1 as HWE enable for an EL70xx stepper drive:
"Cfg.EcAddSdoAsync(3,0x8012,0x32,U8,"hwenable")" //Command string to ecmcCmdParser.c

◆ ecAddSdoBuffer()

int ecAddSdoBuffer ( uint16_t slavePosition,
uint16_t sdoIndex,
uint8_t sdoSubIndex,
const char * valueBuffer,
int byteSize )

Adds a Service Data Object for writing.

Adds a Service Data Object for writing to the sdo registers of EtherCAT slaves. An sdo object will be added to the hardware configuration. The writing will occur when the hardware configuration is applied.

Note
This command can only be used in configuration mode.
Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = 0..65535: Addressing of EtherCAT slaves.
[in]sdoIndexIndex of service data object. Needs to be entered in hex format.
[in]sdoSubIndexSub index of service data object. Needs to be entered in hex format.
[in]valueBufferValues to be written as hex string, each byte separted with space.
[in]byteSizeByte count to write.
Note
All configuration data can be found in the documentation of the slave, in the ESI slave description file or by using the etherlab (www.etherlab.org) ethercat tool.
Returns
0 if success or otherwise an error code.
Note
Example: Write a hex string of data to slave position 2.
"Cfg.EcAddSdoBuffer(2,0x8010,0x1,0A FF CA 01 25 F1,6)" //Command string to ecmcCmdParser.c

◆ ecAddSdoComplete()

int ecAddSdoComplete ( uint16_t slaveBusPosition,
uint16_t sdoIndex,
const char * valueBuffer,
int byteSize )

Adds a Service Data Object for writing.

Adds a Service Data Object for writing to the sdo registers of EtherCAT slaves. An sdo object will be added to the hardware configuration. The writing will occur when the hardware configuration is applied.

Note
This command can only be used in configuration mode.
Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = 0..65535: Addressing of EtherCAT slaves.
[in]sdoIndexIndex of service data object. Needs to be entered in hex format.
[in]valueBufferValues to be written as hex string, each byte separted with space.
[in]byteSizeByte count to write.
Note
All configuration data can be found in the documentation of the slave, in the ESI slave description file or by using the etherlab (www.etherlab.org) ethercat tool.
Returns
0 if success or otherwise an error code.
Note
Example: Write a hex string of data to slave position 2.
"Cfg.EcAddSdoComplete(2,0x8010,0A FF CA 01 25 F1,6)" //Command string to ecmcCmdParser.c

◆ ecAddSdoDT()

int ecAddSdoDT ( uint16_t slavePosition,
uint16_t sdoIndex,
uint8_t sdoSubIndex,
char * valueString,
char * datatype )

Adds a Service Data Object for writing.

Adds a Service Data Object for writing to the sdo registers of EtherCAT slaves. An sdo object will be added to the hardware configuration. The writing will occur when the hardware configuration is applied.

Note
This command can only be used in configuration mode.
Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = 0..65535: Addressing of EtherCAT slaves.
[in]sdoIndexIndex of service data object. Needs to be entered in hex format.
[in]sdoSubIndexSub index of service data object . Needs to be entered in hex format.
[in]valueStringValue to write.
[in]dataTypeecmc data type string.
U8: Unsigned 8-bit
S8: Signed 8-bit
U16: Unsigned 16-bit
S16: Signed 16-bit
U32: Unsigned 32-bit
S32: Signed 32-bit
U64: Unsigned 64-bit
S64: Signed 64-bit
F32: Real 32-bit
F64: Double 64-bit
Note
All configuration data can be found in the documentation of the slave, in the ESI slave description file or by using the etherlab (www.etherlab.org) ethercat tool.
Returns
0 if success or otherwise an error code.
Note
Example: Write 1A (1000mA) to maximum current of the EL7037 stepper drive card on slave position 2.
"Cfg.EcAddSdoDT(2,0x8010,0x1,1000.0,F64)" //Command string to ecmcCmdParser.c

◆ ecAddSlave()

int ecAddSlave ( uint16_t alias,
uint16_t position,
uint32_t vendorId,
uint32_t productCode )

Adds an EtherCAT slave to the hardware configuration.
.

Each added slave will be assigned an additional index which will be zero for the first successfully added slave and then incremented for each successful call to "Cfg.EcAddSlave()".
NOTE: if an complete entry needs to be configured the command "Cfg.EcAddEntryComplete()" should be used. This command will add slave, sync. manger, pdo and entry if needed.

Parameters
aliasAlias of slave. Set to zero to disable.
slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveBusPosition = 0..65535: Addressing of normal EtherCAT slaves.
vendorIdIdentification value for slave vendor.
vendorId = 0x2: Beckhoff.
vendorId = 0x48554B: Kendrion Kuhnke Automation GmbH.
productCodeProduct identification code.
productCode=0x13ed3052: EL5101 incremental encoder input.
Note
All configuration data can be found in the documentaion of the slave, in the ESI slave description file or by using the etherlab (www.etherlab.org) ethercat tool.
Returns
0 if success or otherwise an error code.
Note
Example: Add a EL5101 Beckhoff slave at slave position 1.
"Cfg.EcAddSlave(0,1,0x2,0x13ed3052)" //Command string to ecmcCmdParser.c

◆ ecApplyConfig()

int ecApplyConfig ( int masterIndex)

Apply hardware configuration to master.
.

This command needs to be executed before entering runtime.

Note
This command can only be used in configuration mode.
Parameters
[in]masterIndexIndex of master, see command ecSetMaster().
Returns
0 if success or otherwise an error code.
Note
Example: Apply hardware configuration to master 0 (/dev/EtherCAT0).
"Cfg.EcApplyConfig(0)" //Command string to ecmcCmdParser.c

◆ ecEnablePrintouts()

int ecEnablePrintouts ( int value)

Enable diagnostic printouts from EtherCAT objects.
.

Enables/Disables diagnostic printouts from:

  1. ecmcEc().
  2. ecmcEcSlave().
  3. ecmcEcSyncManager().
  4. ecmcEcPdo().
  5. ecmcEcSDO().
  6. ecmcEcEntry().
    Parameters
    [in]enableEnable diagnostic printouts.
    Returns
    0 if success or otherwise an error code.
    Note
    Example: Enable EtherCAT related diagnostic printouts.
    "Cfg.EcEnablePrintouts(1)" //Command string to ecmcCmdParser.c

◆ ecGetMemMapId()

int ecGetMemMapId ( char * memMapIDString,
int * id )

Get index of a memmap object based on its name id string.

Parameters
[in]memMapIDStringmemmap name
[out]indexindex of memmap corresponding to memMapIDString
Returns
0 if success or otherwise an error code.
Note
Example: Get memmap id.
"EcGetMemMapId("ec0.s2.mm.CH1_ARRAY")" //Command string to ecmcCmdParser.c

◆ ecGetSlaveProductCode()

int ecGetSlaveProductCode ( uint16_t alias,
uint16_t slavePos,
uint32_t * result )

Read product code of selected ethercat slave.

Parameters
[in]aliasAlias of slave. Set to zero to disable.
[in]slaveInPosition of the EtherCAT slave on the bus.
slaveIndex = 0..65535: Addressing of normal EtherCAT slaves.
[out]resultProduct code.
Returns
0 if success or otherwise an error code.
Note
Example: Product Code of slave 3:
"EcGetSlaveProductCode(0,3)" //Command string to ecmcCmdParser.c
Parameters
aliasSlave alias.
slavePosSlave position.

◆ ecGetSlaveRevisionNum()

int ecGetSlaveRevisionNum ( uint16_t alias,
uint16_t slavePos,
uint32_t * result )

revision number id of selected ethercat slave

Parameters
[in]aliasAlias of slave. Set to zero to disable.
[in]slaveInPosition of the EtherCAT slave on the bus.
slaveIndex = 0..65535: Addressing of normal EtherCAT slaves.
[out]resultRevision number.
Returns
0 if success or otherwise an error code.
Note
Example: Read revision number of slave 3:
"EcGetSlaveRevisionNum(0,3)" //Command string to ecmcCmdParser.c
Parameters
aliasSlave alias.
slavePosSlave position.

◆ ecGetSlaveSerialNum()

int ecGetSlaveSerialNum ( uint16_t alias,
uint16_t slavePos,
uint32_t * result )

Read serial number of selected ethercat slave.

Parameters
[in]aliasAlias of slave. Set to zero to disable.
[in]slaveInPosition of the EtherCAT slave on the bus.
slaveIndex = 0..65535: Addressing of normal EtherCAT slaves.
[out]resultSerial number.
Returns
0 if success or otherwise an error code.
Note
Example: Read serial number of slave 3:
"EcGetSlaveSerialNum(0,3)" //Command string to ecmcCmdParser.c
Parameters
aliasSlave alias.
slavePosSlave position.

◆ ecGetSlaveVendorId()

int ecGetSlaveVendorId ( uint16_t alias,
uint16_t slavePos,
uint32_t * result )

Read vendor id of selected ethercat slave.

Parameters
[in]aliasAlias of slave. Set to zero to disable.
[in]slaveInPosition of the EtherCAT slave on the bus.
slaveIndex = 0..65535: Addressing of normal EtherCAT slaves.
[out]resultVendor id.
Returns
0 if success or otherwise an error code.
*
Note
Example: Read vendor id of slave 3:
"EcGetSlaveVendorId(0,3)" //Command string to ecmcCmdParser.c
Parameters
aliasSlave alias.
slavePosSlave position.

◆ ecPrintAllHardware()

int ecPrintAllHardware ( )

Prints all hardware connected to selected master.
.

Returns
0 if success or otherwise an error code.
Note
Example: "EcPrintAllHardware()" //Command string to ecmcCmdParser.c

◆ ecPrintSlaveConfig()

int ecPrintSlaveConfig ( int slaveIndex)

Prints hardware configuration for a selected slave.
.

Returns
0 if success or otherwise an error code.
Note
Example:Print hardware configuration for slave 1 "EcPrintSlaveConfig(1)" //Command string to ecmcCmdParser.c

◆ ecReadSdo()

int ecReadSdo ( uint16_t slavePosition,
uint16_t sdoIndex,
uint8_t sdoSubIndex,
int byteSize,
uint32_t * value )

Write to a Service Data Object.

Note: same as "ecWriteSdo(uint16_t slavePposition,uint16_t sdoIndex,uint8_t sdoSubIndex, uint32_t value,int byteSize)" but without subindex. Complete SDO access will be used.

Read a Service Data Object.

Read will occur directly when the command is issued.

Note
This command can only be used in configuration mode.
Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = 0..65535: Addressing of EtherCAT slaves.
[in]sdoIndexIndex of service data object. Needs to be entered in hex format.
[in]sdoSubIndexSub index of service data object . Needs to be entered in hex format.
[in]byteSizeByte count to read.
[out]dataRead data.
Note
All configuration data can be found in the documentation of the slave, in the ESI slave description file or by using the etherlab (www.etherlab.org) ethercat tool.
Returns
0 if success other wise an error code.
Note
Example: Read maximum current setting of the EL7037 stepper drive card on slave position 2.
"Cfg.EcReadSdo(2,0x8010,0x1,2)" //Command string to ecmcCmdParser.c

◆ ecReadSoE()

int ecReadSoE ( uint16_t slavePosition,
uint8_t driveNo,
uint16_t idn,
size_t byteSize,
uint8_t * value )

Read SoE
.

Note
This command can only be used in configuration mode.
Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = 0..65535: Addressing of EtherCAT slaves.
[in]driveNoSoE drive number.
[in]idnSoE IDN.
[in]byteSizeByte count to read.
[out]valuePointer to read data.
Note
All configuration data can be found in the documentation of the slave
Returns
0 if success other wise an error code.
Note
Example: Read data for drive 0 on slave position 2.
"Cfg.EcReadSoE(2,0,0x1000,2)" //Command string to ecmcCmdParser.c
Parameters
slavePositionSlave position.
driveNoDrive number.
idnSoE IDN (see ecrt_slave_config_idn()).
byteSizeSize of data to write.
valuePointer to data to write.

◆ ecResetError()

int ecResetError ( )

Reset error on all EtherCat objects.
.

Resets error on the following object types:

  1. ecmcEc().
  2. ecmcEcSlave().
  3. ecmcEcSyncManager().
  4. ecmcEcPdo().
  5. ecmcEcSDO().
  6. ecmcEcEntry().
    Returns
    0 if success or otherwise an error code.
    Note
    Example: Reset EtherCAT errors.
    "Cfg.EcResetError()" //Command string to ecmcCmdParser.c

◆ ecResetMaster()

int ecResetMaster ( int masterIndex)

Retry configuring slaves for an selected EtherCAT master.
.

Via this method, the application can tell the master to bring all slaves to OP state. In general, this is not necessary, because it is automatically done by the master. But with special slaves, that can be reconfigured by the vendor during runtime, it can be useful.

Note
masterIndex is not used. Currently only one master is supported and this master will be reset. The masterIndex is for future use.
Parameters
[in]masterIndexEtherCAT master index.
Returns
0 if success or otherwise an error code.
Note
Example: Reset master. Master index is NOT currently supported.
"Cfg.EcResetMaster(10)" //Command string to ecmcCmdParser.c

◆ ecSelectReferenceDC()

int ecSelectReferenceDC ( int masterIndex,
int slaveBusPosition )

Select EtherCAT reference clock.
.

Parameters
[in]masterIndexIndex of master, see command ecSetMaster().
[in]slaveBusPositionPosition of the EtherCAT slave on the bus. Note: the slave needs to be equipped with a DC.
slaveBusPosition = 0..65535: Addressing of EtherCAT slaves.
*
Returns
0 if success or otherwise an error code.
Note
Example: Select slave 3 as reference clock for master 0.
"Cfg.EcSelectReferenceDC(0,3)" //Command string to ecmcCmdParser.c

◆ ecSetDelayECOkAtStartup()

int ecSetDelayECOkAtStartup ( int milliseconds)

Delay ethercat OK status for a time.

This can be usefull to allow extra time foir DC clocks to syncronize or
for slave that do not report correct data directlly when enter OP.

Parameters
[in]millisecondsDelay time for ecOK status at startup (after slaves in OP).
Returns
0 if success or otherwise an error code.
Note
Example: Delay ethercat OK for 2000ms at startup "Cfg.ecSetDelayECOkAtStartup(2000)" //Command string to ecmcCmdParser.c

◆ ecSetDiagnostics()

int ecSetDiagnostics ( int enable)

Enable EtherCAT bus diagnostics.
.

Diagnostics are made at three different levels:

  1. Slave level.
  2. Domain level.
  3. Master level.
    All three levels of diagnostics are enabled or disabled with this command. If the diagnostics are enabled the motion axes are interlocked if any of the above levels report issues. If the diagnostics are disabled the motion axes are not interlocked even if there's alarms on the EtherCAT bus.
    Parameters
    [in]enableEnable diagnostics.
    Returns
    0 if success or otherwise an error code.
    Note
    Example: Enable EtherCAT diagnostics.
    "Cfg.EcSetDiagnostics(1)" //Command string to ecmcCmdParser.c

◆ ecSetDomainFailedCyclesLimit()

int ecSetDomainFailedCyclesLimit ( int cycles)

Set allowed bus cycles in row of none complete domain data transfer.
.

Allows a certain number of bus cycles of non-complete domain data transfer before alarming.

Note
Normally the application is correct configured all domain data transfers should be complete. This command should therefor only be used for testing purpose when the final configuration is not yet made.
Parameters
[in]cyclesNumber of cycles.
Returns
0 if success or otherwise an error code.
Note
Example: Set the allowd bus cycles of non complete domain data to 10.
"Cfg.EcSetDomainFailedCyclesLimit(10)" //Command string to ecmcCmdParser.c

◆ ecSetDomAllowOffline()

int ecSetDomAllowOffline ( int allow)

Allow domain to be offline.

Parameters
[in]allow0 ==dont't allow (default), 1 == allow
Returns
0 if success or otherwise an error code.
Note
Example: Allow current domain to be offline. "Cfg.EcSetDomAllowOffline(1)" //Command string to ecmcCmdParser.c

◆ ecSetEcAllowOffline()

int ecSetEcAllowOffline ( int allow)

Allow master to be offline.

Parameters
[in]allow0 ==dont't allow (default), 1 == allow
Returns
0 if success or otherwise an error code.
Note
Example: Allow master to be offline. "Cfg.EcSetEcAllowOffline(1)" //Command string to ecmcCmdParser.c

◆ ecSetEntryUpdateInRealtime()

int ecSetEntryUpdateInRealtime ( uint16_t slavePosition,
char * entryIDString,
int updateInRealtime )

Set update in realtime bit for an entry.

If set to zero the entry will not be updated during realtime operation.
Useful when accessing data with memory maps instead covering many entries like oversampling arrays (it's then unnecessary to update each entry in array).

Parameters
[in]slavePositionPosition of the EtherCAT slave on the bus.
slavePosition = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveBusPosition = 0..65535: Addressing of normal EtherCAT slaves.
[in]entryIdStringString for addressing purpose (see command "Cfg.EcAddEntryComplete() for more information").
[in]updateInRealtime1 for update of entry data in realtime and 0 not to update data in realtime.
Note
Example: Disable update of value in realtime for entry with name "AI_1" on bus position 5.
"Cfg.EcSetEntryUpdateInRealtime(5,AI_1,0)" //Command string to ecmcCmdParser.c

◆ ecSetMaster()

int ecSetMaster ( int masterIndex)

Selects EtherCAT master to use.
.

Parameters
[in]masterIndexEtherCAT master index.
Returns
0 if success or otherwise an error code.
Note
Example: Select /dev/EtherCAT0.
"Cfg.EcSetMaster(0)" //Command string to ecmcCmdParser.c

◆ ecSlaveConfigDC()

int ecSlaveConfigDC ( int slaveBusPosition,
uint16_t assignActivate,
uint32_t sync0Cycle,
int32_t sync0Shift,
uint32_t sync1Cycle,
int32_t sync1Shift )

Configure slave DC clock.
.

Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = 0..65535: Addressing of EtherCAT slaves.
*
[in]assignActivateA* Each added slave will be assigned an additional index which will be zero for the first successfully added slave and then incremented for each successful call to "Cfg.EcAddSlave()".
assign active word. This information can be found in the ESI slave description file. Needs to be entered in hex format.
[in]sync0CycleCycle time in ns.
[in]sync0ShiftPhase shift in ns.
[in]sync1CycleCycle time in ns.
[in]sync1ShiftNot used.
Returns
0 if success or otherwise an error code.
Note
Example: Configure the DC clock of an EL5101 incremental encoder input card: slaveBusPosition=1, assignActivate=0x320, sync0Cycle=1000000 (1kHz), sync0Shift=10, sync1Cycle=1000000 (1kHz).
"Cfg.EcSlaveConfigDC(1,0x320,1000000,10,1000000,0)" //Command string to ecmcCmdParser.c
Parameters
assignActivateAssignActivate word.
sync0CycleSYNC0 cycle time [ns].
sync0ShiftSYNC0 shift time [ns].
sync1CycleSYNC1 cycle time [ns].
sync1ShiftSYNC1 shift time [ns].

◆ ecSlaveConfigWatchDog()

int ecSlaveConfigWatchDog ( int slaveBusPosition,
int watchdogDivider,
int watchdogIntervals )

Configure Slave watch dog.
.

Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus. Note: the slave needs to be equipped with a DC.
slaveBusPosition = 0..65535: Addressing of EtherCAT slaves.
[in]watchdogDividerNumber of 40 ns intervals. Used as a base unit for all slave watchdogs. If set to zero, the value is not written, so the default is used.
[in]watchdogIntervalsNumber of base intervals for process data watchdog. If set to zero, the value is not written, so the default is used.
Note
Example: Set watchdog times to 100,100 for slave at busposition 1.
"Cfg.EcSlaveConfigWatchDog(1,100,100)" //Command string to ecmcCmdParser.c
Returns
0 if success or otherwise an error code.

◆ ecUseClockRealtime()

int ecUseClockRealtime ( int useClkRT)

Use CLOCK_REALTIME.

Ecmc will as default use CLOCK_MONOTONIC as clock source both for
the RT loop and the ethercat bus.

Parameters
[in]useClkRTSelect clock useClkRT = 0: Use CLOCK_MONOTONIC.
useClkRT = 1: Use CLOCK_REALTIME.
Returns
0 if success or otherwise an error code.
Note
Example: Use CLOCK_REALTIME:
"Cfg.EcUseClockRealtime(1)" //Command string to ecmcCmdParser.c

◆ ecVerifySdo()

int ecVerifySdo ( uint16_t slavePosition,
uint16_t sdoIndex,
uint8_t sdoSubIndex,
uint32_t verValue,
int byteSize )

Verify a Service Data Object.

Read will occur directly when the command is issued.

Note
This command can only be used in configuration mode.
Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = 0..65535: Addressing of EtherCAT slaves.
[in]sdoIndexIndex of service data object. Needs to be entered in hex format.
[in]sdoSubIndexSub index of service data object . Needs to be entered in hex format.
[in]byteSizeByte count to read.
[in]verValueExpected value of SDO.
Note
All configuration data can be found in the documentation of the slave, in the ESI slave description file or by using the etherlab (www.etherlab.org) ethercat tool.
Returns
0 if success other wise an error code.
Note
Example: Verify maximum current setting of the EL7037 stepper drive card on slave position 2 is set to 1000mA.
"Cfg.EcVerifySdo(2,0x8010,0x1,1000,2)" //Command string to ecmcCmdParser.c

◆ ecVerifySlave()

int ecVerifySlave ( uint16_t alias,
uint16_t slavePos,
uint32_t vendorId,
uint32_t productCode,
uint32_t revisionNum )

Verfy slave at position.

The command verifys that the actual slave at a certain position\ have the correct alias, position, vendor id, product code and revision number.
Check of slave revsion number will be skipped if set to 0.

Parameters
[in]aliasAlias of slave. Set to zero to disable.
[in]slaveInPosition of the EtherCAT slave on the bus.
slaveIndex = 0..65535: Addressing of normal EtherCAT slaves.
[in]vendorIdIdentification value for slave vendor.
vendorId = 0x2: Beckhoff.
vendorId = 0x48554B: Kendrion Kuhnke Automation GmbH.
productCodeProduct identification code.
productCode=0x13ed3052: EL5101 incremental encoder input.
revisionNumProduct revision number. The revsion number of the
actual slave needs to equal or newer than that of the configuration.
if revisionNum==0 then this function will not check revsionNum of
the slave. revisionNum=0x04000000: EL5101 incremental encoder input.
Returns
0 if success or otherwise an error code.
Note
Example: Verify that slave 3 is an EL5101 with a revsion >= 0x04000000
"Cfg.EcVerifySlave(0,3,0x2,0x13ed3052,0x04000000)" //Command string to ecmcCmdParser.c
Parameters
aliasSlave alias.
slavePosSlave position.
vendorIdExpected vendor ID.
productCodeExpected product code.
revisionNumRevision number

◆ ecWriteSdo()

int ecWriteSdo ( uint16_t slavePosition,
uint16_t sdoIndex,
uint8_t sdoSubIndex,
uint32_t value,
int byteSize )

Write to a Service Data Object.

Writing will occur directly when the command is issued.

Note
This command can only be used in configuration mode.
Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = 0..65535: Addressing of EtherCAT slaves.
[in]sdoIndexIndex of service data object. Needs to be entered in hex format.
[in]sdoSubIndexSub index of service data object . Needs to be entered in hex format.
[in]valueValue to write.
[in]byteSizeByte count to write.
Note
All configuration data can be found in the documentation of the slave, in the ESI slave description file or by using the etherlab (www.etherlab.org) ethercat tool.
Returns
0 if success or otherwise an error code.
Note
Example: Write 1A (1000mA) to maximum current of the EL7037 stepper drive card on slave position 2.
"Cfg.EcWriteSdo(2,0x8010,0x1,1000,2)" //Command string to ecmcCmdParser.c

◆ ecWriteSoE()

int ecWriteSoE ( uint16_t slavePosition,
uint8_t driveNo,
uint16_t idn,
size_t byteSize,
uint8_t * value )

Write SoE
.

Note
This command can only be used in configuration mode.
Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = 0..65535: Addressing of EtherCAT slaves.
[in]driveNoSoE drive number.
[in]idnSoE IDN.
[in]byteSizeByte count to write.
[out]valuePointer to data to write.
Note
All configuration data can be found in the documentation of the slave
Returns
0 if success other wise an error code.
Note
Example: Read data for drive 0 on slave position 2.
"Cfg.EcWriteSoE(2,0,0x1000,2)" //Command string to ecmcCmdParser.c
Parameters
slavePositionSlave position.
driveNoDrive number.
idnSoE IDN (see ecrt_slave_config_idn()).
byteSizeSize of data to write.
valuePointer to data to write.

◆ linkEcEntryToEcStatusOutput()

int linkEcEntryToEcStatusOutput ( int slaveIndex,
char * entryIDString )

Links an EtherCAT entry to the ethecat master object for hardware status output
.

The output will be high when the EtherCAT master is without error code and otherwise zero.

Parameters
[in]slaveIndexPosition of the EtherCAT slave on the bus.
slaveIndex = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveIndex = 0..65535: Addressing of normal EtherCAT slaves.
[in]entryIdStringString for addressing purpose (see command "Cfg.EcAddEntryComplete() for more information").
Returns
0 if success or otherwise an error code.
Note
Example 1: Link an EtherCAT entry configured as "OUTPUT_0" in slave 1 as status output for ethercat master.
"Cfg.LinkEcEntryToEcStatusOutput(1,"OUTPUT_0")" //Command string to ecmcCmdParser.c

◆ readEcEntry()

int readEcEntry ( int slaveIndex,
int entryIndex,
uint64_t * value )

Read a value from an EtherCAT entry.
.

Parameters
[in]slaveIndexIndex of order of added slave (not bus position), see command EcAddSlave()).
[in]entryIndexIndex of order of added entry (within slave).
[out]valueRead value (result).
Note
the slaveIndex and entryIndex can be read with the commands readEcSlaveIndex() and readEcEntryIndexIDString().
Returns
0 if success or otherwise an error code.
Note
Example: Read the 2:nd added entry (entryIndex=1) in the 4:th added slave (slaveIndex=3).
"ReadEcEntry(3,1)" //Command string to ecmcCmdParser.c

◆ readEcEntryIDString()

int readEcEntryIDString ( int slavePosition,
char * entryIDString,
uint64_t * value )

Read a value from an EtherCAT entry addressed by slaveBusPosition and entryIdString.
.

Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveBusPosition = 0..65535: Addressing of normal EtherCAT slaves.
[in]entryIdStringString for addressing purpose (see command "Cfg.EcAddEntryComplete() for more information").
[out]valueRead value (result).
Note: This command should not be used when realtime performance is needed (also see "WriteECEntry()" command).
Returns
0 if success or otherwise an error code.
Note
Example: Read a digital input configured as "INPUT_0" on slave 1
"ReadEcEntryIDString(1,INPUT_0)" //Command string to ecmcCmdParser.c

◆ readEcEntryIndexIDString()

int readEcEntryIndexIDString ( int slavePosition,
char * entryIDString,
int * value )

Read the object Index of an entry addressed by slaveBusPosition and entryIdString.
.

The first entry added in a slave will receive index 0, then for each added entry, its index will be incremented by one. This index will be returned by this function. This index is needed to address a certain slave with the commands readEcEntry() and writeEcEntry() (for use in realtime, since these functions address the slave and entry arrays directly via indices).

Note
This is not the same as the entryIndex in EcAddEntryComplete().
Todo
Change confusing naming of this function. entryIndex and index of entry is easily confused.
Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveBusPosition = 0..65535: Addressing of normal EtherCAT slaves.
[in]entryIdStringString for addressing purpose (see command "Cfg.EcAddEntryComplete() for more information").
[out]valueEntry index (the order is was added).
Returns
0 if success or otherwise an error code.
Note
Example: Read a the index of an entry configured as "INPUT_0" on slave 1
"ReadEcEntryIndexIDString(1,INPUT_0)" //Command string to ecmcCmdParser.c

◆ readEcMemMap()

int readEcMemMap ( const char * memMapIDString,
uint8_t * data,
size_t bytesToRead,
size_t * bytesRead )

Read EtherCAT memory map object.

Fast access of EtherCAT data from EPICS records is possible by linking an EtherCAT memory map to an ASYN parameter. The memory map objects is most usefull for acquire arrays of data (waveforms).This function is called by the iocsh command"ecmcAsynPortDriverAddParameter()". For more information see documentation of ecmcAsynPortDriverAddParameter(), ecAddMemMap(), readEcMemMap() and ecSetEntryUpdateInRealtime().

Parameters
[in]memMapIDStringString for addressing ethercat entry:
ec.mm.<memory map id>
[out]*dataOutput data buffer.
*
[in]bytesToReadOutput data buffer size.
*
[out]bytesReadBytes read.
*
Returns
0 if success or otherwise an error code.
Note
Example: memMapIDString for an memory map called "AI_1_ARRAY": "ec.mm.AI_1_ARRAY".
There's no ascii command in ecmcCmdParser.c for this method.

◆ readEcSlaveIndex()

int readEcSlaveIndex ( int slavePosition,
int * value )

Read the object Index of an slave addressed by slaveBusPosition.
.

The first slave added in will receive index 0, then for each added slave, its index will be incremented by one. This index will be returned by this function. This index is needed to address a certain slave with the commands readEcEntry() and writeEcEntry() (for use in realtime, since these functions address the slave and entry arrays directly via indices).

Note
slaveIndex and slaveBusPosition is not the same.
Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveBusPosition = 0..65535: Addressing of normal EtherCAT slaves.
Returns
0 if success or otherwise an error code.
Note
Example: Read the slave index of the slave with bus position 5.
"ReadEcSlaveIndex(5)" //Command string to ecmcCmdParser.c

◆ writeEcEntry()

int writeEcEntry ( int slaveIndex,
int entryIndex,
uint64_t value )

Writes a value to an EtherCAT entry.
.

Parameters
[in]slaveIndexIndex of order of added slave (not bus position), see command EcAddSlave()).
[in]entryIndexIndex of order of added entry (within slave).
[in]valueValue to be written.
Note
the slaveIndex and entryIndex can be read with the commands readEcSlaveIndex() and readEcEntryIndexIDString().
Returns
0 if success or otherwise an error code.
Note
Example: Write a 0 to the 2:nd added entry (entryIndex=1) in the 4:th added slave (slaveIndex=3).
"WriteEcEntry(3,1,0)" //Command string to ecmcCmdParser.c

◆ writeEcEntryIDString()

int writeEcEntryIDString ( int slaveBusPosition,
char * entryIdString,
uint64_t value )

Writes a value to an EtherCAT entry addressed by slaveBusPosition and entryIdString.
.

Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveBusPosition = 0..65535: Addressing of normal EtherCAT slaves.
[in]entryIdStringString for addressing purpose (see command "Cfg.EcAddEntryComplete() for more information").
[in]valueValue to be written.
Note: This command should not be used when realtime performance is needed (also see "WriteECEntry()" command).
Returns
0 if success or otherwise an error code.
Note
Example: Write a 1 to a digital output configured as "OUTPUT_0" on slave 1
"Cfg.WriteEcEntryIDString(1,OUTPUT_1,1)" //Command string to ecmcCmdParser.c