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 "ethercat_soem/ethercattype.h"#include "ethercat_soem/nicdrv.h"#include "ethercat_soem/ethercatbase.h"#include "ethercat_soem/ethercatmain.h"#include "ethercat_soem/ethercatcoe.h"#include "ethercat_soem/ethercatconfig.h"#include "ethercat_soem/ethercatdc.h"
Go to the source code of this file.
Classes | |
| struct | PACKED |
| struct | PACKED |
| struct | PACKED |
| struct | PACKED |
Defines | |
| #define | MAXSTREAM 200000 |
| #define | NSEC_PER_SEC 1000000000 |
| #define | SYNC0TIME 8000 |
Typedefs | |
| typedef struct PACKED | in_EBOX_streamt |
| typedef struct PACKED | in_EBOXt |
| typedef struct PACKED | out_EBOX_streamt |
| typedef struct PACKED | out_EBOXt |
Functions | |
| 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) |
Variables | |
| 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 |
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
Definition in file ebox.c.
| #define NSEC_PER_SEC 1000000000 |
| typedef struct PACKED in_EBOX_streamt |
| typedef struct PACKED out_EBOX_streamt |
| void add_timespec | ( | struct timespec * | ts, |
| int64 | addtime | ||
| ) |
| void ecatthread | ( | void * | ptr | ) |
| int output_cvs | ( | char * | fname, |
| int | length | ||
| ) |