ime_test.c File Reference

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_EL3102t
struct  out_EL4132t
struct  in_EL1018t
struct  out_EL2008t
struct  out_EL5101t
struct  in_EL5101t

Defines

#define NSEC_PER_SEC   1000000000

Functions

void imetest (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
uint8 ob
uint16 ob2
pthread_cond_t cond = PTHREAD_COND_INITIALIZER
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER
int64 integral = 0
in_EL3102tin_EL3102
out_EL4132tout_EL4132
in_EL1018tin_EL1018
out_EL2008tout_EL2008
out_EL5101tout_EL5101_1
out_EL5101tout_EL5101_2
in_EL5101tin_EL5101_1
in_EL5101tin_EL5101_2

Detailed Description

Example code for Simple Open EtherCAT master.

Usage : ime_test [ifname] [cycletime] ifname is NIC interface, f.e. eth0 cycletime in us, f.e. 500

This test is specifically build for the IME EtherCAT Box.

(c)Arthur Ketels 2008


Define Documentation

#define NSEC_PER_SEC   1000000000

Function Documentation

void add_timespec ( struct timespec *  ts,
int64  addtime 
)
void ec_sync ( int64  reftime,
int64  cycletime,
int64 offsettime 
)
void ecatthread ( void *  ptr  ) 
void imetest ( char *  ifname  ) 
int main ( int  argc,
char *  argv[] 
)

Variable Documentation

pthread_cond_t cond = PTHREAD_COND_INITIALIZER
int DCdiff
int deltat
int dorun = 0
char IOmap[4096]
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER
int os
struct sched_param schedp
struct timeval tv t1 t2
pthread_t thread1
int tmax = 0

Generated on Mon Feb 22 22:00:22 2010 for SOEM by  doxygen 1.6.1