diff --git a/.gitignore b/.gitignore index 5bcf675..eb452f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ build* install *~ +/doc/latex +/doc/html diff --git a/doc/html/annotated.html b/doc/html/annotated.html deleted file mode 100644 index 8600202..0000000 --- a/doc/html/annotated.html +++ /dev/null @@ -1,92 +0,0 @@ - - -
- -
- SOEM v1.3.1
- |
-
ec_adaptert | |
ec_ALstatuscodelist_t | |
ec_alstatust | |
ec_comt | |
ec_configlist_t | |
ec_eepromFMMUt | |
ec_eepromPDOt | |
ec_eepromSMt | |
ec_eepromt | |
ec_emcyt | |
ec_eringt | |
ec_errort | |
ec_etherheadert | |
ec_fmmut | |
ec_FOEt | |
ec_groupt | |
ec_idxstackT | |
ec_mbxerrorlist_t | |
ec_mbxerrort | |
ec_mbxheadert | |
ec_ODlistt | |
ec_OElistt | |
ec_PDOassignt | |
ec_PDOdesct | |
ec_sdoerrorlist_t | |
ec_SDOservicet | |
ec_SDOt | |
ec_slavet | |
ec_SMcommtypet | |
ec_smt | |
ec_SoEattributet | |
ec_soeerrorlist_t | |
ec_SoElistt | |
ec_SoEmappingt | |
ec_SoEnamet | |
ec_SoEt | |
ec_state_status | |
ecx_contextt | |
ecx_mapt_t | |
in_EBOX_streamt | |
in_EBOXt | |
out_EBOX_streamt | |
out_EBOXt |
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
Example code for Simple Open EtherCAT master. -More...
-#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <unistd.h>
#include <sched.h>
#include <string.h>
#include <time.h>
#include <pthread.h>
#include <math.h>
#include "ethercattype.h"
#include "nicdrv.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatcoe.h"
#include "ethercatconfig.h"
#include "ethercatdc.h"
-Data Structures | |
struct | in_EBOXt |
struct | in_EBOX_streamt |
struct | out_EBOXt |
struct | out_EBOX_streamt |
-Defines | |
#define | NSEC_PER_SEC 1000000000 |
#define | MAXSTREAM 200000 |
#define | SYNC0TIME 8000 |
-Functions | |
int | output_cvs (char *fname, int length) |
void | eboxtest (char *ifname) |
void | add_timespec (struct timespec *ts, int64 addtime) |
void | ec_sync (int64 reftime, int64 cycletime, int64 *offsettime) |
void | ecatthread (void *ptr) |
int | main (int argc, char *argv[]) |
-Variables | |
struct sched_param | schedp |
char | IOmap [4096] |
pthread_t | thread1 |
struct timeval tv t1 | t2 |
int | dorun = 0 |
int | deltat |
int | tmax = 0 |
int64 | toff |
int | DCdiff |
int | os |
uint32 | ob |
int16 | ob2 |
uint8 | ob3 |
pthread_cond_t | cond = PTHREAD_COND_INITIALIZER |
pthread_mutex_t | mutex = PTHREAD_MUTEX_INITIALIZER |
int64 | integral = 0 |
uint32 | cyclecount |
in_EBOX_streamt * | in_EBOX |
out_EBOX_streamt * | out_EBOX |
double | ain [2] |
int | ainc |
int | streampos |
int16 | stream1 [MAXSTREAM] |
int16 | stream2 [MAXSTREAM] |
Example code for Simple Open EtherCAT master.
-Usage : ebox [ifname] [cycletime] ifname is NIC interface, f.e. eth0 cycletime in us, f.e. 500
-This test is specifically build for the E/BOX.
-(c)Arthur Ketels 2011
-#define MAXSTREAM 200000 | -
#define NSEC_PER_SEC 1000000000 | -
#define SYNC0TIME 8000 | -
void add_timespec | -( | -struct timespec * | -ts, | -
- | - | int64 | -addtime | -
- | ) | -- |
void eboxtest | -( | -char * | -ifname | ) | -- |
void ec_sync | -( | -int64 | -reftime, | -
- | - | int64 | -cycletime, | -
- | - | int64 * | -offsettime | -
- | ) | -- |
void ecatthread | -( | -void * | -ptr | ) | -- |
int main | -( | -int | -argc, | -
- | - | char * | -argv[] | -
- | ) | -- |
int output_cvs | -( | -char * | -fname, | -
- | - | int | -length | -
- | ) | -- |
double ain[2] | -
int ainc | -
pthread_cond_t cond = PTHREAD_COND_INITIALIZER | -
uint32 cyclecount | -
int DCdiff | -
int deltat | -
int dorun = 0 | -
in_EBOX_streamt* in_EBOX | -
int64 integral = 0 | -
char IOmap[4096] | -
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER | -
uint32 ob | -
int16 ob2 | -
uint8 ob3 | -
int os | -
out_EBOX_streamt* out_EBOX | -
struct sched_param schedp | -
int16 stream1[MAXSTREAM] | -
int16 stream2[MAXSTREAM] | -
int streampos | -
struct timeval tv t1 t2 | -
pthread_t thread1 | -
int tmax = 0 | -
int64 toff | -
- SOEM v1.3.1
- |
-
EEprom tool for Simple Open EtherCAT master. -More...
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include <time.h>
#include "ethercattype.h"
#include "nicdrv.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatcoe.h"
-Defines | |
#define | MAXBUF 32768 |
#define | STDBUF 2048 |
#define | MINBUF 128 |
#define | CRCBUF 14 |
#define | MODE_NONE 0 |
#define | MODE_READBIN 1 |
#define | MODE_READINTEL 2 |
#define | MODE_WRITEBIN 3 |
#define | MODE_WRITEINTEL 4 |
#define | MODE_WRITEALIAS 5 |
#define | MODE_INFO 6 |
#define | MAXSLENGTH 256 |
#define | IHEXLENGTH 0x20 |
-Functions | |
void | calc_crc (uint8 *crc, uint8 b) |
uint16 | SIIcrc (uint8 *buf) |
int | input_bin (char *fname, int *length) |
int | input_intelhex (char *fname, int *start, int *length) |
int | output_bin (char *fname, int length) |
int | output_intelhex (char *fname, int length) |
int | eeprom_read (int slave, int start, int length) |
int | eeprom_write (int slave, int start, int length) |
int | eeprom_writealias (int slave, int alias, uint16 crc) |
void | eepromtool (char *ifname, int slave, int mode, char *fname) |
int | main (int argc, char *argv[]) |
-Variables | |
uint8 | ebuf [MAXBUF] |
uint8 | ob |
uint16 | ow |
int | os |
int | slave |
int | alias |
struct timeval tstart tend | tdif |
int | wkc |
int | mode |
char | sline [MAXSLENGTH] |
EEprom tool for Simple Open EtherCAT master.
-Usage : eepromtool ifname slave OPTION fname|alias ifname is NIC interface, f.e. eth0 slave = slave number in EtherCAT order 1..n -r read EEPROM, output binary format -ri read EEPROM, output Intel Hex format -w write EEPROM, input binary format -wi write EEPROM, input Intel Hex format -i display EEPROM information -walias write slave alias in EEPROM
-(c)Arthur Ketels 2010-2012
-#define CRCBUF 14 | -
#define IHEXLENGTH 0x20 | -
#define MAXBUF 32768 | -
#define MAXSLENGTH 256 | -
#define MINBUF 128 | -
#define MODE_INFO 6 | -
#define MODE_NONE 0 | -
#define MODE_READBIN 1 | -
#define MODE_READINTEL 2 | -
#define MODE_WRITEALIAS 5 | -
#define MODE_WRITEBIN 3 | -
#define MODE_WRITEINTEL 4 | -
#define STDBUF 2048 | -
void calc_crc | -( | -uint8 * | -crc, | -
- | - | uint8 | -b | -
- | ) | -- |
int eeprom_read | -( | -int | -slave, | -
- | - | int | -start, | -
- | - | int | -length | -
- | ) | -- |
int eeprom_write | -( | -int | -slave, | -
- | - | int | -start, | -
- | - | int | -length | -
- | ) | -- |
int eeprom_writealias | -( | -int | -slave, | -
- | - | int | -alias, | -
- | - | uint16 | -crc | -
- | ) | -- |
void eepromtool | -( | -char * | -ifname, | -
- | - | int | -slave, | -
- | - | int | -mode, | -
- | - | char * | -fname | -
- | ) | -- |
int input_bin | -( | -char * | -fname, | -
- | - | int * | -length | -
- | ) | -- |
int input_intelhex | -( | -char * | -fname, | -
- | - | int * | -start, | -
- | - | int * | -length | -
- | ) | -- |
int main | -( | -int | -argc, | -
- | - | char * | -argv[] | -
- | ) | -- |
int output_bin | -( | -char * | -fname, | -
- | - | int | -length | -
- | ) | -- |
int output_intelhex | -( | -char * | -fname, | -
- | - | int | -length | -
- | ) | -- |
uint16 SIIcrc | -( | -uint8 * | -buf | ) | -- |
int alias | -
uint8 ebuf[MAXBUF] | -
int mode | -
uint8 ob | -
int os | -
uint16 ow | -
int slave | -
char sline[MAXSLENGTH] | -
struct timeval tstart tend tdif | -
int wkc | -
- SOEM v1.3.1
- |
-
Base EtherCAT functions. -More...
-#include <stdio.h>
#include <string.h>
#include "oshw.h"
#include "osal.h"
#include "ethercattype.h"
#include "ethercatbase.h"
-Functions | |
static void | ecx_writedatagramdata (void *datagramdata, ec_cmdtype com, uint16 length, const void *data) |
int | ecx_setupdatagram (ecx_portt *port, void *frame, uint8 com, uint8 idx, uint16 ADP, uint16 ADO, uint16 length, void *data) |
int | ecx_adddatagram (ecx_portt *port, void *frame, uint8 com, uint8 idx, boolean more, uint16 ADP, uint16 ADO, uint16 length, void *data) |
int | ecx_BWR (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ecx_BRD (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ecx_APRD (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ecx_ARMW (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ecx_FRMW (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
uint16 | ecx_APRDw (ecx_portt *port, uint16 ADP, uint16 ADO, int timeout) |
int | ecx_FPRD (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
uint16 | ecx_FPRDw (ecx_portt *port, uint16 ADP, uint16 ADO, int timeout) |
int | ecx_APWR (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ecx_APWRw (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 data, int timeout) |
int | ecx_FPWR (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ecx_FPWRw (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 data, int timeout) |
int | ecx_LRW (ecx_portt *port, uint32 LogAdr, uint16 length, void *data, int timeout) |
int | ecx_LRD (ecx_portt *port, uint32 LogAdr, uint16 length, void *data, int timeout) |
int | ecx_LWR (ecx_portt *port, uint32 LogAdr, uint16 length, void *data, int timeout) |
int | ecx_LRWDC (ecx_portt *port, uint32 LogAdr, uint16 length, void *data, uint16 DCrs, int64 *DCtime, int timeout) |
int | ec_setupdatagram (void *frame, uint8 com, uint8 idx, uint16 ADP, uint16 ADO, uint16 length, void *data) |
int | ec_adddatagram (void *frame, uint8 com, uint8 idx, boolean more, uint16 ADP, uint16 ADO, uint16 length, void *data) |
int | ec_BWR (uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ec_BRD (uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ec_APRD (uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ec_ARMW (uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ec_FRMW (uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
uint16 | ec_APRDw (uint16 ADP, uint16 ADO, int timeout) |
int | ec_FPRD (uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
uint16 | ec_FPRDw (uint16 ADP, uint16 ADO, int timeout) |
int | ec_APWR (uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ec_APWRw (uint16 ADP, uint16 ADO, uint16 data, int timeout) |
int | ec_FPWR (uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ec_FPWRw (uint16 ADP, uint16 ADO, uint16 data, int timeout) |
int | ec_LRW (uint32 LogAdr, uint16 length, void *data, int timeout) |
int | ec_LRD (uint32 LogAdr, uint16 length, void *data, int timeout) |
int | ec_LWR (uint32 LogAdr, uint16 length, void *data, int timeout) |
int | ec_LRWDC (uint32 LogAdr, uint16 length, void *data, uint16 DCrs, int64 *DCtime, int timeout) |
Base EtherCAT functions.
-Setting up a datagram in an ethernet frame. EtherCAT datagram primitives, broadcast, auto increment, configured and logical addressed data transfers. All base transfers are blocking, so wait for the frame to be returned to the master or timeout. If this is not acceptable build your own datagrams and use the functions from nicdrv.c.
-int ec_adddatagram | -( | -void * | -frame, | -
- | - | uint8 | -com, | -
- | - | uint8 | -idx, | -
- | - | boolean | -more, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data | -
- | ) | -- |
int ec_APRD | -( | -uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
uint16 ec_APRDw | -( | -uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_APWR | -( | -uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_APWRw | -( | -uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -data, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_ARMW | -( | -uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_BRD | -( | -uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_BWR | -( | -uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_FPRD | -( | -uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
uint16 ec_FPRDw | -( | -uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_FPWR | -( | -uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_FPWRw | -( | -uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -data, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_FRMW | -( | -uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_LRD | -( | -uint32 | -LogAdr, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_LRW | -( | -uint32 | -LogAdr, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_LRWDC | -( | -uint32 | -LogAdr, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | uint16 | -DCrs, | -
- | - | int64 * | -DCtime, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_LWR | -( | -uint32 | -LogAdr, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_setupdatagram | -( | -void * | -frame, | -
- | - | uint8 | -com, | -
- | - | uint8 | -idx, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data | -
- | ) | -- |
int ecx_adddatagram | -( | -ecx_portt * | -port, | -
- | - | void * | -frame, | -
- | - | uint8 | -com, | -
- | - | uint8 | -idx, | -
- | - | boolean | -more, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data | -
- | ) | -- |
Add EtherCAT datagram to a standard ethernet frame with existing datagram(s).
-[in] | port | = port context struct |
[out] | frame | = framebuffer |
[in] | com | = command |
[in] | idx | = index used for TX and RX buffers |
[in] | more | = TRUE if still more datagrams to follow |
[in] | ADP | = Address Position |
[in] | ADO | = Address Offset |
[in] | length | = length of datagram excluding EtherCAT header |
[in] | data | = databuffer to be copied in datagram |
int ecx_APRD | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
APRD "auto increment address read" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, each slave ++, slave that has 0 excecutes |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[out] | data | = databuffer to put slave data in |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
uint16 ecx_APRDw | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | int | -timeout | -
- | ) | -- |
APRDw "auto increment address read" word return primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, each slave ++, slave that has 0 reads. |
[in] | ADO | = Address Offset, slave memory address |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_APWR | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
APWR "auto increment address write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, each slave ++, slave that has 0 writes. |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[in] | data | = databuffer to write to slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_APWRw | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -data, | -
- | - | int | -timeout | -
- | ) | -- |
APWRw "auto increment address write" word primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, each slave ++, slave that has 0 writes. |
[in] | ADO | = Address Offset, slave memory address |
[in] | data | = word data to write to slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_ARMW | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
APRMW "auto increment address read, multiple write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, each slave ++, slave that has 0 reads, following slaves write. |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[out] | data | = databuffer to put slave data in |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_BRD | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
BRD "broadcast read" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, normally 0 |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[out] | data | = databuffer to put slave data in |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_BWR | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
BRW "broadcast write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, normally 0 |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[in] | data | = databuffer to be written to slaves |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_FPRD | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
FPRD "configured address read" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, slave that has address reads. |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[out] | data | = databuffer to put slave data in |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
uint16 ecx_FPRDw | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | int | -timeout | -
- | ) | -- |
FPRDw "configured address read" word return primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, slave that has address reads. |
[in] | ADO | = Address Offset, slave memory address |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_FPWR | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
FPWR "configured address write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, slave that has address writes. |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[in] | data | = databuffer to write to slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_FPWRw | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -data, | -
- | - | int | -timeout | -
- | ) | -- |
FPWR "configured address write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, slave that has address writes. |
[in] | ADO | = Address Offset, slave memory address |
[in] | data | = word to write to slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_FRMW | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
FPRMW "configured address read, multiple write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, slave that has address reads, following slaves write. |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[out] | data | = databuffer to put slave data in |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_LRD | -( | -ecx_portt * | -port, | -
- | - | uint32 | -LogAdr, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
LRD "logical memory read" primitive. Blocking.
-[in] | port | = port context struct |
[in] | LogAdr | = Logical memory address |
[in] | length | = length of bytes to read from slave. |
[out] | data | = databuffer to read from slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_LRW | -( | -ecx_portt * | -port, | -
- | - | uint32 | -LogAdr, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
LRW "logical memory read / write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | LogAdr | = Logical memory address |
[in] | length | = length of databuffer |
[in,out] | data | = databuffer to write to and read from slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_LRWDC | -( | -ecx_portt * | -port, | -
- | - | uint32 | -LogAdr, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | uint16 | -DCrs, | -
- | - | int64 * | -DCtime, | -
- | - | int | -timeout | -
- | ) | -- |
LRW "logical memory read / write" primitive plus Clock Distribution. Blocking. Frame consists of two datagrams, one LRW and one FPRMW.
-[in] | port | = port context struct |
[in] | LogAdr | = Logical memory address |
[in] | length | = length of databuffer |
[in,out] | data | = databuffer to write to and read from slave. |
[in] | DCrs | = Distributed Clock reference slave address. |
[out] | DCtime | = DC time read from reference slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_LWR | -( | -ecx_portt * | -port, | -
- | - | uint32 | -LogAdr, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
LWR "logical memory write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | LogAdr | = Logical memory address |
[in] | length | = length of databuffer |
[in] | data | = databuffer to write to slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_setupdatagram | -( | -ecx_portt * | -port, | -
- | - | void * | -frame, | -
- | - | uint8 | -com, | -
- | - | uint8 | -idx, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data | -
- | ) | -- |
Generate and set EtherCAT datagram in a standard ethernet frame.
-[in] | port | = port context struct |
[out] | frame | = framebuffer |
[in] | com | = command |
[in] | idx | = index used for TX and RX buffers |
[in] | ADP | = Address Position |
[in] | ADO | = Address Offset |
[in] | length | = length of datagram excluding EtherCAT header |
[in] | data | = databuffer to be copied in datagram |
static void ecx_writedatagramdata | -( | -void * | -datagramdata, | -
- | - | ec_cmdtype | -com, | -
- | - | uint16 | -length, | -
- | - | const void * | -data | -
- | ) | - [static] |
-
Write data to EtherCAT datagram.
-[out] | datagramdata | = data part of datagram |
[in] | com | = command |
[in] | length | = length of databuffer |
[in] | data | = databuffer to be copied into datagram |
- SOEM v1.3.1
- |
-
Headerfile for ethercatbase.c. -More...
--Functions | |
int | ecx_setupdatagram (ecx_portt *port, void *frame, uint8 com, uint8 idx, uint16 ADP, uint16 ADO, uint16 length, void *data) |
int | ecx_adddatagram (ecx_portt *port, void *frame, uint8 com, uint8 idx, boolean more, uint16 ADP, uint16 ADO, uint16 length, void *data) |
int | ecx_BWR (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ecx_BRD (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ecx_APRD (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ecx_ARMW (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ecx_FRMW (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
uint16 | ecx_APRDw (ecx_portt *port, uint16 ADP, uint16 ADO, int timeout) |
int | ecx_FPRD (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
uint16 | ecx_FPRDw (ecx_portt *port, uint16 ADP, uint16 ADO, int timeout) |
int | ecx_APWRw (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 data, int timeout) |
int | ecx_APWR (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ecx_FPWRw (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 data, int timeout) |
int | ecx_FPWR (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout) |
int | ecx_LRW (ecx_portt *port, uint32 LogAdr, uint16 length, void *data, int timeout) |
int | ecx_LRD (ecx_portt *port, uint32 LogAdr, uint16 length, void *data, int timeout) |
int | ecx_LWR (ecx_portt *port, uint32 LogAdr, uint16 length, void *data, int timeout) |
int | ecx_LRWDC (ecx_portt *port, uint32 LogAdr, uint16 length, void *data, uint16 DCrs, int64 *DCtime, int timeout) |
Headerfile for ethercatbase.c.
-int ecx_adddatagram | -( | -ecx_portt * | -port, | -
- | - | void * | -frame, | -
- | - | uint8 | -com, | -
- | - | uint8 | -idx, | -
- | - | boolean | -more, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data | -
- | ) | -- |
Add EtherCAT datagram to a standard ethernet frame with existing datagram(s).
-[in] | port | = port context struct |
[out] | frame | = framebuffer |
[in] | com | = command |
[in] | idx | = index used for TX and RX buffers |
[in] | more | = TRUE if still more datagrams to follow |
[in] | ADP | = Address Position |
[in] | ADO | = Address Offset |
[in] | length | = length of datagram excluding EtherCAT header |
[in] | data | = databuffer to be copied in datagram |
int ecx_APRD | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
APRD "auto increment address read" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, each slave ++, slave that has 0 excecutes |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[out] | data | = databuffer to put slave data in |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
uint16 ecx_APRDw | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | int | -timeout | -
- | ) | -- |
APRDw "auto increment address read" word return primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, each slave ++, slave that has 0 reads. |
[in] | ADO | = Address Offset, slave memory address |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_APWR | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
APWR "auto increment address write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, each slave ++, slave that has 0 writes. |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[in] | data | = databuffer to write to slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_APWRw | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -data, | -
- | - | int | -timeout | -
- | ) | -- |
APWRw "auto increment address write" word primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, each slave ++, slave that has 0 writes. |
[in] | ADO | = Address Offset, slave memory address |
[in] | data | = word data to write to slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_ARMW | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
APRMW "auto increment address read, multiple write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, each slave ++, slave that has 0 reads, following slaves write. |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[out] | data | = databuffer to put slave data in |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_BRD | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
BRD "broadcast read" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, normally 0 |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[out] | data | = databuffer to put slave data in |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_BWR | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
BRW "broadcast write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, normally 0 |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[in] | data | = databuffer to be written to slaves |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_FPRD | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
FPRD "configured address read" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, slave that has address reads. |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[out] | data | = databuffer to put slave data in |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
uint16 ecx_FPRDw | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | int | -timeout | -
- | ) | -- |
FPRDw "configured address read" word return primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, slave that has address reads. |
[in] | ADO | = Address Offset, slave memory address |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_FPWR | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
FPWR "configured address write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, slave that has address writes. |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[in] | data | = databuffer to write to slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_FPWRw | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -data, | -
- | - | int | -timeout | -
- | ) | -- |
FPWR "configured address write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, slave that has address writes. |
[in] | ADO | = Address Offset, slave memory address |
[in] | data | = word to write to slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_FRMW | -( | -ecx_portt * | -port, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
FPRMW "configured address read, multiple write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | ADP | = Address Position, slave that has address reads, following slaves write. |
[in] | ADO | = Address Offset, slave memory address |
[in] | length | = length of databuffer |
[out] | data | = databuffer to put slave data in |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_LRD | -( | -ecx_portt * | -port, | -
- | - | uint32 | -LogAdr, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
LRD "logical memory read" primitive. Blocking.
-[in] | port | = port context struct |
[in] | LogAdr | = Logical memory address |
[in] | length | = length of bytes to read from slave. |
[out] | data | = databuffer to read from slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_LRW | -( | -ecx_portt * | -port, | -
- | - | uint32 | -LogAdr, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
LRW "logical memory read / write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | LogAdr | = Logical memory address |
[in] | length | = length of databuffer |
[in,out] | data | = databuffer to write to and read from slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_LRWDC | -( | -ecx_portt * | -port, | -
- | - | uint32 | -LogAdr, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | uint16 | -DCrs, | -
- | - | int64 * | -DCtime, | -
- | - | int | -timeout | -
- | ) | -- |
LRW "logical memory read / write" primitive plus Clock Distribution. Blocking. Frame consists of two datagrams, one LRW and one FPRMW.
-[in] | port | = port context struct |
[in] | LogAdr | = Logical memory address |
[in] | length | = length of databuffer |
[in,out] | data | = databuffer to write to and read from slave. |
[in] | DCrs | = Distributed Clock reference slave address. |
[out] | DCtime | = DC time read from reference slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_LWR | -( | -ecx_portt * | -port, | -
- | - | uint32 | -LogAdr, | -
- | - | uint16 | -length, | -
- | - | void * | -data, | -
- | - | int | -timeout | -
- | ) | -- |
LWR "logical memory write" primitive. Blocking.
-[in] | port | = port context struct |
[in] | LogAdr | = Logical memory address |
[in] | length | = length of databuffer |
[in] | data | = databuffer to write to slave. |
[in] | timeout | = timeout in us, standard is EC_TIMEOUTRET |
int ecx_setupdatagram | -( | -ecx_portt * | -port, | -
- | - | void * | -frame, | -
- | - | uint8 | -com, | -
- | - | uint8 | -idx, | -
- | - | uint16 | -ADP, | -
- | - | uint16 | -ADO, | -
- | - | uint16 | -length, | -
- | - | void * | -data | -
- | ) | -- |
Generate and set EtherCAT datagram in a standard ethernet frame.
-[in] | port | = port context struct |
[out] | frame | = framebuffer |
[in] | com | = command |
[in] | idx | = index used for TX and RX buffers |
[in] | ADP | = Address Position |
[in] | ADO | = Address Offset |
[in] | length | = length of datagram excluding EtherCAT header |
[in] | data | = databuffer to be copied in datagram |
- SOEM v1.3.1
- |
-
CAN over EtherCAT (CoE) module. -More...
-#include <stdio.h>
#include <string.h>
#include "osal.h"
#include "oshw.h"
#include "ethercattype.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatcoe.h"
-Data Structures | |
struct | ec_SDOt |
struct | ec_SDOservicet |
-Functions | |
PACKED_END void | ecx_SDOerror (ecx_contextt *context, uint16 Slave, uint16 Index, uint8 SubIdx, int32 AbortCode) |
static void | ecx_SDOinfoerror (ecx_contextt *context, uint16 Slave, uint16 Index, uint8 SubIdx, int32 AbortCode) |
int | ecx_SDOread (ecx_contextt *context, uint16 slave, uint16 index, uint8 subindex, boolean CA, int *psize, void *p, int timeout) |
int | ecx_SDOwrite (ecx_contextt *context, uint16 Slave, uint16 Index, uint8 SubIndex, boolean CA, int psize, void *p, int Timeout) |
int | ecx_RxPDO (ecx_contextt *context, uint16 Slave, uint16 RxPDOnumber, int psize, void *p) |
int | ecx_TxPDO (ecx_contextt *context, uint16 slave, uint16 TxPDOnumber, int *psize, void *p, int timeout) |
int | ecx_readPDOassign (ecx_contextt *context, uint16 Slave, uint16 PDOassign) |
int | ecx_readPDOassignCA (ecx_contextt *context, uint16 Slave, uint16 PDOassign) |
int | ecx_readPDOmap (ecx_contextt *context, uint16 Slave, int *Osize, int *Isize) |
int | ecx_readPDOmapCA (ecx_contextt *context, uint16 Slave, int *Osize, int *Isize) |
int | ecx_readODlist (ecx_contextt *context, uint16 Slave, ec_ODlistt *pODlist) |
int | ecx_readODdescription (ecx_contextt *context, uint16 Item, ec_ODlistt *pODlist) |
int | ecx_readOEsingle (ecx_contextt *context, uint16 Item, uint8 SubI, ec_ODlistt *pODlist, ec_OElistt *pOElist) |
int | ecx_readOE (ecx_contextt *context, uint16 Item, ec_ODlistt *pODlist, ec_OElistt *pOElist) |
void | ec_SDOerror (uint16 Slave, uint16 Index, uint8 SubIdx, int32 AbortCode) |
int | ec_SDOread (uint16 slave, uint16 index, uint8 subindex, boolean CA, int *psize, void *p, int timeout) |
int | ec_SDOwrite (uint16 Slave, uint16 Index, uint8 SubIndex, boolean CA, int psize, void *p, int Timeout) |
int | ec_RxPDO (uint16 Slave, uint16 RxPDOnumber, int psize, void *p) |
int | ec_TxPDO (uint16 slave, uint16 TxPDOnumber, int *psize, void *p, int timeout) |
int | ec_readPDOassign (uint16 Slave, uint16 PDOassign) |
int | ec_readPDOassignCA (uint16 Slave, uint16 PDOassign) |
int | ec_readPDOmap (uint16 Slave, int *Osize, int *Isize) |
int | ec_readPDOmapCA (uint16 Slave, int *Osize, int *Isize) |
int | ec_readODlist (uint16 Slave, ec_ODlistt *pODlist) |
int | ec_readODdescription (uint16 Item, ec_ODlistt *pODlist) |
int | ec_readOEsingle (uint16 Item, uint8 SubI, ec_ODlistt *pODlist, ec_OElistt *pOElist) |
int | ec_readOE (uint16 Item, ec_ODlistt *pODlist, ec_OElistt *pOElist) |
CAN over EtherCAT (CoE) module.
-SDO read / write and SDO service functions
-int ec_readODdescription | -( | -uint16 | -Item, | -
- | - | ec_ODlistt * | -pODlist | -
- | ) | -- |
int ec_readODlist | -( | -uint16 | -Slave, | -
- | - | ec_ODlistt * | -pODlist | -
- | ) | -- |
int ec_readOE | -( | -uint16 | -Item, | -
- | - | ec_ODlistt * | -pODlist, | -
- | - | ec_OElistt * | -pOElist | -
- | ) | -- |
int ec_readOEsingle | -( | -uint16 | -Item, | -
- | - | uint8 | -SubI, | -
- | - | ec_ODlistt * | -pODlist, | -
- | - | ec_OElistt * | -pOElist | -
- | ) | -- |
int ec_readPDOassign | -( | -uint16 | -Slave, | -
- | - | uint16 | -PDOassign | -
- | ) | -- |
Read PDO assign structure
- -int ec_readPDOassignCA | -( | -uint16 | -Slave, | -
- | - | uint16 | -PDOassign | -
- | ) | -- |
Read PDO assign structure in Complete Access mode
- -int ec_readPDOmap | -( | -uint16 | -Slave, | -
- | - | int * | -Osize, | -
- | - | int * | -Isize | -
- | ) | -- |
int ec_readPDOmapCA | -( | -uint16 | -Slave, | -
- | - | int * | -Osize, | -
- | - | int * | -Isize | -
- | ) | -- |
int ec_RxPDO | -( | -uint16 | -Slave, | -
- | - | uint16 | -RxPDOnumber, | -
- | - | int | -psize, | -
- | - | void * | -p | -
- | ) | -- |
void ec_SDOerror | -( | -uint16 | -Slave, | -
- | - | uint16 | -Index, | -
- | - | uint8 | -SubIdx, | -
- | - | int32 | -AbortCode | -
- | ) | -- |
int ec_SDOread | -( | -uint16 | -slave, | -
- | - | uint16 | -index, | -
- | - | uint8 | -subindex, | -
- | - | boolean | -CA, | -
- | - | int * | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_SDOwrite | -( | -uint16 | -Slave, | -
- | - | uint16 | -Index, | -
- | - | uint8 | -SubIndex, | -
- | - | boolean | -CA, | -
- | - | int | -psize, | -
- | - | void * | -p, | -
- | - | int | -Timeout | -
- | ) | -- |
int ec_TxPDO | -( | -uint16 | -slave, | -
- | - | uint16 | -TxPDOnumber, | -
- | - | int * | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
int ecx_readODdescription | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Item, | -
- | - | ec_ODlistt * | -pODlist | -
- | ) | -- |
CoE read Object Description. Adds textual description to object indexes.
-[in] | context | = context struct |
[in] | Item | = Item number in ODlist. |
[in,out] | pODlist | = referencing Object Description list. |
int ecx_readODlist | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | ec_ODlistt * | -pODlist | -
- | ) | -- |
CoE read Object Description List.
-[in] | context | = context struct |
[in] | Slave | = Slave number. |
[out] | pODlist | = resulting Object Description list. |
int ecx_readOE | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Item, | -
- | - | ec_ODlistt * | -pODlist, | -
- | - | ec_OElistt * | -pOElist | -
- | ) | -- |
CoE read SDO service object entry.
-[in] | context | = context struct |
[in] | Item | = Item in ODlist. |
[in] | pODlist | = Object description list for reference. |
[out] | pOElist | = resulting object entry structure. |
int ecx_readOEsingle | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Item, | -
- | - | uint8 | -SubI, | -
- | - | ec_ODlistt * | -pODlist, | -
- | - | ec_OElistt * | -pOElist | -
- | ) | -- |
CoE read SDO service object entry, single subindex. Used in ec_readOE().
-[in] | context | = context struct |
[in] | Item | = Item in ODlist. |
[in] | SubI | = Subindex of item in ODlist. |
[in] | pODlist | = Object description list for reference. |
[out] | pOElist | = resulting object entry structure. |
int ecx_readPDOassign | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | uint16 | -PDOassign | -
- | ) | -- |
Read PDO assign structure
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[in] | PDOassign | = PDO assign object |
int ecx_readPDOassignCA | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | uint16 | -PDOassign | -
- | ) | -- |
Read PDO assign structure in Complete Access mode
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[in] | PDOassign | = PDO assign object |
int ecx_readPDOmap | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | int * | -Osize, | -
- | - | int * | -Isize | -
- | ) | -- |
CoE read PDO mapping.
-CANopen has standard indexes defined for PDO mapping. This function tries to read them and collect a full input and output mapping size of designated slave.
-Principal structure in slave:
- 1C00:00 is number of SM defined
- 1C00:01 SM0 type -> 1C10
- 1C00:02 SM1 type -> 1C11
- 1C00:03 SM2 type -> 1C12
- 1C00:04 SM3 type -> 1C13
- Type 0 = unused, 1 = mailbox in, 2 = mailbox out, 3 = outputs (RxPDO), 4 = inputs (TxPDO).
1C12:00 is number of PDO's defined for SM2
- 1C12:01 PDO assign SDO #1 -> f.e. 1A00
- 1C12:02 PDO assign SDO #2 -> f.e. 1A04\
1A00:00 is number of object defined for this PDO
- 1A00:01 object mapping #1, f.e. 60100710 (SDO 6010 SI 07 bitlength 0x10)
[in] | context | = context struct |
[in] | Slave | = Slave number |
[out] | Osize | = Size in bits of output mapping (rxPDO) found |
[out] | Isize | = Size in bits of input mapping (txPDO) found |
int ecx_readPDOmapCA | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | int * | -Osize, | -
- | - | int * | -Isize | -
- | ) | -- |
CoE read PDO mapping in Complete Access mode (CA).
-CANopen has standard indexes defined for PDO mapping. This function tries to read them and collect a full input and output mapping size of designated slave. Slave has to support CA, otherwise use ec_readPDOmap().
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[out] | Osize | = Size in bits of output mapping (rxPDO) found |
[out] | Isize | = Size in bits of input mapping (txPDO) found |
int ecx_RxPDO | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | uint16 | -RxPDOnumber, | -
- | - | int | -psize, | -
- | - | void * | -p | -
- | ) | -- |
CoE RxPDO write, blocking.
-A RxPDO download request is issued.
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[in] | RxPDOnumber | = Related RxPDO number |
[in] | psize | = Size in bytes of PDO buffer. |
[out] | p | = Pointer to PDO buffer |
PACKED_END void ecx_SDOerror | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | uint16 | -Index, | -
- | - | uint8 | -SubIdx, | -
- | - | int32 | -AbortCode | -
- | ) | -- |
Report SDO error.
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[in] | Index | = Index that generated error |
[in] | SubIdx | = Subindex that generated error |
[in] | AbortCode | = Abortcode, see EtherCAT documentation for list |
static void ecx_SDOinfoerror | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | uint16 | -Index, | -
- | - | uint8 | -SubIdx, | -
- | - | int32 | -AbortCode | -
- | ) | - [static] |
-
Report SDO info error
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[in] | Index | = Index that generated error |
[in] | SubIdx | = Subindex that generated error |
[in] | AbortCode | = Abortcode, see EtherCAT documentation for list |
int ecx_SDOread | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -index, | -
- | - | uint8 | -subindex, | -
- | - | boolean | -CA, | -
- | - | int * | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
CoE SDO read, blocking. Single subindex or Complete Access.
-Only a "normal" upload request is issued. If the requested parameter is <= 4bytes then a "expedited" response is returned, otherwise a "normal" response. If a "normal" response is larger than the mailbox size then the response is segmented. The function will combine all segments and copy them to the parameter buffer.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | index | = Index to read |
[in] | subindex | = Subindex to read, must be 0 or 1 if CA is used. |
[in] | CA | = FALSE = single subindex. TRUE = Complete Access, all subindexes read. |
[in,out] | psize | = Size in bytes of parameter buffer, returns bytes read from SDO. |
[out] | p | = Pointer to parameter buffer |
[in] | timeout | = Timeout in us, standard is EC_TIMEOUTRXM |
int ecx_SDOwrite | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | uint16 | -Index, | -
- | - | uint8 | -SubIndex, | -
- | - | boolean | -CA, | -
- | - | int | -psize, | -
- | - | void * | -p, | -
- | - | int | -Timeout | -
- | ) | -- |
CoE SDO write, blocking. Single subindex or Complete Access.
-A "normal" download request is issued, unless we have small data, then a "expedited" transfer is used. If the parameter is larger than the mailbox size then the download is segmented. The function will split the parameter data in segments and send them to the slave one by one.
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[in] | Index | = Index to write |
[in] | SubIndex | = Subindex to write, must be 0 or 1 if CA is used. |
[in] | CA | = FALSE = single subindex. TRUE = Complete Access, all subindexes written. |
[in] | psize | = Size in bytes of parameter buffer. |
[out] | p | = Pointer to parameter buffer |
[in] | Timeout | = Timeout in us, standard is EC_TIMEOUTRXM |
int ecx_TxPDO | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -TxPDOnumber, | -
- | - | int * | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
CoE TxPDO read remote request, blocking.
-A RxPDO download request is issued.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | TxPDOnumber | = Related TxPDO number |
[in,out] | psize | = Size in bytes of PDO buffer, returns bytes read from PDO. |
[out] | p | = Pointer to PDO buffer |
[in] | timeout | = Timeout in us, standard is EC_TIMEOUTRXM |
- SOEM v1.3.1
- |
-
Headerfile for ethercatcoe.c. -More...
--Data Structures | |
struct | ec_ODlistt |
struct | ec_OElistt |
-Defines | |
#define | EC_MAXODLIST 1024 |
#define | EC_MAXOELIST 256 |
-Functions | |
void | ecx_SDOerror (ecx_contextt *context, uint16 Slave, uint16 Index, uint8 SubIdx, int32 AbortCode) |
int | ecx_SDOread (ecx_contextt *context, uint16 slave, uint16 index, uint8 subindex, boolean CA, int *psize, void *p, int timeout) |
int | ecx_SDOwrite (ecx_contextt *context, uint16 Slave, uint16 Index, uint8 SubIndex, boolean CA, int psize, void *p, int Timeout) |
int | ecx_RxPDO (ecx_contextt *context, uint16 Slave, uint16 RxPDOnumber, int psize, void *p) |
int | ecx_TxPDO (ecx_contextt *context, uint16 slave, uint16 TxPDOnumber, int *psize, void *p, int timeout) |
int | ecx_readPDOmap (ecx_contextt *context, uint16 Slave, int *Osize, int *Isize) |
int | ecx_readPDOmapCA (ecx_contextt *context, uint16 Slave, int *Osize, int *Isize) |
int | ecx_readODlist (ecx_contextt *context, uint16 Slave, ec_ODlistt *pODlist) |
int | ecx_readODdescription (ecx_contextt *context, uint16 Item, ec_ODlistt *pODlist) |
int | ecx_readOEsingle (ecx_contextt *context, uint16 Item, uint8 SubI, ec_ODlistt *pODlist, ec_OElistt *pOElist) |
int | ecx_readOE (ecx_contextt *context, uint16 Item, ec_ODlistt *pODlist, ec_OElistt *pOElist) |
Headerfile for ethercatcoe.c.
-#define EC_MAXODLIST 1024 | -
max entries in Object Description list
- -#define EC_MAXOELIST 256 | -
max entries in Object Entry list
- -int ecx_readODdescription | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Item, | -
- | - | ec_ODlistt * | -pODlist | -
- | ) | -- |
CoE read Object Description. Adds textual description to object indexes.
-[in] | context | = context struct |
[in] | Item | = Item number in ODlist. |
[in,out] | pODlist | = referencing Object Description list. |
int ecx_readODlist | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | ec_ODlistt * | -pODlist | -
- | ) | -- |
CoE read Object Description List.
-[in] | context | = context struct |
[in] | Slave | = Slave number. |
[out] | pODlist | = resulting Object Description list. |
int ecx_readOE | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Item, | -
- | - | ec_ODlistt * | -pODlist, | -
- | - | ec_OElistt * | -pOElist | -
- | ) | -- |
CoE read SDO service object entry.
-[in] | context | = context struct |
[in] | Item | = Item in ODlist. |
[in] | pODlist | = Object description list for reference. |
[out] | pOElist | = resulting object entry structure. |
int ecx_readOEsingle | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Item, | -
- | - | uint8 | -SubI, | -
- | - | ec_ODlistt * | -pODlist, | -
- | - | ec_OElistt * | -pOElist | -
- | ) | -- |
CoE read SDO service object entry, single subindex. Used in ec_readOE().
-[in] | context | = context struct |
[in] | Item | = Item in ODlist. |
[in] | SubI | = Subindex of item in ODlist. |
[in] | pODlist | = Object description list for reference. |
[out] | pOElist | = resulting object entry structure. |
int ecx_readPDOmap | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | int * | -Osize, | -
- | - | int * | -Isize | -
- | ) | -- |
CoE read PDO mapping.
-CANopen has standard indexes defined for PDO mapping. This function tries to read them and collect a full input and output mapping size of designated slave.
-Principal structure in slave:
- 1C00:00 is number of SM defined
- 1C00:01 SM0 type -> 1C10
- 1C00:02 SM1 type -> 1C11
- 1C00:03 SM2 type -> 1C12
- 1C00:04 SM3 type -> 1C13
- Type 0 = unused, 1 = mailbox in, 2 = mailbox out, 3 = outputs (RxPDO), 4 = inputs (TxPDO).
1C12:00 is number of PDO's defined for SM2
- 1C12:01 PDO assign SDO #1 -> f.e. 1A00
- 1C12:02 PDO assign SDO #2 -> f.e. 1A04\
1A00:00 is number of object defined for this PDO
- 1A00:01 object mapping #1, f.e. 60100710 (SDO 6010 SI 07 bitlength 0x10)
[in] | context | = context struct |
[in] | Slave | = Slave number |
[out] | Osize | = Size in bits of output mapping (rxPDO) found |
[out] | Isize | = Size in bits of input mapping (txPDO) found |
int ecx_readPDOmapCA | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | int * | -Osize, | -
- | - | int * | -Isize | -
- | ) | -- |
CoE read PDO mapping in Complete Access mode (CA).
-CANopen has standard indexes defined for PDO mapping. This function tries to read them and collect a full input and output mapping size of designated slave. Slave has to support CA, otherwise use ec_readPDOmap().
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[out] | Osize | = Size in bits of output mapping (rxPDO) found |
[out] | Isize | = Size in bits of input mapping (txPDO) found |
int ecx_RxPDO | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | uint16 | -RxPDOnumber, | -
- | - | int | -psize, | -
- | - | void * | -p | -
- | ) | -- |
CoE RxPDO write, blocking.
-A RxPDO download request is issued.
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[in] | RxPDOnumber | = Related RxPDO number |
[in] | psize | = Size in bytes of PDO buffer. |
[out] | p | = Pointer to PDO buffer |
void ecx_SDOerror | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | uint16 | -Index, | -
- | - | uint8 | -SubIdx, | -
- | - | int32 | -AbortCode | -
- | ) | -- |
Report SDO error.
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[in] | Index | = Index that generated error |
[in] | SubIdx | = Subindex that generated error |
[in] | AbortCode | = Abortcode, see EtherCAT documentation for list |
int ecx_SDOread | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -index, | -
- | - | uint8 | -subindex, | -
- | - | boolean | -CA, | -
- | - | int * | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
CoE SDO read, blocking. Single subindex or Complete Access.
-Only a "normal" upload request is issued. If the requested parameter is <= 4bytes then a "expedited" response is returned, otherwise a "normal" response. If a "normal" response is larger than the mailbox size then the response is segmented. The function will combine all segments and copy them to the parameter buffer.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | index | = Index to read |
[in] | subindex | = Subindex to read, must be 0 or 1 if CA is used. |
[in] | CA | = FALSE = single subindex. TRUE = Complete Access, all subindexes read. |
[in,out] | psize | = Size in bytes of parameter buffer, returns bytes read from SDO. |
[out] | p | = Pointer to parameter buffer |
[in] | timeout | = Timeout in us, standard is EC_TIMEOUTRXM |
int ecx_SDOwrite | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | uint16 | -Index, | -
- | - | uint8 | -SubIndex, | -
- | - | boolean | -CA, | -
- | - | int | -psize, | -
- | - | void * | -p, | -
- | - | int | -Timeout | -
- | ) | -- |
CoE SDO write, blocking. Single subindex or Complete Access.
-A "normal" download request is issued, unless we have small data, then a "expedited" transfer is used. If the parameter is larger than the mailbox size then the download is segmented. The function will split the parameter data in segments and send them to the slave one by one.
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[in] | Index | = Index to write |
[in] | SubIndex | = Subindex to write, must be 0 or 1 if CA is used. |
[in] | CA | = FALSE = single subindex. TRUE = Complete Access, all subindexes written. |
[in] | psize | = Size in bytes of parameter buffer. |
[out] | p | = Pointer to parameter buffer |
[in] | Timeout | = Timeout in us, standard is EC_TIMEOUTRXM |
int ecx_TxPDO | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -TxPDOnumber, | -
- | - | int * | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
CoE TxPDO read remote request, blocking.
-A RxPDO download request is issued.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | TxPDOnumber | = Related TxPDO number |
[in,out] | psize | = Size in bytes of PDO buffer, returns bytes read from PDO. |
[out] | p | = Pointer to PDO buffer |
[in] | timeout | = Timeout in us, standard is EC_TIMEOUTRXM |
- SOEM v1.3.1
- |
-
Configuration module for EtherCAT master. -More...
-#include <stdio.h>
#include <string.h>
#include "osal.h"
#include "oshw.h"
#include "ethercattype.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatcoe.h"
#include "ethercatsoe.h"
#include "ethercatconfig.h"
#include "ethercatconfiglist.h"
-Data Structures | |
struct | ecx_mapt_t |
struct | ec_configlist_t |
-Defines | |
#define | EC_PRINT(...) do {} while (0) |
#define | MAX_MAPT 8 |
#define | EC_DEFAULTMBXSM0 0x00010026 |
#define | EC_DEFAULTMBXSM1 0x00010022 |
#define | EC_DEFAULTDOSM0 0x00010044 |
-Functions | |
int | ec_findconfig (uint32 man, uint32 id) |
void | ecx_init_context (ecx_contextt *context) |
int | ecx_detect_slaves (ecx_contextt *context) |
static void | ecx_set_slaves_to_default (ecx_contextt *context) |
static int | ecx_config_from_table (ecx_contextt *context, uint16 slave) |
static int | ecx_lookup_prev_sii (ecx_contextt *context, uint16 slave) |
int | ecx_config_init (ecx_contextt *context, uint8 usetable) |
static int | ecx_lookup_mapping (ecx_contextt *context, uint16 slave, int *Osize, int *Isize) |
static int | ecx_map_coe_soe (ecx_contextt *context, uint16 slave) |
static int | ecx_map_sii (ecx_contextt *context, uint16 slave) |
static int | ecx_map_sm (ecx_contextt *context, uint16 slave) |
OSAL_THREAD_FUNC | ecx_mapper_thread (void *param) |
static int | ecx_find_mapt (void) |
static int | ecx_get_threadcount (void) |
int | ecx_config_map_group (ecx_contextt *context, void *pIOmap, uint8 group) |
int | ecx_recover_slave (ecx_contextt *context, uint16 slave, int timeout) |
int | ecx_reconfig_slave (ecx_contextt *context, uint16 slave, int timeout) |
int | ec_config_init (uint8 usetable) |
int | ec_config_map_group (void *pIOmap, uint8 group) |
int | ec_config_map (void *pIOmap) |
int | ec_config (uint8 usetable, void *pIOmap) |
int | ec_recover_slave (uint16 slave, int timeout) |
int | ec_reconfig_slave (uint16 slave, int timeout) |
-Variables | |
ecx_mapt_t | ecx_mapt [MAX_MAPT] |
OSAL_THREAD_HANDLE | ecx_threadh [MAX_MAPT] |
Configuration module for EtherCAT master.
-After successful initialisation with ec_init() or ec_init_redundant() the slaves can be auto configured with this module.
-#define EC_DEFAULTDOSM0 0x00010044 | -
standard SM0 flags configuration for digital output slaves
- -#define EC_DEFAULTMBXSM0 0x00010026 | -
standard SM0 flags configuration for mailbox slaves
- -#define EC_DEFAULTMBXSM1 0x00010022 | -
standard SM1 flags configuration for mailbox slaves
- -#define EC_PRINT | -( | -- | ... | ) | -do {} while (0) | -
#define MAX_MAPT 8 | -
int ec_config | -( | -uint8 | -usetable, | -
- | - | void * | -pIOmap | -
- | ) | -- |
Enumerate / map and init all slaves.
-[in] | usetable | = TRUE when using configtable to init slaves, FALSE otherwise |
[out] | pIOmap | = pointer to IOmap |
int ec_config_init | -( | -uint8 | -usetable | ) | -- |
int ec_config_map | -( | -void * | -pIOmap | ) | -- |
Map all PDOs from slaves to IOmap.
-[out] | pIOmap | = pointer to IOmap |
int ec_config_map_group | -( | -void * | -pIOmap, | -
- | - | uint8 | -group | -
- | ) | -- |
int ec_findconfig | -( | -uint32 | -man, | -
- | - | uint32 | -id | -
- | ) | -- |
Find slave in standard configuration list ec_configlist[]
-[in] | man | = manufacturer |
[in] | id | = ID |
int ec_reconfig_slave | -( | -uint16 | -slave, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_recover_slave | -( | -uint16 | -slave, | -
- | - | int | -timeout | -
- | ) | -- |
static int ecx_config_from_table | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave | -
- | ) | - [static] |
-
int ecx_config_init | -( | -ecx_contextt * | -context, | -
- | - | uint8 | -usetable | -
- | ) | -- |
Enumerate and init all slaves.
-[in] | context | = context struct |
[in] | usetable | = TRUE when using configtable to init slaves, FALSE otherwise |
int ecx_config_map_group | -( | -ecx_contextt * | -context, | -
- | - | void * | -pIOmap, | -
- | - | uint8 | -group | -
- | ) | -- |
Map all PDOs in one group of slaves to IOmap.
-[in] | context | = context struct |
[out] | pIOmap | = pointer to IOmap |
[in] | group | = group to map, 0 = all groups |
int ecx_detect_slaves | -( | -ecx_contextt * | -context | ) | -- |
static int ecx_find_mapt | -( | -void | -) | - [static] |
-
static int ecx_get_threadcount | -( | -void | -) | - [static] |
-
void ecx_init_context | -( | -ecx_contextt * | -context | ) | -- |
static int ecx_lookup_mapping | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | int * | -Osize, | -
- | - | int * | -Isize | -
- | ) | - [static] |
-
static int ecx_lookup_prev_sii | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave | -
- | ) | - [static] |
-
static int ecx_map_coe_soe | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave | -
- | ) | - [static] |
-
static int ecx_map_sii | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave | -
- | ) | - [static] |
-
static int ecx_map_sm | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave | -
- | ) | - [static] |
-
OSAL_THREAD_FUNC ecx_mapper_thread | -( | -void * | -param | ) | -- |
int ecx_reconfig_slave | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | int | -timeout | -
- | ) | -- |
Reconfigure slave.
-[in] | context | = context struct |
[in] | slave | = slave to reconfigure |
[in] | timeout | = local timeout f.e. EC_TIMEOUTRET3 |
int ecx_recover_slave | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | int | -timeout | -
- | ) | -- |
Recover slave.
-[in] | context | = context struct |
[in] | slave | = slave to recover |
[in] | timeout | = local timeout f.e. EC_TIMEOUTRET3 |
static void ecx_set_slaves_to_default | -( | -ecx_contextt * | -context | ) | - [static] |
-
ecx_mapt_t ecx_mapt[MAX_MAPT] | -
OSAL_THREAD_HANDLE ecx_threadh[MAX_MAPT] | -
- SOEM v1.3.1
- |
-
Headerfile for ethercatconfig.c. -More...
--Defines | |
#define | EC_NODEOFFSET 0x1000 |
#define | EC_TEMPNODE 0xffff |
-Functions | |
int | ecx_config_init (ecx_contextt *context, uint8 usetable) |
int | ecx_config_map_group (ecx_contextt *context, void *pIOmap, uint8 group) |
int | ecx_recover_slave (ecx_contextt *context, uint16 slave, int timeout) |
int | ecx_reconfig_slave (ecx_contextt *context, uint16 slave, int timeout) |
Headerfile for ethercatconfig.c.
-#define EC_NODEOFFSET 0x1000 | -
#define EC_TEMPNODE 0xffff | -
int ecx_config_init | -( | -ecx_contextt * | -context, | -
- | - | uint8 | -usetable | -
- | ) | -- |
Enumerate and init all slaves.
-[in] | context | = context struct |
[in] | usetable | = TRUE when using configtable to init slaves, FALSE otherwise |
int ecx_config_map_group | -( | -ecx_contextt * | -context, | -
- | - | void * | -pIOmap, | -
- | - | uint8 | -group | -
- | ) | -- |
Map all PDOs in one group of slaves to IOmap.
-[in] | context | = context struct |
[out] | pIOmap | = pointer to IOmap |
[in] | group | = group to map, 0 = all groups |
int ecx_reconfig_slave | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | int | -timeout | -
- | ) | -- |
Reconfigure slave.
-[in] | context | = context struct |
[in] | slave | = slave to reconfigure |
[in] | timeout | = local timeout f.e. EC_TIMEOUTRET3 |
int ecx_recover_slave | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | int | -timeout | -
- | ) | -- |
Recover slave.
-[in] | context | = context struct |
[in] | slave | = slave to recover |
[in] | timeout | = local timeout f.e. EC_TIMEOUTRET3 |
- SOEM v1.3.1
- |
-
DEPRICATED Configuration list of known EtherCAT slave devices. -More...
--Defines | |
#define | EC_CONFIGEND 0xffffffff |
-Variables | |
ec_configlist_t | ec_configlist [] |
DEPRICATED Configuration list of known EtherCAT slave devices.
-If a slave is found in this list it is configured according to the parameters in the list. Otherwise the configuration info is read directly from the slave EEPROM (SII or Slave Information Interface).
-#define EC_CONFIGEND 0xffffffff | -
ec_configlist_t ec_configlist[] | -
{ - {0x00000000,0x00000000,"" ,0, 0, 0, 0, 0, 0, 0,0,0}, - {0x00000002,0x044c2c52,"EK1100" ,1, 0, 0, 0, 0, 0, 0,0,0}, - {0x00000002,0x03ea3052,"EL1002" ,2, 2, 0, 0, 0, 0, 0,0,0}, - {0x00000002,0x03ec3052,"EL1004" ,2, 4, 0, 0, 0, 0, 0,0,0}, - {0x00000002,0x03f43052,"EL1012" ,2, 2, 0, 0, 0, 0, 0,0,0}, - {0x00000002,0x03f63052,"EL1014" ,2, 4, 0, 0, 0, 0, 0,0,0}, - {0x00000002,0x03fa3052,"EL1018" ,2, 8, 0, 0, 0, 0, 0,0,0}, - {0x00000002,0x07d23052,"EL2002" ,3, 0, 2, 0, 0, 0, 0,0,0}, - {0x00000002,0x07d43052,"EL2004" ,3, 0, 4, 0, 0, 0, 0,0,0}, - {0x00000002,0x07d83052,"EL2008" ,3, 0, 8, 0, 0, 0, 0,0,0}, - {0x00000002,0x07f03052,"EL2032" ,6, 2, 2, 0, 0, 0, 0,0,0}, - {0x00000002,0x0c1e3052,"EL3102" ,4,48, 0,0x1000,0x00000024,0x1100,0x00010020,0,1}, - {0x00000002,0x0c283052,"EL3112" ,4,48, 0,0x1000,0x00000024,0x1100,0x00010020,0,1}, - {0x00000002,0x0c323052,"EL3122" ,4,48, 0,0x1000,0x00000024,0x1100,0x00010020,0,1}, - {0x00000002,0x0c463052,"EL3142" ,4,48, 0,0x1000,0x00000024,0x1100,0x00010020,0,1}, - {0x00000002,0x0c503052,"EL3152" ,4,48, 0,0x1000,0x00000024,0x1100,0x00010020,0,1}, - {0x00000002,0x0c5a3052,"EL3162" ,4,48, 0,0x1000,0x00000024,0x1100,0x00010020,0,1}, - {0x00000002,0x0fc03052,"EL4032" ,5, 0,32,0x1100,0x00010024,0x1180,0x00000022,1,0}, - {0x00000002,0x10063052,"EL4102" ,5, 0,32,0x1000,0x00010024,0x1100,0x00000022,1,0}, - {0x00000002,0x10103052,"EL4112" ,5, 0,32,0x1000,0x00010024,0x1100,0x00000022,1,0}, - {0x00000002,0x101a3052,"EL4122" ,5, 0,32,0x1000,0x00010024,0x1100,0x00000022,1,0}, - {0x00000002,0x10243052,"EL4132" ,5, 0,32,0x1000,0x00010024,0x1100,0x00000022,1,0}, - {0x00000002,0x13ed3052,"EL5101" ,7,40,24,0x1000,0x00010024,0x1100,0x00010020,1,1}, - {EC_CONFIGEND,0x00000000,"" ,0, 0, 0, 0, 0, 0, 0,0,0} -} -
- SOEM v1.3.1
- |
-
Distributed Clock EtherCAT functions. -More...
-#include "oshw.h"
#include "osal.h"
#include "ethercattype.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatdc.h"
-Defines | |
#define | PORTM0 0x01 |
#define | PORTM1 0x02 |
#define | PORTM2 0x04 |
#define | PORTM3 0x08 |
#define | SyncDelay ((int32)100000000) |
-Functions | |
void | ecx_dcsync0 (ecx_contextt *context, uint16 slave, boolean act, uint32 CyclTime, uint32 CyclShift) |
void | ecx_dcsync01 (ecx_contextt *context, uint16 slave, boolean act, uint32 CyclTime0, uint32 CyclTime1, uint32 CyclShift) |
static int32 | ecx_porttime (ecx_contextt *context, uint16 slave, uint8 port) |
static uint8 | ecx_prevport (ecx_contextt *context, uint16 slave, uint8 port) |
static uint8 | ecx_parentport (ecx_contextt *context, uint16 parent) |
boolean | ecx_configdc (ecx_contextt *context) |
void | ec_dcsync0 (uint16 slave, boolean act, uint32 CyclTime, uint32 CyclShift) |
void | ec_dcsync01 (uint16 slave, boolean act, uint32 CyclTime0, uint32 CyclTime1, uint32 CyclShift) |
boolean | ec_configdc (void) |
Distributed Clock EtherCAT functions.
-#define PORTM0 0x01 | -
#define PORTM1 0x02 | -
#define PORTM2 0x04 | -
#define PORTM3 0x08 | -
#define SyncDelay ((int32)100000000) | -
1st sync pulse delay in ns here 100ms
- -boolean ec_configdc | -( | -void | -) | -- |
void ec_dcsync0 | -( | -uint16 | -slave, | -
- | - | boolean | -act, | -
- | - | uint32 | -CyclTime, | -
- | - | uint32 | -CyclShift | -
- | ) | -- |
void ec_dcsync01 | -( | -uint16 | -slave, | -
- | - | boolean | -act, | -
- | - | uint32 | -CyclTime0, | -
- | - | uint32 | -CyclTime1, | -
- | - | uint32 | -CyclShift | -
- | ) | -- |
boolean ecx_configdc | -( | -ecx_contextt * | -context | ) | -- |
Locate DC slaves, measure propagation delays.
-[in] | context | = context struct |
void ecx_dcsync0 | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | boolean | -act, | -
- | - | uint32 | -CyclTime, | -
- | - | uint32 | -CyclShift | -
- | ) | -- |
Set DC of slave to fire sync0 at CyclTime interval with CyclShift offset.
-[in] | context | = context struct |
[in] | slave | Slave number. |
[in] | act | TRUE = active, FALSE = deactivated |
[in] | CyclTime | Cycltime in ns. |
[in] | CyclShift | CyclShift in ns. |
void ecx_dcsync01 | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | boolean | -act, | -
- | - | uint32 | -CyclTime0, | -
- | - | uint32 | -CyclTime1, | -
- | - | uint32 | -CyclShift | -
- | ) | -- |
Set DC of slave to fire sync0 and sync1 at CyclTime interval with CyclShift offset.
-[in] | context | = context struct |
[in] | slave | Slave number. |
[in] | act | TRUE = active, FALSE = deactivated |
[in] | CyclTime0 | Cycltime SYNC0 in ns. |
[in] | CyclTime1 | Cycltime SYNC1 in ns. This time is a delta time in relation to the SYNC0 fire. If CylcTime1 = 0 then SYNC1 fires a the same time as SYNC0. |
[in] | CyclShift | CyclShift in ns. |
static uint8 ecx_parentport | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -parent | -
- | ) | - [static] |
-
static int32 ecx_porttime | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint8 | -port | -
- | ) | - [static] |
-
static uint8 ecx_prevport | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint8 | -port | -
- | ) | - [static] |
-
- SOEM v1.3.1
- |
-
Headerfile for ethercatdc.c. -More...
--Functions | |
boolean | ecx_configdc (ecx_contextt *context) |
void | ecx_dcsync0 (ecx_contextt *context, uint16 slave, boolean act, uint32 CyclTime, uint32 CyclShift) |
void | ecx_dcsync01 (ecx_contextt *context, uint16 slave, boolean act, uint32 CyclTime0, uint32 CyclTime1, uint32 CyclShift) |
Headerfile for ethercatdc.c.
-boolean ecx_configdc | -( | -ecx_contextt * | -context | ) | -- |
Locate DC slaves, measure propagation delays.
-[in] | context | = context struct |
void ecx_dcsync0 | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | boolean | -act, | -
- | - | uint32 | -CyclTime, | -
- | - | uint32 | -CyclShift | -
- | ) | -- |
Set DC of slave to fire sync0 at CyclTime interval with CyclShift offset.
-[in] | context | = context struct |
[in] | slave | Slave number. |
[in] | act | TRUE = active, FALSE = deactivated |
[in] | CyclTime | Cycltime in ns. |
[in] | CyclShift | CyclShift in ns. |
void ecx_dcsync01 | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | boolean | -act, | -
- | - | uint32 | -CyclTime0, | -
- | - | uint32 | -CyclTime1, | -
- | - | uint32 | -CyclShift | -
- | ) | -- |
Set DC of slave to fire sync0 and sync1 at CyclTime interval with CyclShift offset.
-[in] | context | = context struct |
[in] | slave | Slave number. |
[in] | act | TRUE = active, FALSE = deactivated |
[in] | CyclTime0 | Cycltime SYNC0 in ns. |
[in] | CyclTime1 | Cycltime SYNC1 in ns. This time is a delta time in relation to the SYNC0 fire. If CylcTime1 = 0 then SYNC1 fires a the same time as SYNC0. |
[in] | CyclShift | CyclShift in ns. |
- SOEM v1.3.1
- |
-
File over EtherCAT (FoE) module. -More...
-#include <stdio.h>
#include <string.h>
#include "osal.h"
#include "oshw.h"
#include "ethercattype.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatfoe.h"
-Data Structures | |
struct | ec_FOEt |
-Defines | |
#define | EC_MAXFOEDATA 512 |
-Functions | |
PACKED_END int | ecx_FOEdefinehook (ecx_contextt *context, void *hook) |
int | ecx_FOEread (ecx_contextt *context, uint16 slave, char *filename, uint32 password, int *psize, void *p, int timeout) |
int | ecx_FOEwrite (ecx_contextt *context, uint16 slave, char *filename, uint32 password, int psize, void *p, int timeout) |
int | ec_FOEdefinehook (void *hook) |
int | ec_FOEread (uint16 slave, char *filename, uint32 password, int *psize, void *p, int timeout) |
int | ec_FOEwrite (uint16 slave, char *filename, uint32 password, int psize, void *p, int timeout) |
File over EtherCAT (FoE) module.
-SDO read / write and SDO service functions
-#define EC_MAXFOEDATA 512 | -
int ec_FOEdefinehook | -( | -void * | -hook | ) | -- |
int ec_FOEread | -( | -uint16 | -slave, | -
- | - | char * | -filename, | -
- | - | uint32 | -password, | -
- | - | int * | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_FOEwrite | -( | -uint16 | -slave, | -
- | - | char * | -filename, | -
- | - | uint32 | -password, | -
- | - | int | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
PACKED_END int ecx_FOEdefinehook | -( | -ecx_contextt * | -context, | -
- | - | void * | -hook | -
- | ) | -- |
FoE progress hook.
-[in] | context | = context struct |
[in] | hook | = Pointer to hook function. |
int ecx_FOEread | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | char * | -filename, | -
- | - | uint32 | -password, | -
- | - | int * | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
FoE read, blocking.
-[in] | context | = context struct |
[in] | slave | = Slave number. |
[in] | filename | = Filename of file to read. |
[in] | password | = password. |
[in,out] | psize | = Size in bytes of file buffer, returns bytes read from file. |
[out] | p | = Pointer to file buffer |
[in] | timeout | = Timeout per mailbox cycle in us, standard is EC_TIMEOUTRXM |
int ecx_FOEwrite | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | char * | -filename, | -
- | - | uint32 | -password, | -
- | - | int | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
FoE write, blocking.
-[in] | context | = context struct |
[in] | slave | = Slave number. |
[in] | filename | = Filename of file to write. |
[in] | password | = password. |
[in] | psize | = Size in bytes of file buffer. |
[out] | p | = Pointer to file buffer |
[in] | timeout | = Timeout per mailbox cycle in us, standard is EC_TIMEOUTRXM |
- SOEM v1.3.1
- |
-
Headerfile for ethercatfoe.c. -More...
--Functions | |
int | ecx_FOEdefinehook (ecx_contextt *context, void *hook) |
int | ecx_FOEread (ecx_contextt *context, uint16 slave, char *filename, uint32 password, int *psize, void *p, int timeout) |
int | ecx_FOEwrite (ecx_contextt *context, uint16 slave, char *filename, uint32 password, int psize, void *p, int timeout) |
Headerfile for ethercatfoe.c.
-int ecx_FOEdefinehook | -( | -ecx_contextt * | -context, | -
- | - | void * | -hook | -
- | ) | -- |
FoE progress hook.
-[in] | context | = context struct |
[in] | hook | = Pointer to hook function. |
int ecx_FOEread | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | char * | -filename, | -
- | - | uint32 | -password, | -
- | - | int * | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
FoE read, blocking.
-[in] | context | = context struct |
[in] | slave | = Slave number. |
[in] | filename | = Filename of file to read. |
[in] | password | = password. |
[in,out] | psize | = Size in bytes of file buffer, returns bytes read from file. |
[out] | p | = Pointer to file buffer |
[in] | timeout | = Timeout per mailbox cycle in us, standard is EC_TIMEOUTRXM |
int ecx_FOEwrite | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | char * | -filename, | -
- | - | uint32 | -password, | -
- | - | int | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
FoE write, blocking.
-[in] | context | = context struct |
[in] | slave | = Slave number. |
[in] | filename | = Filename of file to write. |
[in] | password | = password. |
[in] | psize | = Size in bytes of file buffer. |
[out] | p | = Pointer to file buffer |
[in] | timeout | = Timeout per mailbox cycle in us, standard is EC_TIMEOUTRXM |
- SOEM v1.3.1
- |
-
Main EtherCAT functions. -More...
-#include <stdio.h>
#include <string.h>
#include "osal.h"
#include "oshw.h"
#include "ethercattype.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
-Data Structures | |
struct | ec_eepromt |
struct | ec_mbxerrort |
struct | ec_emcyt |
-Defines | |
#define | EC_LOCALDELAY 200 |
#define | MAX_FPRD_MULTI 64 |
-Functions | |
ec_adaptert * | ec_find_adapters (void) |
void | ec_free_adapters (ec_adaptert *adapter) |
void | ecx_pusherror (ecx_contextt *context, const ec_errort *Ec) |
boolean | ecx_poperror (ecx_contextt *context, ec_errort *Ec) |
boolean | ecx_iserror (ecx_contextt *context) |
void | ecx_packeterror (ecx_contextt *context, uint16 Slave, uint16 Index, uint8 SubIdx, uint16 ErrorCode) |
static void | ecx_mbxerror (ecx_contextt *context, uint16 Slave, uint16 Detail) |
static void | ecx_mbxemergencyerror (ecx_contextt *context, uint16 Slave, uint16 ErrorCode, uint16 ErrorReg, uint8 b1, uint16 w1, uint16 w2) |
int | ecx_init (ecx_contextt *context, char *ifname) |
int | ecx_init_redundant (ecx_contextt *context, ecx_redportt *redport, char *ifname, char *if2name) |
void | ecx_close (ecx_contextt *context) |
uint8 | ecx_siigetbyte (ecx_contextt *context, uint16 slave, uint16 address) |
int16 | ecx_siifind (ecx_contextt *context, uint16 slave, uint16 cat) |
void | ecx_siistring (ecx_contextt *context, char *str, uint16 slave, uint16 Sn) |
uint16 | ecx_siiFMMU (ecx_contextt *context, uint16 slave, ec_eepromFMMUt *FMMU) |
uint16 | ecx_siiSM (ecx_contextt *context, uint16 slave, ec_eepromSMt *SM) |
uint16 | ecx_siiSMnext (ecx_contextt *context, uint16 slave, ec_eepromSMt *SM, uint16 n) |
int | ecx_siiPDO (ecx_contextt *context, uint16 slave, ec_eepromPDOt *PDO, uint8 t) |
int | ecx_FPRD_multi (ecx_contextt *context, int n, uint16 *configlst, ec_alstatust *slstatlst, int timeout) |
int | ecx_readstate (ecx_contextt *context) |
int | ecx_writestate (ecx_contextt *context, uint16 slave) |
uint16 | ecx_statecheck (ecx_contextt *context, uint16 slave, uint16 reqstate, int timeout) |
uint8 | ec_nextmbxcnt (uint8 cnt) |
void | ec_clearmbx (ec_mbxbuft *Mbx) |
int | ecx_mbxempty (ecx_contextt *context, uint16 slave, int timeout) |
int | ecx_mbxsend (ecx_contextt *context, uint16 slave, ec_mbxbuft *mbx, int timeout) |
int | ecx_mbxreceive (ecx_contextt *context, uint16 slave, ec_mbxbuft *mbx, int timeout) |
void | ecx_esidump (ecx_contextt *context, uint16 slave, uint8 *esibuf) |
uint32 | ecx_readeeprom (ecx_contextt *context, uint16 slave, uint16 eeproma, int timeout) |
int | ecx_writeeeprom (ecx_contextt *context, uint16 slave, uint16 eeproma, uint16 data, int timeout) |
int | ecx_eeprom2master (ecx_contextt *context, uint16 slave) |
int | ecx_eeprom2pdi (ecx_contextt *context, uint16 slave) |
uint16 | ecx_eeprom_waitnotbusyAP (ecx_contextt *context, uint16 aiadr, uint16 *estat, int timeout) |
uint64 | ecx_readeepromAP (ecx_contextt *context, uint16 aiadr, uint16 eeproma, int timeout) |
int | ecx_writeeepromAP (ecx_contextt *context, uint16 aiadr, uint16 eeproma, uint16 data, int timeout) |
uint16 | ecx_eeprom_waitnotbusyFP (ecx_contextt *context, uint16 configadr, uint16 *estat, int timeout) |
uint64 | ecx_readeepromFP (ecx_contextt *context, uint16 configadr, uint16 eeproma, int timeout) |
int | ecx_writeeepromFP (ecx_contextt *context, uint16 configadr, uint16 eeproma, uint16 data, int timeout) |
void | ecx_readeeprom1 (ecx_contextt *context, uint16 slave, uint16 eeproma) |
uint32 | ecx_readeeprom2 (ecx_contextt *context, uint16 slave, int timeout) |
static void | ecx_pushindex (ecx_contextt *context, uint8 idx, void *data, uint16 length) |
static int | ecx_pullindex (ecx_contextt *context) |
int | ecx_send_processdata_group (ecx_contextt *context, uint8 group) |
int | ecx_receive_processdata_group (ecx_contextt *context, uint8 group, int timeout) |
int | ecx_send_processdata (ecx_contextt *context) |
int | ecx_receive_processdata (ecx_contextt *context, int timeout) |
void | ec_pusherror (const ec_errort *Ec) |
boolean | ec_poperror (ec_errort *Ec) |
boolean | ec_iserror (void) |
void | ec_packeterror (uint16 Slave, uint16 Index, uint8 SubIdx, uint16 ErrorCode) |
int | ec_init (char *ifname) |
int | ec_init_redundant (char *ifname, char *if2name) |
void | ec_close (void) |
uint8 | ec_siigetbyte (uint16 slave, uint16 address) |
int16 | ec_siifind (uint16 slave, uint16 cat) |
void | ec_siistring (char *str, uint16 slave, uint16 Sn) |
uint16 | ec_siiFMMU (uint16 slave, ec_eepromFMMUt *FMMU) |
uint16 | ec_siiSM (uint16 slave, ec_eepromSMt *SM) |
uint16 | ec_siiSMnext (uint16 slave, ec_eepromSMt *SM, uint16 n) |
int | ec_siiPDO (uint16 slave, ec_eepromPDOt *PDO, uint8 t) |
int | ec_readstate (void) |
int | ec_writestate (uint16 slave) |
uint16 | ec_statecheck (uint16 slave, uint16 reqstate, int timeout) |
int | ec_mbxempty (uint16 slave, int timeout) |
int | ec_mbxsend (uint16 slave, ec_mbxbuft *mbx, int timeout) |
int | ec_mbxreceive (uint16 slave, ec_mbxbuft *mbx, int timeout) |
void | ec_esidump (uint16 slave, uint8 *esibuf) |
uint32 | ec_readeeprom (uint16 slave, uint16 eeproma, int timeout) |
int | ec_writeeeprom (uint16 slave, uint16 eeproma, uint16 data, int timeout) |
int | ec_eeprom2master (uint16 slave) |
int | ec_eeprom2pdi (uint16 slave) |
uint16 | ec_eeprom_waitnotbusyAP (uint16 aiadr, uint16 *estat, int timeout) |
uint64 | ec_readeepromAP (uint16 aiadr, uint16 eeproma, int timeout) |
int | ec_writeeepromAP (uint16 aiadr, uint16 eeproma, uint16 data, int timeout) |
uint16 | ec_eeprom_waitnotbusyFP (uint16 configadr, uint16 *estat, int timeout) |
uint64 | ec_readeepromFP (uint16 configadr, uint16 eeproma, int timeout) |
int | ec_writeeepromFP (uint16 configadr, uint16 eeproma, uint16 data, int timeout) |
void | ec_readeeprom1 (uint16 slave, uint16 eeproma) |
uint32 | ec_readeeprom2 (uint16 slave, int timeout) |
int | ec_send_processdata_group (uint8 group) |
int | ec_receive_processdata_group (uint8 group, int timeout) |
int | ec_send_processdata (void) |
int | ec_receive_processdata (int timeout) |
-Variables | |
PACKED_END ec_slavet | ec_slave [EC_MAXSLAVE] |
int | ec_slavecount |
ec_groupt | ec_group [EC_MAXGROUP] |
static uint8 | ec_esibuf [EC_MAXEEPBUF] |
static uint32 | ec_esimap [EC_MAXEEPBITMAP] |
static ec_eringt | ec_elist |
static ec_idxstackT | ec_idxstack |
static ec_SMcommtypet | ec_SMcommtype |
static ec_PDOassignt | ec_PDOassign |
static ec_PDOdesct | ec_PDOdesc |
static ec_eepromSMt | ec_SM |
static ec_eepromFMMUt | ec_FMMU |
boolean | EcatError = FALSE |
int64 | ec_DCtime |
ecx_portt | ecx_port |
ecx_redportt | ecx_redport |
ecx_contextt | ecx_context |
Main EtherCAT functions.
-Initialisation, state set and read, mailbox primitives, EEPROM primitives, SII reading and processdata exchange.
-Defines ec_slave[]. All slave information is put in this structure. Needed for most user interaction with slaves.
-#define EC_LOCALDELAY 200 | -
delay in us for eeprom ready loop
- -#define MAX_FPRD_MULTI 64 | -
void ec_clearmbx | -( | -ec_mbxbuft * | -Mbx | ) | -- |
Clear mailbox buffer.
-[out] | Mbx | = Mailbox buffer to clear |
void ec_close | -( | -void | -) | -- |
int ec_eeprom2master | -( | -uint16 | -slave | ) | -- |
int ec_eeprom2pdi | -( | -uint16 | -slave | ) | -- |
uint16 ec_eeprom_waitnotbusyAP | -( | -uint16 | -aiadr, | -
- | - | uint16 * | -estat, | -
- | - | int | -timeout | -
- | ) | -- |
uint16 ec_eeprom_waitnotbusyFP | -( | -uint16 | -configadr, | -
- | - | uint16 * | -estat, | -
- | - | int | -timeout | -
- | ) | -- |
void ec_esidump | -( | -uint16 | -slave, | -
- | - | uint8 * | -esibuf | -
- | ) | -- |
ec_adaptert* ec_find_adapters | -( | -void | -) | -- |
Create list over available network adapters.
-void ec_free_adapters | -( | -ec_adaptert * | -adapter | ) | -- |
Free dynamically allocated list over available network adapters.
-[in] | adapter | = Struct holding adapter name, description and pointer to next. |
int ec_init | -( | -char * | -ifname | ) | -- |
int ec_init_redundant | -( | -char * | -ifname, | -
- | - | char * | -if2name | -
- | ) | -- |
boolean ec_iserror | -( | -void | -) | -- |
int ec_mbxempty | -( | -uint16 | -slave, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_mbxreceive | -( | -uint16 | -slave, | -
- | - | ec_mbxbuft * | -mbx, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_mbxsend | -( | -uint16 | -slave, | -
- | - | ec_mbxbuft * | -mbx, | -
- | - | int | -timeout | -
- | ) | -- |
uint8 ec_nextmbxcnt | -( | -uint8 | -cnt | ) | -- |
Get index of next mailbox counter value. Used for Mailbox Link Layer.
-[in] | cnt | = Mailbox counter value [0..7] |
void ec_packeterror | -( | -uint16 | -Slave, | -
- | - | uint16 | -Index, | -
- | - | uint8 | -SubIdx, | -
- | - | uint16 | -ErrorCode | -
- | ) | -- |
boolean ec_poperror | -( | -ec_errort * | -Ec | ) | -- |
void ec_pusherror | -( | -const ec_errort * | -Ec | ) | -- |
uint32 ec_readeeprom | -( | -uint16 | -slave, | -
- | - | uint16 | -eeproma, | -
- | - | int | -timeout | -
- | ) | -- |
void ec_readeeprom1 | -( | -uint16 | -slave, | -
- | - | uint16 | -eeproma | -
- | ) | -- |
uint32 ec_readeeprom2 | -( | -uint16 | -slave, | -
- | - | int | -timeout | -
- | ) | -- |
uint64 ec_readeepromAP | -( | -uint16 | -aiadr, | -
- | - | uint16 | -eeproma, | -
- | - | int | -timeout | -
- | ) | -- |
uint64 ec_readeepromFP | -( | -uint16 | -configadr, | -
- | - | uint16 | -eeproma, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_readstate | -( | -void | -) | -- |
int ec_receive_processdata | -( | -int | -timeout | ) | -- |
int ec_receive_processdata_group | -( | -uint8 | -group, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_send_processdata | -( | -void | -) | -- |
int ec_send_processdata_group | -( | -uint8 | -group | ) | -- |
int16 ec_siifind | -( | -uint16 | -slave, | -
- | - | uint16 | -cat | -
- | ) | -- |
uint16 ec_siiFMMU | -( | -uint16 | -slave, | -
- | - | ec_eepromFMMUt * | -FMMU | -
- | ) | -- |
uint8 ec_siigetbyte | -( | -uint16 | -slave, | -
- | - | uint16 | -address | -
- | ) | -- |
int ec_siiPDO | -( | -uint16 | -slave, | -
- | - | ec_eepromPDOt * | -PDO, | -
- | - | uint8 | -t | -
- | ) | -- |
uint16 ec_siiSM | -( | -uint16 | -slave, | -
- | - | ec_eepromSMt * | -SM | -
- | ) | -- |
uint16 ec_siiSMnext | -( | -uint16 | -slave, | -
- | - | ec_eepromSMt * | -SM, | -
- | - | uint16 | -n | -
- | ) | -- |
void ec_siistring | -( | -char * | -str, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -Sn | -
- | ) | -- |
uint16 ec_statecheck | -( | -uint16 | -slave, | -
- | - | uint16 | -reqstate, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_writeeeprom | -( | -uint16 | -slave, | -
- | - | uint16 | -eeproma, | -
- | - | uint16 | -data, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_writeeepromAP | -( | -uint16 | -aiadr, | -
- | - | uint16 | -eeproma, | -
- | - | uint16 | -data, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_writeeepromFP | -( | -uint16 | -configadr, | -
- | - | uint16 | -eeproma, | -
- | - | uint16 | -data, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_writestate | -( | -uint16 | -slave | ) | -- |
void ecx_close | -( | -ecx_contextt * | -context | ) | -- |
Close lib.
-[in] | context | = context struct |
int ecx_eeprom2master | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave | -
- | ) | -- |
Set eeprom control to master. Only if set to PDI.
-[in] | context | = context struct |
[in] | slave | = Slave number |
int ecx_eeprom2pdi | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave | -
- | ) | -- |
Set eeprom control to PDI. Only if set to master.
-[in] | context | = context struct |
[in] | slave | = Slave number |
uint16 ecx_eeprom_waitnotbusyAP | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -aiadr, | -
- | - | uint16 * | -estat, | -
- | - | int | -timeout | -
- | ) | -- |
uint16 ecx_eeprom_waitnotbusyFP | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -configadr, | -
- | - | uint16 * | -estat, | -
- | - | int | -timeout | -
- | ) | -- |
void ecx_esidump | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint8 * | -esibuf | -
- | ) | -- |
Dump complete EEPROM data from slave in buffer.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[out] | esibuf | = EEPROM data buffer, make sure it is big enough. |
int ecx_FPRD_multi | -( | -ecx_contextt * | -context, | -
- | - | int | -n, | -
- | - | uint16 * | -configlst, | -
- | - | ec_alstatust * | -slstatlst, | -
- | - | int | -timeout | -
- | ) | -- |
int ecx_init | -( | -ecx_contextt * | -context, | -
- | - | char * | -ifname | -
- | ) | -- |
Initialise lib in single NIC mode
-[in] | context | = context struct |
[in] | ifname | = Dev name, f.e. "eth0" |
int ecx_init_redundant | -( | -ecx_contextt * | -context, | -
- | - | ecx_redportt * | -redport, | -
- | - | char * | -ifname, | -
- | - | char * | -if2name | -
- | ) | -- |
Initialise lib in redundant NIC mode
-[in] | context | = context struct |
[in] | redport | = pointer to redport, redundant port data |
[in] | ifname | = Primary Dev name, f.e. "eth0" |
[in] | if2name | = Secondary Dev name, f.e. "eth1" |
boolean ecx_iserror | -( | -ecx_contextt * | -context | ) | -- |
Check if error list has entries.
-[in] | context | = context struct |
static void ecx_mbxemergencyerror | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | uint16 | -ErrorCode, | -
- | - | uint16 | -ErrorReg, | -
- | - | uint8 | -b1, | -
- | - | uint16 | -w1, | -
- | - | uint16 | -w2 | -
- | ) | - [static] |
-
Report Mailbox Emergency Error
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[in] | ErrorCode | = Following EtherCAT specification |
[in] | ErrorReg | |
[in] | b1 | |
[in] | w1 | |
[in] | w2 |
int ecx_mbxempty | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | int | -timeout | -
- | ) | -- |
Check if IN mailbox of slave is empty.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | timeout | = Timeout in us |
static void ecx_mbxerror | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | uint16 | -Detail | -
- | ) | - [static] |
-
Report Mailbox Error
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[in] | Detail | = Following EtherCAT specification |
int ecx_mbxreceive | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | ec_mbxbuft * | -mbx, | -
- | - | int | -timeout | -
- | ) | -- |
Read OUT mailbox from slave. Supports Mailbox Link Layer with repeat requests.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[out] | mbx | = Mailbox data |
[in] | timeout | = Timeout in us |
int ecx_mbxsend | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | ec_mbxbuft * | -mbx, | -
- | - | int | -timeout | -
- | ) | -- |
Write IN mailbox to slave.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[out] | mbx | = Mailbox data |
[in] | timeout | = Timeout in us |
void ecx_packeterror | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | uint16 | -Index, | -
- | - | uint8 | -SubIdx, | -
- | - | uint16 | -ErrorCode | -
- | ) | -- |
Report packet error
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[in] | Index | = Index that generated error |
[in] | SubIdx | = Subindex that generated error |
[in] | ErrorCode | = Error code |
boolean ecx_poperror | -( | -ecx_contextt * | -context, | -
- | - | ec_errort * | -Ec | -
- | ) | -- |
Pops an error from the list.
-[in] | context | = context struct |
[out] | Ec | = Struct describing the error. |
static int ecx_pullindex | -( | -ecx_contextt * | -context | ) | - [static] |
-
Pull index of segmented LRD/LWR/LRW combination.
-[in] | context | = context struct |
void ecx_pusherror | -( | -ecx_contextt * | -context, | -
- | - | const ec_errort * | -Ec | -
- | ) | -- |
Pushes an error on the error list.
-[in] | context | = context struct |
[in] | Ec | pointer describing the error. |
static void ecx_pushindex | -( | -ecx_contextt * | -context, | -
- | - | uint8 | -idx, | -
- | - | void * | -data, | -
- | - | uint16 | -length | -
- | ) | - [static] |
-
Push index of segmented LRD/LWR/LRW combination.
-[in] | context | = context struct |
[in] | idx | = Used datagram index. |
[in] | data | = Pointer to process data segment. |
[in] | length | = Length of data segment in bytes. |
uint32 ecx_readeeprom | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -eeproma, | -
- | - | int | -timeout | -
- | ) | -- |
Read EEPROM from slave bypassing cache.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | eeproma | = (WORD) Address in the EEPROM |
[in] | timeout | = Timeout in us. |
void ecx_readeeprom1 | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -eeproma | -
- | ) | -- |
Read EEPROM from slave bypassing cache. Parallel read step 1, make request to slave.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | eeproma | = (WORD) Address in the EEPROM |
uint32 ecx_readeeprom2 | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | int | -timeout | -
- | ) | -- |
Read EEPROM from slave bypassing cache. Parallel read step 2, actual read from slave.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | timeout | = Timeout in us. |
uint64 ecx_readeepromAP | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -aiadr, | -
- | - | uint16 | -eeproma, | -
- | - | int | -timeout | -
- | ) | -- |
Read EEPROM from slave bypassing cache. APRD method.
-[in] | context | = context struct |
[in] | aiadr | = auto increment address of slave |
[in] | eeproma | = (WORD) Address in the EEPROM |
[in] | timeout | = Timeout in us. |
uint64 ecx_readeepromFP | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -configadr, | -
- | - | uint16 | -eeproma, | -
- | - | int | -timeout | -
- | ) | -- |
Read EEPROM from slave bypassing cache. FPRD method.
-[in] | context | = context struct |
[in] | configadr | = configured address of slave |
[in] | eeproma | = (WORD) Address in the EEPROM |
[in] | timeout | = Timeout in us. |
int ecx_readstate | -( | -ecx_contextt * | -context | ) | -- |
Read all slave states in ec_slave.
-[in] | context | = context struct |
int ecx_receive_processdata | -( | -ecx_contextt * | -context, | -
- | - | int | -timeout | -
- | ) | -- |
int ecx_receive_processdata_group | -( | -ecx_contextt * | -context, | -
- | - | uint8 | -group, | -
- | - | int | -timeout | -
- | ) | -- |
Receive processdata from slaves. Second part from ec_send_processdata(). Received datagrams are recombined with the processdata with help from the stack. If a datagram contains input processdata it copies it to the processdata structure.
-[in] | context | = context struct |
[in] | group | = group number |
[in] | timeout | = Timeout in us. |
int ecx_send_processdata | -( | -ecx_contextt * | -context | ) | -- |
int ecx_send_processdata_group | -( | -ecx_contextt * | -context, | -
- | - | uint8 | -group | -
- | ) | -- |
Transmit processdata to slaves. Uses LRW, or LRD/LWR if LRW is not allowed (blockLRW). Both the input and output processdata are transmitted. The outputs with the actual data, the inputs have a placeholder. The inputs are gathered with the receive processdata function. In contrast to the base LRW function this function is non-blocking. If the processdata does not fit in one datagram, multiple are used. In order to recombine the slave response, a stack is used.
-[in] | context | = context struct |
[in] | group | = group number |
int16 ecx_siifind | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -cat | -
- | ) | -- |
Find SII section header in slave EEPROM.
-[in] | context | = context struct |
[in] | slave | = slave number |
[in] | cat | = section category |
uint16 ecx_siiFMMU | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | ec_eepromFMMUt * | -FMMU | -
- | ) | -- |
Get FMMU data from SII FMMU section in slave EEPROM.
-[in] | context | = context struct |
[in] | slave | = slave number |
[out] | FMMU | = FMMU struct from SII, max. 4 FMMU's |
uint8 ecx_siigetbyte | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -address | -
- | ) | -- |
Read one byte from slave EEPROM via cache. If the cache location is empty then a read request is made to the slave. Depending on the slave capabillities the request is 4 or 8 bytes.
-[in] | context | = context struct |
[in] | slave | = slave number |
[in] | address | = eeprom address in bytes (slave uses words) |
int ecx_siiPDO | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | ec_eepromPDOt * | -PDO, | -
- | - | uint8 | -t | -
- | ) | -- |
Get PDO data from SII PDO section in slave EEPROM.
-[in] | context | = context struct |
[in] | slave | = slave number |
[out] | PDO | = PDO struct from SII |
[in] | t | = 0=RXPDO 1=TXPDO |
uint16 ecx_siiSM | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | ec_eepromSMt * | -SM | -
- | ) | -- |
Get SM data from SII SM section in slave EEPROM.
-[in] | context | = context struct |
[in] | slave | = slave number |
[out] | SM | = first SM struct from SII |
uint16 ecx_siiSMnext | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | ec_eepromSMt * | -SM, | -
- | - | uint16 | -n | -
- | ) | -- |
Get next SM data from SII SM section in slave EEPROM.
-[in] | context | = context struct |
[in] | slave | = slave number |
[out] | SM | = first SM struct from SII |
[in] | n | = SM number |
void ecx_siistring | -( | -ecx_contextt * | -context, | -
- | - | char * | -str, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -Sn | -
- | ) | -- |
Get string from SII string section in slave EEPROM.
-[in] | context | = context struct |
[out] | str | = requested string, 0x00 if not found |
[in] | slave | = slave number |
[in] | Sn | = string number |
uint16 ecx_statecheck | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -reqstate, | -
- | - | int | -timeout | -
- | ) | -- |
Check actual slave state. This is a blocking function.
-[in] | context | = context struct |
[in] | slave | = Slave number, 0 = all slaves |
[in] | reqstate | = Requested state |
[in] | timeout | = Timout value in us |
int ecx_writeeeprom | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -eeproma, | -
- | - | uint16 | -data, | -
- | - | int | -timeout | -
- | ) | -- |
Write EEPROM to slave bypassing cache.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | eeproma | = (WORD) Address in the EEPROM |
[in] | data | = 16bit data |
[in] | timeout | = Timeout in us. |
int ecx_writeeepromAP | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -aiadr, | -
- | - | uint16 | -eeproma, | -
- | - | uint16 | -data, | -
- | - | int | -timeout | -
- | ) | -- |
Write EEPROM to slave bypassing cache. APWR method.
-[in] | context | = context struct |
[in] | aiadr | = configured address of slave |
[in] | eeproma | = (WORD) Address in the EEPROM |
[in] | data | = 16bit data |
[in] | timeout | = Timeout in us. |
int ecx_writeeepromFP | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -configadr, | -
- | - | uint16 | -eeproma, | -
- | - | uint16 | -data, | -
- | - | int | -timeout | -
- | ) | -- |
Write EEPROM to slave bypassing cache. FPWR method.
-[in] | context | = context struct |
[in] | configadr | = configured address of slave |
[in] | eeproma | = (WORD) Address in the EEPROM |
[in] | data | = 16bit data |
[in] | timeout | = Timeout in us. |
int ecx_writestate | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave | -
- | ) | -- |
Write slave state, if slave = 0 then write to all slaves. The function does not check if the actual state is changed.
-[in] | context | = context struct |
[in] | slave | = Slave number, 0 = master |
int64 ec_DCtime | -
uint8 ec_esibuf[EC_MAXEEPBUF] [static] |
-
cache for EEPROM read functions
- -uint32 ec_esimap[EC_MAXEEPBITMAP] [static] |
-
bitmap for filled cache buffer bytes
- -ec_eepromFMMUt ec_FMMU [static] |
-
buffer for EEPROM FMMU data
- -ec_idxstackT ec_idxstack [static] |
-
ec_PDOassignt ec_PDOassign [static] |
-
PDO assign struct to store data of one slave
- -ec_PDOdesct ec_PDOdesc [static] |
-
PDO description struct to store data of one slave
- -Main slave data array. Each slave found on the network gets its own record. ec_slave[0] is reserved for the master. Structure gets filled in by the configuration function ec_config().
- -int ec_slavecount | -
number of slaves found on the network
- -ec_eepromSMt ec_SM [static] |
-
buffer for EEPROM SM data
- -ec_SMcommtypet ec_SMcommtype [static] |
-
SyncManager Communication Type struct to store data of one slave
- -boolean EcatError = FALSE | -
Global variable TRUE if error available in error stack
- -ecx_contextt ecx_context | -
{ - &ecx_port, - &ec_slave[0], - &ec_slavecount, - EC_MAXSLAVE, - &ec_group[0], - EC_MAXGROUP, - &ec_esibuf[0], - &ec_esimap[0], - 0, - &ec_elist, - &ec_idxstack, - &EcatError, - 0, - 0, - &ec_DCtime, - &ec_SMcommtype, - &ec_PDOassign, - &ec_PDOdesc, - &ec_SM, - &ec_FMMU, - NULL -} -
ecx_portt ecx_port | -
ecx_redportt ecx_redport | -
- SOEM v1.3.1
- |
-
Headerfile for ethercatmain.c. -More...
--Data Structures | |
struct | ec_adaptert |
struct | ec_fmmut |
struct | ec_smt |
struct | ec_state_status |
struct | ec_slavet |
struct | ec_groupt |
struct | ec_eepromFMMUt |
struct | ec_eepromSMt |
struct | ec_eepromPDOt |
struct | ec_mbxheadert |
struct | ec_alstatust |
struct | ec_idxstackT |
struct | ec_eringt |
struct | ec_SMcommtypet |
struct | ec_PDOassignt |
struct | ec_PDOdesct |
struct | ecx_contextt |
-Defines | |
#define | EC_MAXELIST 64 |
#define | EC_MAXNAME 40 |
#define | EC_MAXSLAVE 200 |
#define | EC_MAXGROUP 2 |
#define | EC_MAXIOSEGMENTS 64 |
#define | EC_MAXMBX 1486 |
#define | EC_MAXEEPDO 0x200 |
#define | EC_MAXSM 8 |
#define | EC_MAXFMMU 4 |
#define | EC_MAXLEN_ADAPTERNAME 128 |
#define | ECT_MBXPROT_AOE 0x0001 |
#define | ECT_MBXPROT_EOE 0x0002 |
#define | ECT_MBXPROT_COE 0x0004 |
#define | ECT_MBXPROT_FOE 0x0008 |
#define | ECT_MBXPROT_SOE 0x0010 |
#define | ECT_MBXPROT_VOE 0x0020 |
#define | ECT_COEDET_SDO 0x01 |
#define | ECT_COEDET_SDOINFO 0x02 |
#define | ECT_COEDET_PDOASSIGN 0x04 |
#define | ECT_COEDET_PDOCONFIG 0x08 |
#define | ECT_COEDET_UPLOAD 0x10 |
#define | ECT_COEDET_SDOCA 0x20 |
#define | EC_SMENABLEMASK 0xfffeffff |
-Typedefs | |
typedef uint8 | ec_mbxbuft [EC_MAXMBX+1] |
-Functions | |
ec_adaptert * | ec_find_adapters (void) |
void | ec_free_adapters (ec_adaptert *adapter) |
uint8 | ec_nextmbxcnt (uint8 cnt) |
void | ec_clearmbx (ec_mbxbuft *Mbx) |
void | ecx_pusherror (ecx_contextt *context, const ec_errort *Ec) |
boolean | ecx_poperror (ecx_contextt *context, ec_errort *Ec) |
boolean | ecx_iserror (ecx_contextt *context) |
void | ecx_packeterror (ecx_contextt *context, uint16 Slave, uint16 Index, uint8 SubIdx, uint16 ErrorCode) |
int | ecx_init (ecx_contextt *context, char *ifname) |
int | ecx_init_redundant (ecx_contextt *context, ecx_redportt *redport, char *ifname, char *if2name) |
void | ecx_close (ecx_contextt *context) |
uint8 | ecx_siigetbyte (ecx_contextt *context, uint16 slave, uint16 address) |
int16 | ecx_siifind (ecx_contextt *context, uint16 slave, uint16 cat) |
void | ecx_siistring (ecx_contextt *context, char *str, uint16 slave, uint16 Sn) |
uint16 | ecx_siiFMMU (ecx_contextt *context, uint16 slave, ec_eepromFMMUt *FMMU) |
uint16 | ecx_siiSM (ecx_contextt *context, uint16 slave, ec_eepromSMt *SM) |
uint16 | ecx_siiSMnext (ecx_contextt *context, uint16 slave, ec_eepromSMt *SM, uint16 n) |
int | ecx_siiPDO (ecx_contextt *context, uint16 slave, ec_eepromPDOt *PDO, uint8 t) |
int | ecx_readstate (ecx_contextt *context) |
int | ecx_writestate (ecx_contextt *context, uint16 slave) |
uint16 | ecx_statecheck (ecx_contextt *context, uint16 slave, uint16 reqstate, int timeout) |
int | ecx_mbxempty (ecx_contextt *context, uint16 slave, int timeout) |
int | ecx_mbxsend (ecx_contextt *context, uint16 slave, ec_mbxbuft *mbx, int timeout) |
int | ecx_mbxreceive (ecx_contextt *context, uint16 slave, ec_mbxbuft *mbx, int timeout) |
void | ecx_esidump (ecx_contextt *context, uint16 slave, uint8 *esibuf) |
uint32 | ecx_readeeprom (ecx_contextt *context, uint16 slave, uint16 eeproma, int timeout) |
int | ecx_writeeeprom (ecx_contextt *context, uint16 slave, uint16 eeproma, uint16 data, int timeout) |
int | ecx_eeprom2master (ecx_contextt *context, uint16 slave) |
int | ecx_eeprom2pdi (ecx_contextt *context, uint16 slave) |
uint64 | ecx_readeepromAP (ecx_contextt *context, uint16 aiadr, uint16 eeproma, int timeout) |
int | ecx_writeeepromAP (ecx_contextt *context, uint16 aiadr, uint16 eeproma, uint16 data, int timeout) |
uint64 | ecx_readeepromFP (ecx_contextt *context, uint16 configadr, uint16 eeproma, int timeout) |
int | ecx_writeeepromFP (ecx_contextt *context, uint16 configadr, uint16 eeproma, uint16 data, int timeout) |
void | ecx_readeeprom1 (ecx_contextt *context, uint16 slave, uint16 eeproma) |
uint32 | ecx_readeeprom2 (ecx_contextt *context, uint16 slave, int timeout) |
int | ecx_send_processdata_group (ecx_contextt *context, uint8 group) |
int | ecx_receive_processdata_group (ecx_contextt *context, uint8 group, int timeout) |
int | ecx_send_processdata (ecx_contextt *context) |
int | ecx_receive_processdata (ecx_contextt *context, int timeout) |
Headerfile for ethercatmain.c.
-#define EC_MAXEEPDO 0x200 | -
max. eeprom PDO entries
- -#define EC_MAXELIST 64 | -
max. etries in EtherCAT error list
- -#define EC_MAXFMMU 4 | -
max. FMMU used
- -#define EC_MAXGROUP 2 | -
max. number of groups
- -#define EC_MAXIOSEGMENTS 64 | -
max. number of IO segments per group
- -#define EC_MAXLEN_ADAPTERNAME 128 | -
max. Adapter
- -#define EC_MAXMBX 1486 | -
max. mailbox size
- -#define EC_MAXNAME 40 | -
max. length of readable name in slavelist and Object Description List
- -#define EC_MAXSLAVE 200 | -
max. number of slaves in array
- -#define EC_MAXSM 8 | -
max. SM used
- -#define EC_SMENABLEMASK 0xfffeffff | -
#define ECT_COEDET_PDOASSIGN 0x04 | -
#define ECT_COEDET_PDOCONFIG 0x08 | -
#define ECT_COEDET_SDO 0x01 | -
#define ECT_COEDET_SDOCA 0x20 | -
#define ECT_COEDET_SDOINFO 0x02 | -
#define ECT_COEDET_UPLOAD 0x10 | -
#define ECT_MBXPROT_AOE 0x0001 | -
#define ECT_MBXPROT_COE 0x0004 | -
#define ECT_MBXPROT_EOE 0x0002 | -
#define ECT_MBXPROT_FOE 0x0008 | -
#define ECT_MBXPROT_SOE 0x0010 | -
#define ECT_MBXPROT_VOE 0x0020 | -
typedef uint8 ec_mbxbuft[EC_MAXMBX+1] | -
mailbox buffer array
- -void ec_clearmbx | -( | -ec_mbxbuft * | -Mbx | ) | -- |
Clear mailbox buffer.
-[out] | Mbx | = Mailbox buffer to clear |
ec_adaptert* ec_find_adapters | -( | -void | -) | -- |
Create list over available network adapters.
-void ec_free_adapters | -( | -ec_adaptert * | -adapter | ) | -- |
Free dynamically allocated list over available network adapters.
-[in] | adapter | = Struct holding adapter name, description and pointer to next. |
uint8 ec_nextmbxcnt | -( | -uint8 | -cnt | ) | -- |
Get index of next mailbox counter value. Used for Mailbox Link Layer.
-[in] | cnt | = Mailbox counter value [0..7] |
void ecx_close | -( | -ecx_contextt * | -context | ) | -- |
Close lib.
-[in] | context | = context struct |
int ecx_eeprom2master | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave | -
- | ) | -- |
Set eeprom control to master. Only if set to PDI.
-[in] | context | = context struct |
[in] | slave | = Slave number |
int ecx_eeprom2pdi | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave | -
- | ) | -- |
Set eeprom control to PDI. Only if set to master.
-[in] | context | = context struct |
[in] | slave | = Slave number |
void ecx_esidump | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint8 * | -esibuf | -
- | ) | -- |
Dump complete EEPROM data from slave in buffer.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[out] | esibuf | = EEPROM data buffer, make sure it is big enough. |
int ecx_init | -( | -ecx_contextt * | -context, | -
- | - | char * | -ifname | -
- | ) | -- |
Initialise lib in single NIC mode
-[in] | context | = context struct |
[in] | ifname | = Dev name, f.e. "eth0" |
int ecx_init_redundant | -( | -ecx_contextt * | -context, | -
- | - | ecx_redportt * | -redport, | -
- | - | char * | -ifname, | -
- | - | char * | -if2name | -
- | ) | -- |
Initialise lib in redundant NIC mode
-[in] | context | = context struct |
[in] | redport | = pointer to redport, redundant port data |
[in] | ifname | = Primary Dev name, f.e. "eth0" |
[in] | if2name | = Secondary Dev name, f.e. "eth1" |
boolean ecx_iserror | -( | -ecx_contextt * | -context | ) | -- |
Check if error list has entries.
-[in] | context | = context struct |
int ecx_mbxempty | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | int | -timeout | -
- | ) | -- |
Check if IN mailbox of slave is empty.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | timeout | = Timeout in us |
int ecx_mbxreceive | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | ec_mbxbuft * | -mbx, | -
- | - | int | -timeout | -
- | ) | -- |
Read OUT mailbox from slave. Supports Mailbox Link Layer with repeat requests.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[out] | mbx | = Mailbox data |
[in] | timeout | = Timeout in us |
int ecx_mbxsend | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | ec_mbxbuft * | -mbx, | -
- | - | int | -timeout | -
- | ) | -- |
Write IN mailbox to slave.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[out] | mbx | = Mailbox data |
[in] | timeout | = Timeout in us |
void ecx_packeterror | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | uint16 | -Index, | -
- | - | uint8 | -SubIdx, | -
- | - | uint16 | -ErrorCode | -
- | ) | -- |
Report packet error
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[in] | Index | = Index that generated error |
[in] | SubIdx | = Subindex that generated error |
[in] | ErrorCode | = Error code |
boolean ecx_poperror | -( | -ecx_contextt * | -context, | -
- | - | ec_errort * | -Ec | -
- | ) | -- |
Pops an error from the list.
-[in] | context | = context struct |
[out] | Ec | = Struct describing the error. |
void ecx_pusherror | -( | -ecx_contextt * | -context, | -
- | - | const ec_errort * | -Ec | -
- | ) | -- |
Pushes an error on the error list.
-[in] | context | = context struct |
[in] | Ec | pointer describing the error. |
uint32 ecx_readeeprom | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -eeproma, | -
- | - | int | -timeout | -
- | ) | -- |
Read EEPROM from slave bypassing cache.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | eeproma | = (WORD) Address in the EEPROM |
[in] | timeout | = Timeout in us. |
void ecx_readeeprom1 | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -eeproma | -
- | ) | -- |
Read EEPROM from slave bypassing cache. Parallel read step 1, make request to slave.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | eeproma | = (WORD) Address in the EEPROM |
uint32 ecx_readeeprom2 | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | int | -timeout | -
- | ) | -- |
Read EEPROM from slave bypassing cache. Parallel read step 2, actual read from slave.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | timeout | = Timeout in us. |
uint64 ecx_readeepromAP | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -aiadr, | -
- | - | uint16 | -eeproma, | -
- | - | int | -timeout | -
- | ) | -- |
Read EEPROM from slave bypassing cache. APRD method.
-[in] | context | = context struct |
[in] | aiadr | = auto increment address of slave |
[in] | eeproma | = (WORD) Address in the EEPROM |
[in] | timeout | = Timeout in us. |
uint64 ecx_readeepromFP | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -configadr, | -
- | - | uint16 | -eeproma, | -
- | - | int | -timeout | -
- | ) | -- |
Read EEPROM from slave bypassing cache. FPRD method.
-[in] | context | = context struct |
[in] | configadr | = configured address of slave |
[in] | eeproma | = (WORD) Address in the EEPROM |
[in] | timeout | = Timeout in us. |
int ecx_readstate | -( | -ecx_contextt * | -context | ) | -- |
Read all slave states in ec_slave.
-[in] | context | = context struct |
int ecx_receive_processdata | -( | -ecx_contextt * | -context, | -
- | - | int | -timeout | -
- | ) | -- |
int ecx_receive_processdata_group | -( | -ecx_contextt * | -context, | -
- | - | uint8 | -group, | -
- | - | int | -timeout | -
- | ) | -- |
Receive processdata from slaves. Second part from ec_send_processdata(). Received datagrams are recombined with the processdata with help from the stack. If a datagram contains input processdata it copies it to the processdata structure.
-[in] | context | = context struct |
[in] | group | = group number |
[in] | timeout | = Timeout in us. |
int ecx_send_processdata | -( | -ecx_contextt * | -context | ) | -- |
int ecx_send_processdata_group | -( | -ecx_contextt * | -context, | -
- | - | uint8 | -group | -
- | ) | -- |
Transmit processdata to slaves. Uses LRW, or LRD/LWR if LRW is not allowed (blockLRW). Both the input and output processdata are transmitted. The outputs with the actual data, the inputs have a placeholder. The inputs are gathered with the receive processdata function. In contrast to the base LRW function this function is non-blocking. If the processdata does not fit in one datagram, multiple are used. In order to recombine the slave response, a stack is used.
-[in] | context | = context struct |
[in] | group | = group number |
int16 ecx_siifind | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -cat | -
- | ) | -- |
Find SII section header in slave EEPROM.
-[in] | context | = context struct |
[in] | slave | = slave number |
[in] | cat | = section category |
uint16 ecx_siiFMMU | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | ec_eepromFMMUt * | -FMMU | -
- | ) | -- |
Get FMMU data from SII FMMU section in slave EEPROM.
-[in] | context | = context struct |
[in] | slave | = slave number |
[out] | FMMU | = FMMU struct from SII, max. 4 FMMU's |
uint8 ecx_siigetbyte | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -address | -
- | ) | -- |
Read one byte from slave EEPROM via cache. If the cache location is empty then a read request is made to the slave. Depending on the slave capabillities the request is 4 or 8 bytes.
-[in] | context | = context struct |
[in] | slave | = slave number |
[in] | address | = eeprom address in bytes (slave uses words) |
int ecx_siiPDO | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | ec_eepromPDOt * | -PDO, | -
- | - | uint8 | -t | -
- | ) | -- |
Get PDO data from SII PDO section in slave EEPROM.
-[in] | context | = context struct |
[in] | slave | = slave number |
[out] | PDO | = PDO struct from SII |
[in] | t | = 0=RXPDO 1=TXPDO |
uint16 ecx_siiSM | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | ec_eepromSMt * | -SM | -
- | ) | -- |
Get SM data from SII SM section in slave EEPROM.
-[in] | context | = context struct |
[in] | slave | = slave number |
[out] | SM | = first SM struct from SII |
uint16 ecx_siiSMnext | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | ec_eepromSMt * | -SM, | -
- | - | uint16 | -n | -
- | ) | -- |
Get next SM data from SII SM section in slave EEPROM.
-[in] | context | = context struct |
[in] | slave | = slave number |
[out] | SM | = first SM struct from SII |
[in] | n | = SM number |
void ecx_siistring | -( | -ecx_contextt * | -context, | -
- | - | char * | -str, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -Sn | -
- | ) | -- |
Get string from SII string section in slave EEPROM.
-[in] | context | = context struct |
[out] | str | = requested string, 0x00 if not found |
[in] | slave | = slave number |
[in] | Sn | = string number |
uint16 ecx_statecheck | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -reqstate, | -
- | - | int | -timeout | -
- | ) | -- |
Check actual slave state. This is a blocking function.
-[in] | context | = context struct |
[in] | slave | = Slave number, 0 = all slaves |
[in] | reqstate | = Requested state |
[in] | timeout | = Timout value in us |
int ecx_writeeeprom | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint16 | -eeproma, | -
- | - | uint16 | -data, | -
- | - | int | -timeout | -
- | ) | -- |
Write EEPROM to slave bypassing cache.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | eeproma | = (WORD) Address in the EEPROM |
[in] | data | = 16bit data |
[in] | timeout | = Timeout in us. |
int ecx_writeeepromAP | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -aiadr, | -
- | - | uint16 | -eeproma, | -
- | - | uint16 | -data, | -
- | - | int | -timeout | -
- | ) | -- |
Write EEPROM to slave bypassing cache. APWR method.
-[in] | context | = context struct |
[in] | aiadr | = configured address of slave |
[in] | eeproma | = (WORD) Address in the EEPROM |
[in] | data | = 16bit data |
[in] | timeout | = Timeout in us. |
int ecx_writeeepromFP | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -configadr, | -
- | - | uint16 | -eeproma, | -
- | - | uint16 | -data, | -
- | - | int | -timeout | -
- | ) | -- |
Write EEPROM to slave bypassing cache. FPWR method.
-[in] | context | = context struct |
[in] | configadr | = configured address of slave |
[in] | eeproma | = (WORD) Address in the EEPROM |
[in] | data | = 16bit data |
[in] | timeout | = Timeout in us. |
int ecx_writestate | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave | -
- | ) | -- |
Write slave state, if slave = 0 then write to all slaves. The function does not check if the actual state is changed.
-[in] | context | = context struct |
[in] | slave | = Slave number, 0 = master |
- SOEM v1.3.1
- |
-
Module to convert EtherCAT errors to readable messages. -More...
--Data Structures | |
struct | ec_sdoerrorlist_t |
struct | ec_ALstatuscodelist_t |
struct | ec_soeerrorlist_t |
struct | ec_mbxerrorlist_t |
-Defines | |
#define | EC_MAXERRORNAME 127 |
-Functions | |
const char * | ec_sdoerror2string (uint32 sdoerrorcode) |
char * | ec_ALstatuscode2string (uint16 ALstatuscode) |
char * | ec_soeerror2string (uint16 errorcode) |
char * | ec_mbxerror2string (uint16 errorcode) |
char * | ecx_elist2string (ecx_contextt *context) |
char * | ec_elist2string (void) |
-Variables | |
char | estring [EC_MAXERRORNAME] |
const ec_sdoerrorlist_t | ec_sdoerrorlist [] |
const ec_ALstatuscodelist_t | ec_ALstatuscodelist [] |
const ec_soeerrorlist_t | ec_soeerrorlist [] |
const ec_mbxerrorlist_t | ec_mbxerrorlist [] |
Module to convert EtherCAT errors to readable messages.
-SDO abort messages and AL status codes are used to relay slave errors to the user application. This module converts the binary codes to readble text. For the defined error codes see the EtherCAT protocol documentation.
-#define EC_MAXERRORNAME 127 | -
char* ec_ALstatuscode2string | -( | -uint16 | -ALstatuscode | ) | -- |
Look up text string that belongs to AL status code.
-[in] | ALstatuscode | = AL status code as defined in EtherCAT protocol |
char* ec_elist2string | -( | -void | -) | -- |
char* ec_mbxerror2string | -( | -uint16 | -errorcode | ) | -- |
Look up text string that belongs to MBX error code.
-[in] | errorcode | = MBX error code as defined in EtherCAT protocol |
const char* ec_sdoerror2string | -( | -uint32 | -sdoerrorcode | ) | -- |
Look up text string that belongs to SDO error code.
-[in] | sdoerrorcode | = SDO error code as defined in EtherCAT protocol |
char* ec_soeerror2string | -( | -uint16 | -errorcode | ) | -- |
Look up text string that belongs to SoE error code.
-[in] | errorcode | = SoE error code as defined in EtherCAT protocol |
char* ecx_elist2string | -( | -ecx_contextt * | -context | ) | -- |
Look up error in ec_errorlist and convert to text string.
-[in] | context | = context struct |
const ec_ALstatuscodelist_t ec_ALstatuscodelist[] | -
{ - {0x0000 , "No error" }, - {0x0001 , "Unspecified error" }, - {0x0002 , "No memory" }, - {0x0011 , "Invalid requested state change" }, - {0x0012 , "Unknown requested state" }, - {0x0013 , "Bootstrap not supported" }, - {0x0014 , "No valid firmware" }, - {0x0015 , "Invalid mailbox configuration" }, - {0x0016 , "Invalid mailbox configuration" }, - {0x0017 , "Invalid sync manager configuration" }, - {0x0018 , "No valid inputs available" }, - {0x0019 , "No valid outputs" }, - {0x001A , "Synchronization error" }, - {0x001B , "Sync manager watchdog" }, - {0x001C , "Invalid sync Manager types" }, - {0x001D , "Invalid output configuration" }, - {0x001E , "Invalid input configuration" }, - {0x001F , "Invalid watchdog configuration" }, - {0x0020 , "Slave needs cold start" }, - {0x0021 , "Slave needs INIT" }, - {0x0022 , "Slave needs PREOP" }, - {0x0023 , "Slave needs SAFEOP" }, - {0x0024 , "Invalid input mapping" }, - {0x0025 , "Invalid output mapping" }, - {0x0026 , "Inconsistent settings" }, - {0x0027 , "Freerun not supported" }, - {0x0028 , "Synchronisation not supported" }, - {0x0029 , "Freerun needs 3buffer mode" }, - {0x002A , "Background watchdog" }, - {0x002B , "No valid Inputs and Outputs" }, - {0x002C , "Fatal sync error" }, - {0x002D , "No sync error" }, - {0x002E , "Invalid input FMMU configuration" }, - {0x0030 , "Invalid DC SYNC configuration" }, - {0x0031 , "Invalid DC latch configuration" }, - {0x0032 , "PLL error" }, - {0x0033 , "DC sync IO error" }, - {0x0034 , "DC sync timeout error" }, - {0x0035 , "DC invalid sync cycle time" }, - {0x0035 , "DC invalid sync0 cycle time" }, - {0x0035 , "DC invalid sync1 cycle time" }, - {0x0042 , "MBX_EOE" }, - {0x0043 , "MBX_COE" }, - {0x0044 , "MBX_FOE" }, - {0x0045 , "MBX_SOE" }, - {0x004F , "MBX_VOE" }, - {0x0050 , "EEPROM no access" }, - {0x0051 , "EEPROM error" }, - {0x0060 , "Slave restarted locally" }, - {0x0061 , "Device identification value updated" }, - {0x00f0 , "Application controller available" }, - {0xffff , "Unknown" } -} -
AL status code list definition
- -const ec_mbxerrorlist_t ec_mbxerrorlist[] | -
{ - {0x0000, "No error" }, - {0x0001, "Syntax of 6 octet Mailbox Header is wrong" }, - {0x0002, "The mailbox protocol is not supported" }, - {0x0003, "Channel Field contains wrong value"}, - {0x0004, "The service is no supported"}, - {0x0005, "Invalid mailbox header"}, - {0x0006, "Length of received mailbox data is too short"}, - {0x0007, "No more memory in slave"}, - {0x0008, "The lenght of data is inconsistent"}, - {0xffff, "Unknown"} -} -
MBX error list definition
- -const ec_sdoerrorlist_t ec_sdoerrorlist[] | -
{ - {0x00000000, "No error" }, - {0x05030000, "Toggle bit not changed" }, - {0x05040000, "SDO protocol timeout" }, - {0x05040001, "Client/Server command specifier not valid or unknown" }, - {0x05040005, "Out of memory" }, - {0x06010000, "Unsupported access to an object" }, - {0x06010001, "Attempt to read to a write only object" }, - {0x06010002, "Attempt to write to a read only object" }, - {0x06010003, "Subindex can not be written, SI0 must be 0 for write access" }, - {0x06010004, "SDO Complete access not supported for variable length objects" }, - {0x06010005, "Object length exceeds mailbox size" }, - {0x06010006, "Object mapped to RxPDO, SDO download blocked" }, - {0x06020000, "The object does not exist in the object directory" }, - {0x06040041, "The object can not be mapped into the PDO" }, - {0x06040042, "The number and length of the objects to be mapped would exceed the PDO length" }, - {0x06040043, "General parameter incompatibility reason" }, - {0x06040047, "General internal incompatibility in the device" }, - {0x06060000, "Access failed due to a hardware error" }, - {0x06070010, "Data type does not match, length of service parameter does not match" }, - {0x06070012, "Data type does not match, length of service parameter too high" }, - {0x06070013, "Data type does not match, length of service parameter too low" }, - {0x06090011, "Subindex does not exist" }, - {0x06090030, "Value range of parameter exceeded (only for write access)" }, - {0x06090031, "Value of parameter written too high" }, - {0x06090032, "Value of parameter written too low" }, - {0x06090036, "Maximum value is less than minimum value" }, - {0x08000000, "General error" }, - {0x08000020, "Data cannot be transferred or stored to the application" }, - {0x08000021, "Data cannot be transferred or stored to the application because of local control" }, - {0x08000022, "Data cannot be transferred or stored to the application because of the present device state" }, - {0x08000023, "Object dictionary dynamic generation fails or no object dictionary is present" }, - {0xffffffff, "Unknown" } -} -
SDO error list definition
- -const ec_soeerrorlist_t ec_soeerrorlist[] | -
{ - {0x0000, "No error" }, - {0x1001, "No IDN" }, - {0x1009, "Invalid access to element 1" }, - {0x2001, "No Name" }, - {0x2002, "Name transmission too short" }, - {0x2003, "Name transmission too long" }, - {0x2004, "Name cannot be changed (read only)" }, - {0x2005, "Name is write-protected at this time" }, - {0x3002, "Attribute transmission too short" }, - {0x3003, "Attribute transmission too long" }, - {0x3004, "Attribute cannot be changed (read only)" }, - {0x3005, "Attribute is write-protected at this time" }, - {0x4001, "No units" }, - {0x4002, "Unit transmission too short" }, - {0x4003, "Unit transmission too long" }, - {0x4004, "Unit cannot be changed (read only)" }, - {0x4005, "Unit is write-protected at this time" }, - {0x5001, "No minimum input value" }, - {0x5002, "Minimum input value transmission too short" }, - {0x5003, "Minimum input value transmission too long" }, - {0x5004, "Minimum input value cannot be changed (read only)" }, - {0x5005, "Minimum input value is write-protected at this time" }, - {0x6001, "No maximum input value" }, - {0x6002, "Maximum input value transmission too short" }, - {0x6003, "Maximum input value transmission too long" }, - {0x6004, "Maximum input value cannot be changed (read only)" }, - {0x6005, "Maximum input value is write-protected at this time" }, - {0x7002, "Operation data transmission too short" }, - {0x7003, "Operation data transmission too long" }, - {0x7004, "Operation data cannot be changed (read only)" }, - {0x7005, "Operation data is write-protected at this time (state)" }, - {0x7006, "Operation data is smaller than the minimum input value" }, - {0x7007, "Operation data is smaller than the maximum input value" }, - {0x7008, "Invalid operation data:Configured IDN will not be supported" }, - {0x7009, "Operation data write protected by a password" }, - {0x700A, "Operation data is write protected, it is configured cyclically" }, - {0x700B, "Invalid indirect addressing: (e.g., data container, list handling)" }, - {0x700C, "Operation data is write protected, due to other settings" }, - {0x700D, "Reserved" }, - {0x7010, "Procedure command already active" }, - {0x7011, "Procedure command not interruptible" }, - {0x7012, "Procedure command at this time not executable (state)" }, - {0x7013, "Procedure command not executable (invalid or false parameters)" }, - {0x7014, "No data state" }, - {0x8001, "No default value" }, - {0x8002, "Default value transmission too long" }, - {0x8004, "Default value cannot be changed, read only" }, - {0x800A, "Invalid drive number" }, - {0x800A, "General error" }, - {0x800A, "No element addressed" }, - {0xffff, "Unknown" } -} -
SoE error list definition
- -char estring[EC_MAXERRORNAME] | -
- SOEM v1.3.1
- |
-
Headerfile for ethercatprint.c. -More...
--Functions | |
char * | ec_sdoerror2string (uint16 sdoerrorcode) |
char * | ec_ALstatuscode2string (uint16 ALstatuscode) |
char * | ec_soeerror2string (uint16 errorcode) |
char * | ecx_elist2string (ecx_contextt *context) |
Headerfile for ethercatprint.c.
-char* ec_ALstatuscode2string | -( | -uint16 | -ALstatuscode | ) | -- |
Look up text string that belongs to AL status code.
-[in] | ALstatuscode | = AL status code as defined in EtherCAT protocol |
char* ec_sdoerror2string | -( | -uint16 | -sdoerrorcode | ) | -- |
char* ec_soeerror2string | -( | -uint16 | -errorcode | ) | -- |
Look up text string that belongs to SoE error code.
-[in] | errorcode | = SoE error code as defined in EtherCAT protocol |
char* ecx_elist2string | -( | -ecx_contextt * | -context | ) | -- |
Look up error in ec_errorlist and convert to text string.
-[in] | context | = context struct |
- SOEM v1.3.1
- |
-
Servo over EtherCAT (SoE) Module. -More...
-#include <stdio.h>
#include <string.h>
#include "osal.h"
#include "oshw.h"
#include "ethercattype.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatsoe.h"
-Data Structures | |
struct | ec_SoEt |
-Defines | |
#define | EC_SOE_MAX_DRIVES 8 |
-Functions | |
PACKED_END void | ecx_SoEerror (ecx_contextt *context, uint16 Slave, uint16 idn, uint16 Error) |
int | ecx_SoEread (ecx_contextt *context, uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int *psize, void *p, int timeout) |
int | ecx_SoEwrite (ecx_contextt *context, uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int psize, void *p, int timeout) |
int | ecx_readIDNmap (ecx_contextt *context, uint16 slave, int *Osize, int *Isize) |
int | ec_SoEread (uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int *psize, void *p, int timeout) |
int | ec_SoEwrite (uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int psize, void *p, int timeout) |
int | ec_readIDNmap (uint16 slave, int *Osize, int *Isize) |
Servo over EtherCAT (SoE) Module.
-#define EC_SOE_MAX_DRIVES 8 | -
int ec_readIDNmap | -( | -uint16 | -slave, | -
- | - | int * | -Osize, | -
- | - | int * | -Isize | -
- | ) | -- |
int ec_SoEread | -( | -uint16 | -slave, | -
- | - | uint8 | -driveNo, | -
- | - | uint8 | -elementflags, | -
- | - | uint16 | -idn, | -
- | - | int * | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
int ec_SoEwrite | -( | -uint16 | -slave, | -
- | - | uint8 | -driveNo, | -
- | - | uint8 | -elementflags, | -
- | - | uint16 | -idn, | -
- | - | int | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
int ecx_readIDNmap | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | int * | -Osize, | -
- | - | int * | -Isize | -
- | ) | -- |
SoE read AT and MTD mapping.
-SoE has standard indexes defined for mapping. This function tries to read them and collect a full input and output mapping size of designated slave.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[out] | Osize | = Size in bits of output mapping (MTD) found |
[out] | Isize | = Size in bits of input mapping (AT) found |
PACKED_END void ecx_SoEerror | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -Slave, | -
- | - | uint16 | -idn, | -
- | - | uint16 | -Error | -
- | ) | -- |
Report SoE error.
-[in] | context | = context struct |
[in] | Slave | = Slave number |
[in] | idn | = IDN that generated error |
[in] | Error | = Error code, see EtherCAT documentation for list |
int ecx_SoEread | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint8 | -driveNo, | -
- | - | uint8 | -elementflags, | -
- | - | uint16 | -idn, | -
- | - | int * | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
SoE read, blocking.
-The IDN object of the selected slave and DriveNo is read. If a response is larger than the mailbox size then the response is segmented. The function will combine all segments and copy them to the parameter buffer.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | driveNo | = Drive number in slave |
[in] | elementflags | = Flags to select what properties of IDN are to be transfered. |
[in] | idn | = IDN. |
[in,out] | psize | = Size in bytes of parameter buffer, returns bytes read from SoE. |
[out] | p | = Pointer to parameter buffer |
[in] | timeout | = Timeout in us, standard is EC_TIMEOUTRXM |
int ecx_SoEwrite | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint8 | -driveNo, | -
- | - | uint8 | -elementflags, | -
- | - | uint16 | -idn, | -
- | - | int | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
SoE write, blocking.
-The IDN object of the selected slave and DriveNo is written. If a response is larger than the mailbox size then the response is segmented.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | driveNo | = Drive number in slave |
[in] | elementflags | = Flags to select what properties of IDN are to be transfered. |
[in] | idn | = IDN. |
[in] | psize | = Size in bytes of parameter buffer. |
[out] | p | = Pointer to parameter buffer |
[in] | timeout | = Timeout in us, standard is EC_TIMEOUTRXM |
- SOEM v1.3.1
- |
-
Headerfile for ethercatsoe.c. -More...
--Data Structures | |
struct | ec_SoEnamet |
struct | ec_SoElistt |
struct | ec_SoEmappingt |
struct | ec_SoEattributet |
-Defines | |
#define | EC_SOE_DATASTATE_B 0x01 |
#define | EC_SOE_NAME_B 0x02 |
#define | EC_SOE_ATTRIBUTE_B 0x04 |
#define | EC_SOE_UNIT_B 0x08 |
#define | EC_SOE_MIN_B 0x10 |
#define | EC_SOE_MAX_B 0x20 |
#define | EC_SOE_VALUE_B 0x40 |
#define | EC_SOE_DEFAULT_B 0x80 |
#define | EC_SOE_MAXNAME 60 |
#define | EC_SOE_MAXMAPPING 64 |
#define | EC_IDN_MDTCONFIG 24 |
#define | EC_IDN_ATCONFIG 16 |
#define | EC_SOE_LENGTH_1 0x00 |
#define | EC_SOE_LENGTH_2 0x01 |
#define | EC_SOE_LENGTH_4 0x02 |
#define | EC_SOE_LENGTH_8 0x03 |
#define | EC_SOE_TYPE_BINARY 0x00 |
#define | EC_SOE_TYPE_UINT 0x01 |
#define | EC_SOE_TYPE_INT 0x02 |
#define | EC_SOE_TYPE_HEX 0x03 |
#define | EC_SOE_TYPE_STRING 0x04 |
#define | EC_SOE_TYPE_IDN 0x05 |
#define | EC_SOE_TYPE_FLOAT 0x06 |
#define | EC_SOE_TYPE_PARAMETER 0x07 |
-Functions | |
PACKED_END int | ecx_SoEread (ecx_contextt *context, uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int *psize, void *p, int timeout) |
int | ecx_SoEwrite (ecx_contextt *context, uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int psize, void *p, int timeout) |
int | ecx_readIDNmap (ecx_contextt *context, uint16 slave, int *Osize, int *Isize) |
Headerfile for ethercatsoe.c.
-#define EC_IDN_ATCONFIG 16 | -
#define EC_IDN_MDTCONFIG 24 | -
#define EC_SOE_ATTRIBUTE_B 0x04 | -
#define EC_SOE_DATASTATE_B 0x01 | -
#define EC_SOE_DEFAULT_B 0x80 | -
#define EC_SOE_LENGTH_1 0x00 | -
#define EC_SOE_LENGTH_2 0x01 | -
#define EC_SOE_LENGTH_4 0x02 | -
#define EC_SOE_LENGTH_8 0x03 | -
#define EC_SOE_MAX_B 0x20 | -
#define EC_SOE_MAXMAPPING 64 | -
#define EC_SOE_MAXNAME 60 | -
#define EC_SOE_MIN_B 0x10 | -
#define EC_SOE_NAME_B 0x02 | -
#define EC_SOE_TYPE_BINARY 0x00 | -
#define EC_SOE_TYPE_FLOAT 0x06 | -
#define EC_SOE_TYPE_HEX 0x03 | -
#define EC_SOE_TYPE_IDN 0x05 | -
#define EC_SOE_TYPE_INT 0x02 | -
#define EC_SOE_TYPE_PARAMETER 0x07 | -
#define EC_SOE_TYPE_STRING 0x04 | -
#define EC_SOE_TYPE_UINT 0x01 | -
#define EC_SOE_UNIT_B 0x08 | -
#define EC_SOE_VALUE_B 0x40 | -
int ecx_readIDNmap | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | int * | -Osize, | -
- | - | int * | -Isize | -
- | ) | -- |
SoE read AT and MTD mapping.
-SoE has standard indexes defined for mapping. This function tries to read them and collect a full input and output mapping size of designated slave.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[out] | Osize | = Size in bits of output mapping (MTD) found |
[out] | Isize | = Size in bits of input mapping (AT) found |
PACKED_END int ecx_SoEread | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint8 | -driveNo, | -
- | - | uint8 | -elementflags, | -
- | - | uint16 | -idn, | -
- | - | int * | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
SoE read, blocking.
-The IDN object of the selected slave and DriveNo is read. If a response is larger than the mailbox size then the response is segmented. The function will combine all segments and copy them to the parameter buffer.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | driveNo | = Drive number in slave |
[in] | elementflags | = Flags to select what properties of IDN are to be transfered. |
[in] | idn | = IDN. |
[in,out] | psize | = Size in bytes of parameter buffer, returns bytes read from SoE. |
[out] | p | = Pointer to parameter buffer |
[in] | timeout | = Timeout in us, standard is EC_TIMEOUTRXM |
int ecx_SoEwrite | -( | -ecx_contextt * | -context, | -
- | - | uint16 | -slave, | -
- | - | uint8 | -driveNo, | -
- | - | uint8 | -elementflags, | -
- | - | uint16 | -idn, | -
- | - | int | -psize, | -
- | - | void * | -p, | -
- | - | int | -timeout | -
- | ) | -- |
SoE write, blocking.
-The IDN object of the selected slave and DriveNo is written. If a response is larger than the mailbox size then the response is segmented.
-[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | driveNo | = Drive number in slave |
[in] | elementflags | = Flags to select what properties of IDN are to be transfered. |
[in] | idn | = IDN. |
[in] | psize | = Size in bytes of parameter buffer. |
[out] | p | = Pointer to parameter buffer |
[in] | timeout | = Timeout in us, standard is EC_TIMEOUTRXM |
- SOEM v1.3.1
- |
-
General typedefs and defines for EtherCAT. -More...
-#include <osal.h>
-Data Structures | |
struct | ec_etherheadert |
struct | ec_comt |
struct | ec_errort |
-Defines | |
#define | EC_LITTLE_ENDIAN |
#define | EC_VER1 |
#define | EC_ERROR -3 |
#define | EC_NOFRAME -1 |
#define | EC_OTHERFRAME -2 |
#define | EC_MAXECATFRAME 1518 |
#define | EC_MAXLRWDATA (EC_MAXECATFRAME - 14 - 2 - 10 - 2 - 4) |
#define | EC_FIRSTDCDATAGRAM 20 |
#define | EC_BUFSIZE EC_MAXECATFRAME |
#define | EC_ECATTYPE 0x1000 |
#define | EC_MAXBUF 16 |
#define | EC_TIMEOUTRET 2000 |
#define | EC_TIMEOUTRET3 (EC_TIMEOUTRET * 3) |
#define | EC_TIMEOUTSAFE 20000 |
#define | EC_TIMEOUTEEP 20000 |
#define | EC_TIMEOUTTXM 20000 |
#define | EC_TIMEOUTRXM 700000 |
#define | EC_TIMEOUTSTATE 2000000 |
#define | EC_MAXEEPBITMAP 128 |
#define | EC_MAXEEPBUF EC_MAXEEPBITMAP << 5 |
#define | EC_DEFAULTRETRIES 3 |
#define | ETH_HEADERSIZE sizeof(ec_etherheadert) |
#define | EC_HEADERSIZE sizeof(ec_comt) |
#define | EC_ELENGTHSIZE sizeof(uint16) |
#define | EC_CMDOFFSET EC_ELENGTHSIZE |
#define | EC_WKCSIZE sizeof(uint16) |
#define | EC_DATAGRAMFOLLOWS (1 << 15) |
#define | EC_ESTAT_R64 0x0040 |
#define | EC_ESTAT_BUSY 0x8000 |
#define | EC_ESTAT_EMASK 0x7800 |
#define | EC_ESTAT_NACK 0x2000 |
#define | ECT_SII_START 0x0040 |
#define | ECT_SDO_SMCOMMTYPE 0x1c00 |
#define | ECT_SDO_PDOASSIGN 0x1c10 |
#define | ECT_SDO_RXPDOASSIGN 0x1c12 |
#define | ECT_SDO_TXPDOASSIGN 0x1c13 |
#define | ETH_P_ECAT 0x88A4 |
#define | MK_WORD(msb, lsb) ((((uint16)(msb))<<8) | (lsb)) |
#define | HI_BYTE(w) ((w) >> 8) |
#define | LO_BYTE(w) ((w) & 0x00ff) |
#define | SWAP(w) ((((w)& 0xff00) >> 8) | (((w) & 0x00ff) << 8)) |
#define | LO_WORD(l) ((l) & 0xffff) |
#define | HI_WORD(l) ((l) >> 16) |
#define | get_unaligned(ptr) ({ __typeof__(*(ptr)) __tmp; memcpy(&__tmp, (ptr), sizeof(*(ptr))); __tmp; }) |
#define | put_unaligned32(val, ptr) (memcpy((ptr), &(val), 4)) |
#define | put_unaligned64(val, ptr) (memcpy((ptr), &(val), 8)) |
#define | htoes(A) (A) |
#define | htoel(A) (A) |
#define | htoell(A) (A) |
#define | etohs(A) (A) |
#define | etohl(A) (A) |
#define | etohll(A) (A) |
-Typedefs | |
typedef uint8 | ec_bufT [EC_BUFSIZE] |
-Enumerations | |
enum | ec_err { - EC_ERR_OK = 0, -EC_ERR_ALREADY_INITIALIZED, -EC_ERR_NOT_INITIALIZED, -EC_ERR_TIMEOUT, - - EC_ERR_NO_SLAVES, -EC_ERR_NOK - - } |
enum | ec_state { - EC_STATE_INIT = 0x01, -EC_STATE_PRE_OP = 0x02, -EC_STATE_BOOT = 0x03, -EC_STATE_SAFE_OP = 0x04, - - EC_STATE_OPERATIONAL = 0x08, -EC_STATE_ACK = 0x10, -EC_STATE_ERROR = 0x10 - - } |
enum | ec_bufstate { - EC_BUF_EMPTY = 0x00, -EC_BUF_ALLOC = 0x01, -EC_BUF_TX = 0x02, -EC_BUF_RCVD = 0x03, - - EC_BUF_COMPLETE = 0x04 - - } |
enum | ec_datatype { - ECT_BOOLEAN = 0x0001, -ECT_INTEGER8 = 0x0002, -ECT_INTEGER16 = 0x0003, -ECT_INTEGER32 = 0x0004, - - ECT_UNSIGNED8 = 0x0005, -ECT_UNSIGNED16 = 0x0006, -ECT_UNSIGNED32 = 0x0007, -ECT_REAL32 = 0x0008, - - ECT_VISIBLE_STRING = 0x0009, -ECT_OCTET_STRING = 0x000A, -ECT_UNICODE_STRING = 0x000B, -ECT_TIME_OF_DAY = 0x000C, - - ECT_TIME_DIFFERENCE = 0x000D, -ECT_DOMAIN = 0x000F, -ECT_INTEGER24 = 0x0010, -ECT_REAL64 = 0x0011, - - ECT_INTEGER64 = 0x0015, -ECT_UNSIGNED24 = 0x0016, -ECT_UNSIGNED64 = 0x001B, -ECT_BIT1 = 0x0030, - - ECT_BIT2 = 0x0031, -ECT_BIT3 = 0x0032, -ECT_BIT4 = 0x0033, -ECT_BIT5 = 0x0034, - - ECT_BIT6 = 0x0035, -ECT_BIT7 = 0x0036, -ECT_BIT8 = 0x0037 - - } |
enum | ec_cmdtype { - EC_CMD_NOP = 0x00, -EC_CMD_APRD, -EC_CMD_APWR, -EC_CMD_APRW, - - EC_CMD_FPRD, -EC_CMD_FPWR, -EC_CMD_FPRW, -EC_CMD_BRD, - - EC_CMD_BWR, -EC_CMD_BRW, -EC_CMD_LRD, -EC_CMD_LWR, - - EC_CMD_LRW, -EC_CMD_ARMW, -EC_CMD_FRMW - - } |
enum | ec_ecmdtype { EC_ECMD_NOP = 0x0000, -EC_ECMD_READ = 0x0100, -EC_ECMD_WRITE = 0x0201, -EC_ECMD_RELOAD = 0x0300 - } |
enum | { - ECT_SII_STRING = 10, -ECT_SII_GENERAL = 30, -ECT_SII_FMMU = 40, -ECT_SII_SM = 41, - - ECT_SII_PDO = 50 - - } |
enum | { - ECT_SII_MANUF = 0x0008, -ECT_SII_ID = 0x000a, -ECT_SII_REV = 0x000c, -ECT_SII_BOOTRXMBX = 0x0014, - - ECT_SII_BOOTTXMBX = 0x0016, -ECT_SII_MBXSIZE = 0x0019, -ECT_SII_TXMBXADR = 0x001a, -ECT_SII_RXMBXADR = 0x0018, - - ECT_SII_MBXPROTO = 0x001c - - } |
enum | { - ECT_MBXT_ERR = 0x00, -ECT_MBXT_AOE, -ECT_MBXT_EOE, -ECT_MBXT_COE, - - ECT_MBXT_FOE, -ECT_MBXT_SOE, -ECT_MBXT_VOE = 0x0f - - } |
enum | { - ECT_COES_EMERGENCY = 0x01, -ECT_COES_SDOREQ, -ECT_COES_SDORES, -ECT_COES_TXPDO, - - ECT_COES_RXPDO, -ECT_COES_TXPDO_RR, -ECT_COES_RXPDO_RR, -ECT_COES_SDOINFO - - } |
enum | { - ECT_SDO_DOWN_INIT = 0x21, -ECT_SDO_DOWN_EXP = 0x23, -ECT_SDO_DOWN_INIT_CA = 0x31, -ECT_SDO_UP_REQ = 0x40, - - ECT_SDO_UP_REQ_CA = 0x50, -ECT_SDO_SEG_UP_REQ = 0x60, -ECT_SDO_ABORT = 0x80 - - } |
enum | { - ECT_GET_ODLIST_REQ = 0x01, -ECT_GET_ODLIST_RES = 0x02, -ECT_GET_OD_REQ = 0x03, -ECT_GET_OD_RES = 0x04, - - ECT_GET_OE_REQ = 0x05, -ECT_GET_OE_RES = 0x06, -ECT_SDOINFO_ERROR = 0x07 - - } |
enum | { - ECT_FOE_READ = 0x01, -ECT_FOE_WRITE, -ECT_FOE_DATA, -ECT_FOE_ACK, - - ECT_FOE_ERROR, -ECT_FOE_BUSY - - } |
enum | { - ECT_SOE_READREQ = 0x01, -ECT_SOE_READRES, -ECT_SOE_WRITEREQ, -ECT_SOE_WRITERES, - - ECT_SOE_NOTIFICATION, -ECT_SOE_EMERGENCY - - } |
enum | { - ECT_REG_TYPE = 0x0000, -ECT_REG_PORTDES = 0x0007, -ECT_REG_ESCSUP = 0x0008, -ECT_REG_STADR = 0x0010, - - ECT_REG_ALIAS = 0x0012, -ECT_REG_DLCTL = 0x0100, -ECT_REG_DLPORT = 0x0101, -ECT_REG_DLALIAS = 0x0103, - - ECT_REG_DLSTAT = 0x0110, -ECT_REG_ALCTL = 0x0120, -ECT_REG_ALSTAT = 0x0130, -ECT_REG_ALSTATCODE = 0x0134, - - ECT_REG_PDICTL = 0x0140, -ECT_REG_IRQMASK = 0x0200, -ECT_REG_RXERR = 0x0300, -ECT_REG_FRXERR = 0x0308, - - ECT_REG_EPUECNT = 0x030C, -ECT_REG_PECNT = 0x030D, -ECT_REG_PECODE = 0x030E, -ECT_REG_LLCNT = 0x0310, - - ECT_REG_WDCNT = 0x0442, -ECT_REG_EEPCFG = 0x0500, -ECT_REG_EEPCTL = 0x0502, -ECT_REG_EEPSTAT = 0x0502, - - ECT_REG_EEPADR = 0x0504, -ECT_REG_EEPDAT = 0x0508, -ECT_REG_FMMU0 = 0x0600, -ECT_REG_FMMU1 = ECT_REG_FMMU0 + 0x10, - - ECT_REG_FMMU2 = ECT_REG_FMMU1 + 0x10, -ECT_REG_FMMU3 = ECT_REG_FMMU2 + 0x10, -ECT_REG_SM0 = 0x0800, -ECT_REG_SM1 = ECT_REG_SM0 + 0x08, - - ECT_REG_SM2 = ECT_REG_SM1 + 0x08, -ECT_REG_SM3 = ECT_REG_SM2 + 0x08, -ECT_REG_SM0STAT = ECT_REG_SM0 + 0x05, -ECT_REG_SM1STAT = ECT_REG_SM1 + 0x05, - - ECT_REG_SM1ACT = ECT_REG_SM1 + 0x06, -ECT_REG_SM1CONTR = ECT_REG_SM1 + 0x07, -ECT_REG_DCTIME0 = 0x0900, -ECT_REG_DCTIME1 = 0x0904, - - ECT_REG_DCTIME2 = 0x0908, -ECT_REG_DCTIME3 = 0x090C, -ECT_REG_DCSYSTIME = 0x0910, -ECT_REG_DCSOF = 0x0918, - - ECT_REG_DCSYSOFFSET = 0x0920, -ECT_REG_DCSYSDELAY = 0x0928, -ECT_REG_DCSYSDIFF = 0x092C, -ECT_REG_DCSPEEDCNT = 0x0930, - - ECT_REG_DCTIMEFILT = 0x0934, -ECT_REG_DCCUC = 0x0980, -ECT_REG_DCSYNCACT = 0x0981, -ECT_REG_DCSTART0 = 0x0990, - - ECT_REG_DCCYCLE0 = 0x09A0, -ECT_REG_DCCYCLE1 = 0x09A4 - - } |
enum | ec_err_type { - EC_ERR_TYPE_SDO_ERROR = 0, -EC_ERR_TYPE_EMERGENCY = 1, -EC_ERR_TYPE_PACKET_ERROR = 3, -EC_ERR_TYPE_SDOINFO_ERROR = 4, - - EC_ERR_TYPE_FOE_ERROR = 5, -EC_ERR_TYPE_FOE_BUF2SMALL = 6, -EC_ERR_TYPE_FOE_PACKETNUMBER = 7, -EC_ERR_TYPE_SOE_ERROR = 8, - - EC_ERR_TYPE_MBX_ERROR = 9 - - } |
General typedefs and defines for EtherCAT.
-Defines that could need optimalisation for specific applications are the EC_TIMEOUTxxx. Assumptions for the standard settings are a standard linux PC or laptop and a wired connection to maximal 100 slaves. For use with wireless connections or lots of slaves the timouts need increasing. For fast systems running Xenomai and RT-net or alike the timeouts need to be shorter.
-#define EC_BUFSIZE EC_MAXECATFRAME | -
standard frame buffer size in bytes
- -#define EC_CMDOFFSET EC_ELENGTHSIZE | -
offset position of command in EtherCAT header
- -#define EC_DATAGRAMFOLLOWS (1 << 15) | -
definition of datagram follows bit in ec_comt.dlength
- -#define EC_DEFAULTRETRIES 3 | -
default number of retries if wkc <= 0
- -#define EC_ECATTYPE 0x1000 | -
datagram type EtherCAT
- -#define EC_ELENGTHSIZE sizeof(uint16) | -
size of ec_comt.elength item in EtherCAT header
- -#define EC_ERROR -3 | -
return value general error
- -#define EC_ESTAT_BUSY 0x8000 | -
EEprom state machine busy flag
- -#define EC_ESTAT_EMASK 0x7800 | -
EEprom state machine error flag mask
- -#define EC_ESTAT_NACK 0x2000 | -
EEprom state machine error acknowledge
- -#define EC_ESTAT_R64 0x0040 | -
EEprom state machine read size
- -#define EC_FIRSTDCDATAGRAM 20 | -
size of DC datagram used in first LRW frame
- -#define EC_HEADERSIZE sizeof(ec_comt) | -
EtherCAT header size
- -#define EC_LITTLE_ENDIAN | -
Define Little or Big endian target
- -#define EC_MAXBUF 16 | -
number of frame buffers per channel (tx, rx1 rx2)
- -#define EC_MAXECATFRAME 1518 | -
maximum EtherCAT frame length in bytes
- -#define EC_MAXEEPBITMAP 128 | -
size of EEPROM bitmap cache
- -#define EC_MAXEEPBUF EC_MAXEEPBITMAP << 5 | -
size of EEPROM cache buffer
- -#define EC_MAXLRWDATA (EC_MAXECATFRAME - 14 - 2 - 10 - 2 - 4) | -
maximum EtherCAT LRW frame length in bytes
- -#define EC_NOFRAME -1 | -
return value no frame returned
- -#define EC_OTHERFRAME -2 | -
return value unknown frame received
- -#define EC_TIMEOUTEEP 20000 | -
timeout value in us for EEPROM access
- -#define EC_TIMEOUTRET 2000 | -
timeout value in us for tx frame to return to rx
- -#define EC_TIMEOUTRET3 (EC_TIMEOUTRET * 3) | -
timeout value in us for safe data transfer, max. triple retry
- -#define EC_TIMEOUTRXM 700000 | -
timeout value in us for rx mailbox cycle
- -#define EC_TIMEOUTSAFE 20000 | -
timeout value in us for return "safe" variant (f.e. wireless)
- -#define EC_TIMEOUTSTATE 2000000 | -
timeout value in us for check statechange
- -#define EC_TIMEOUTTXM 20000 | -
timeout value in us for tx mailbox cycle
- -#define EC_VER1 | -
define EC_VER1 if version 1 default context and functions are needed comment if application uses only ecx_ functions and own context
- -#define EC_WKCSIZE sizeof(uint16) | -
size of workcounter item in EtherCAT datagram
- -#define ECT_SDO_PDOASSIGN 0x1c10 | -
standard SDO PDO assignment
- -#define ECT_SDO_RXPDOASSIGN 0x1c12 | -
standard SDO RxPDO assignment
- -#define ECT_SDO_SMCOMMTYPE 0x1c00 | -
standard SDO Sync Manager Communication Type
- -#define ECT_SDO_TXPDOASSIGN 0x1c13 | -
standard SDO TxPDO assignment
- -#define ECT_SII_START 0x0040 | -
Start address SII sections in Eeprom
- -#define ETH_HEADERSIZE sizeof(ec_etherheadert) | -
ethernet header size
- -#define ETH_P_ECAT 0x88A4 | -
Ethercat packet type
- -#define etohl | -( | -- | A | ) | -(A) | -
#define etohll | -( | -- | A | ) | -(A) | -
#define etohs | -( | -- | A | ) | -(A) | -
#define get_unaligned | -( | -- | ptr | ) | -({ __typeof__(*(ptr)) __tmp; memcpy(&__tmp, (ptr), sizeof(*(ptr))); __tmp; }) | -
#define HI_BYTE | -( | -- | w | ) | -((w) >> 8) | -
Macro to get hi byte of a word
- -#define HI_WORD | -( | -- | l | ) | -((l) >> 16) | -
Macro to get hi word of a dword
- -#define htoel | -( | -- | A | ) | -(A) | -
#define htoell | -( | -- | A | ) | -(A) | -
#define htoes | -( | -- | A | ) | -(A) | -
#define LO_BYTE | -( | -- | w | ) | -((w) & 0x00ff) | -
Macro to get low byte of a word
- -#define LO_WORD | -( | -- | l | ) | -((l) & 0xffff) | -
Macro to get hi word of a dword
- -#define MK_WORD | -( | -- | msb, | -
- | - | - | lsb | -
- | ) | -((((uint16)(msb))<<8) | (lsb)) | -
Helper macros Macro to make a word from 2 bytes
- -#define put_unaligned32 | -( | -- | val, | -
- | - | - | ptr | -
- | ) | -(memcpy((ptr), &(val), 4)) | -
#define put_unaligned64 | -( | -- | val, | -
- | - | - | ptr | -
- | ) | -(memcpy((ptr), &(val), 8)) | -
#define SWAP | -( | -- | w | ) | -((((w)& 0xff00) >> 8) | (((w) & 0x00ff) << 8)) | -
Macro to swap hi and low byte of a word
- -typedef uint8 ec_bufT[EC_BUFSIZE] | -
definition for frame buffers
- -anonymous enum | -
anonymous enum | -
anonymous enum | -
Mailbox types definitions
-ECT_MBXT_ERR |
- Error mailbox type - |
ECT_MBXT_AOE |
- ADS over EtherCAT mailbox type - |
ECT_MBXT_EOE |
- Ethernet over EtherCAT mailbox type - |
ECT_MBXT_COE |
- CANopen over EtherCAT mailbox type - |
ECT_MBXT_FOE |
- File over EtherCAT mailbox type - |
ECT_MBXT_SOE |
- Servo over EtherCAT mailbox type - |
ECT_MBXT_VOE |
- Vendor over EtherCAT mailbox type - |
anonymous enum | -
anonymous enum | -
anonymous enum | -
anonymous enum | -
anonymous enum | -
anonymous enum | -
Ethercat registers
-ECT_REG_TYPE | - |
ECT_REG_PORTDES | - |
ECT_REG_ESCSUP | - |
ECT_REG_STADR | - |
ECT_REG_ALIAS | - |
ECT_REG_DLCTL | - |
ECT_REG_DLPORT | - |
ECT_REG_DLALIAS | - |
ECT_REG_DLSTAT | - |
ECT_REG_ALCTL | - |
ECT_REG_ALSTAT | - |
ECT_REG_ALSTATCODE | - |
ECT_REG_PDICTL | - |
ECT_REG_IRQMASK | - |
ECT_REG_RXERR | - |
ECT_REG_FRXERR | - |
ECT_REG_EPUECNT | - |
ECT_REG_PECNT | - |
ECT_REG_PECODE | - |
ECT_REG_LLCNT | - |
ECT_REG_WDCNT | - |
ECT_REG_EEPCFG | - |
ECT_REG_EEPCTL | - |
ECT_REG_EEPSTAT | - |
ECT_REG_EEPADR | - |
ECT_REG_EEPDAT | - |
ECT_REG_FMMU0 | - |
ECT_REG_FMMU1 | - |
ECT_REG_FMMU2 | - |
ECT_REG_FMMU3 | - |
ECT_REG_SM0 | - |
ECT_REG_SM1 | - |
ECT_REG_SM2 | - |
ECT_REG_SM3 | - |
ECT_REG_SM0STAT | - |
ECT_REG_SM1STAT | - |
ECT_REG_SM1ACT | - |
ECT_REG_SM1CONTR | - |
ECT_REG_DCTIME0 | - |
ECT_REG_DCTIME1 | - |
ECT_REG_DCTIME2 | - |
ECT_REG_DCTIME3 | - |
ECT_REG_DCSYSTIME | - |
ECT_REG_DCSOF | - |
ECT_REG_DCSYSOFFSET | - |
ECT_REG_DCSYSDELAY | - |
ECT_REG_DCSYSDIFF | - |
ECT_REG_DCSPEEDCNT | - |
ECT_REG_DCTIMEFILT | - |
ECT_REG_DCCUC | - |
ECT_REG_DCSYNCACT | - |
ECT_REG_DCSTART0 | - |
ECT_REG_DCCYCLE0 | - |
ECT_REG_DCCYCLE1 | - |
enum ec_bufstate | -
enum ec_cmdtype | -
Ethercat command types
-EC_CMD_NOP |
- No operation - |
EC_CMD_APRD |
- Auto Increment Read - |
EC_CMD_APWR |
- Auto Increment Write - |
EC_CMD_APRW |
- Auto Increment Read Write - |
EC_CMD_FPRD |
- Configured Address Read - |
EC_CMD_FPWR |
- Configured Address Write - |
EC_CMD_FPRW |
- Configured Address Read Write - |
EC_CMD_BRD |
- Broadcast Read - |
EC_CMD_BWR |
- Broaddcast Write - |
EC_CMD_BRW |
- Broadcast Read Write - |
EC_CMD_LRD |
- Logical Memory Read - |
EC_CMD_LWR |
- Logical Memory Write - |
EC_CMD_LRW |
- Logical Memory Read Write - |
EC_CMD_ARMW |
- Auto Increment Read Mulitple Write - |
EC_CMD_FRMW |
- Configured Read Mulitple Write Reserved - |
enum ec_datatype | -
Ethercat data types
-ECT_BOOLEAN | - |
ECT_INTEGER8 | - |
ECT_INTEGER16 | - |
ECT_INTEGER32 | - |
ECT_UNSIGNED8 | - |
ECT_UNSIGNED16 | - |
ECT_UNSIGNED32 | - |
ECT_REAL32 | - |
ECT_VISIBLE_STRING | - |
ECT_OCTET_STRING | - |
ECT_UNICODE_STRING | - |
ECT_TIME_OF_DAY | - |
ECT_TIME_DIFFERENCE | - |
ECT_DOMAIN | - |
ECT_INTEGER24 | - |
ECT_REAL64 | - |
ECT_INTEGER64 | - |
ECT_UNSIGNED24 | - |
ECT_UNSIGNED64 | - |
ECT_BIT1 | - |
ECT_BIT2 | - |
ECT_BIT3 | - |
ECT_BIT4 | - |
ECT_BIT5 | - |
ECT_BIT6 | - |
ECT_BIT7 | - |
ECT_BIT8 | - |
enum ec_ecmdtype | -
enum ec_err | -
Possible error codes returned.
- - -enum ec_err_type | -
enum ec_state | -
- SOEM v1.3.1
- |
-
ebox.c | Example code for Simple Open EtherCAT master |
eepromtool.c | EEprom tool for Simple Open EtherCAT master |
ethercatbase.c | Base EtherCAT functions |
ethercatbase.h | Headerfile for ethercatbase.c |
ethercatcoe.c | CAN over EtherCAT (CoE) module |
ethercatcoe.h | Headerfile for ethercatcoe.c |
ethercatconfig.c | Configuration module for EtherCAT master |
ethercatconfig.h | Headerfile for ethercatconfig.c |
ethercatconfiglist.h | DEPRICATED Configuration list of known EtherCAT slave devices |
ethercatdc.c | Distributed Clock EtherCAT functions |
ethercatdc.h | Headerfile for ethercatdc.c |
ethercatfoe.c | File over EtherCAT (FoE) module |
ethercatfoe.h | Headerfile for ethercatfoe.c |
ethercatmain.c | Main EtherCAT functions |
ethercatmain.h | Headerfile for ethercatmain.c |
ethercatprint.c | Module to convert EtherCAT errors to readable messages |
ethercatprint.h | Headerfile for ethercatprint.c |
ethercatsoe.c | Servo over EtherCAT (SoE) Module |
ethercatsoe.h | Headerfile for ethercatsoe.c |
ethercattype.h | General typedefs and defines for EtherCAT |
red_test.c | Example code for Simple Open EtherCAT master |
simple_test.c | Example code for Simple Open EtherCAT master |
slaveinfo.c | Example code for Simple Open EtherCAT master |
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
- SOEM v1.3.1
- |
-
For a tutorial on SOEM See tutorial.txt
-SOEM is an EtherCAT master library written in c. Its purpose is to learn and to use. All users are invited to study the source to get an understanding how an EtherCAT master functions and how it interacts with EtherCAT slaves.
-As all applications are different SOEM tries to not impose any design architecture. Under Linux it can be used in generic user mode, PREEMPT_RT or Xenomai. under Windows it can be used as user mode program.
-Preconditions Linux:
-Preconditions Windows:
-Features as of 1.1.2 :
-Features as of 1.1.3 :
-Features as of 1.1.4 :
-Features as of 1.2.0 :
-Features as of 1.2.2 :
-Features as of 1.2.4 :
-Features as of 1.2.5 :
-Features as of 1.2.8 :
-Features as of 1.3.0 :
-For Linux
-For examples see simple_test.c in ~/test/linux/simple_test. First try (assume EtherCAT on eth0): sudo ./simple_test eth0 As SOEM uses RAW sockets it will need to run as root.
-For Windows
-Version 1.1.3
-Version 1.1.4
-Version 1.2.0
-Version 1.2.2
-Version 1.2.3
-Version 1.2.5
-Version 1.2.8
-Version 1.3.0
-Version 1.3.1
-Copyright© 2005-2015 Speciaal Machinefabriek Ketels v.o.f.
- Copyright© 2005-2015 Arthur Ketels
- Copyright© 2008-2010 TU/e Technische Universiteit Eindhoven
- Copyright© 2012-2015 RT-labs AB
-
SOEM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
-SOEM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-As a special exception, if other files instantiate templates or use macros or inline functions from this file, or you compile this file and link it with other works to produce a work based on this file, this file does not by itself cause the resulting work to be covered by the GNU General Public License. However the source code for this file must still be made available in accordance with section (3) of the GNU General Public License.
-This exception does not invalidate any other reasons why a work based on this file might be covered by the GNU General Public License.
-The EtherCAT Technology, the trade name and logo "EtherCAT" are the intellectual property of, and protected by Beckhoff Automation GmbH. You can use SOEM for the sole purpose of creating, using and/or selling or otherwise distributing an EtherCAT network master provided that an EtherCAT Master License is obtained from Beckhoff Automation GmbH.
-In case you did not receive a copy of the EtherCAT Master License along with SOEM write to Beckhoff Automation GmbH, Eiserstrasse 5, D-33415 Verl, Germany (www.beckhoff.com).
-