Classes | Macros | Typedefs | Functions | Variables
win32/ebox/ebox.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 "ethercat.h"
Include dependency graph for win32/ebox/ebox.c:

Go to the source code of this file.

Classes

struct  PACKED
 
struct  PACKED
 
struct  PACKED
 
struct  PACKED
 

Macros

#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_streamtin_EBOX
 
int64 integral =0
 
char IOmap [4096]
 
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER
 
uint32 ob
 
int16 ob2
 
uint8 ob3
 
int os
 
out_EBOX_streamtout_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
 

Detailed Description

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 win32/ebox/ebox.c.

Macro Definition Documentation

◆ MAXSTREAM

#define MAXSTREAM   200000

Definition at line 58 of file win32/ebox/ebox.c.

◆ NSEC_PER_SEC

#define NSEC_PER_SEC   1000000000

Definition at line 26 of file win32/ebox/ebox.c.

◆ SYNC0TIME

#define SYNC0TIME   8000

Definition at line 61 of file win32/ebox/ebox.c.

Typedef Documentation

◆ in_EBOX_streamt

typedef struct PACKED in_EBOX_streamt

◆ in_EBOXt

typedef struct PACKED in_EBOXt

◆ out_EBOX_streamt

typedef struct PACKED out_EBOX_streamt

◆ out_EBOXt

typedef struct PACKED out_EBOXt

Function Documentation

◆ add_timespec()

void add_timespec ( struct timespec *  ts,
int64  addtime 
)

Definition at line 245 of file win32/ebox/ebox.c.

◆ eboxtest()

void eboxtest ( char *  ifname)

Definition at line 105 of file win32/ebox/ebox.c.

◆ ec_sync()

void ec_sync ( int64  reftime,
int64  cycletime,
int64 offsettime 
)

Definition at line 262 of file win32/ebox/ebox.c.

◆ ecatthread()

void ecatthread ( void *  ptr)

Definition at line 274 of file win32/ebox/ebox.c.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 340 of file win32/ebox/ebox.c.

◆ output_cvs()

int output_cvs ( char *  fname,
int  length 
)

Definition at line 87 of file win32/ebox/ebox.c.

Variable Documentation

◆ ain

double ain[2]

Definition at line 81 of file win32/ebox/ebox.c.

◆ ainc

int ainc

Definition at line 82 of file win32/ebox/ebox.c.

◆ cond

pthread_cond_t cond = PTHREAD_COND_INITIALIZER

Definition at line 75 of file win32/ebox/ebox.c.

◆ cyclecount

uint32 cyclecount

Definition at line 78 of file win32/ebox/ebox.c.

◆ DCdiff

int DCdiff

Definition at line 70 of file win32/ebox/ebox.c.

◆ deltat

int deltat

Definition at line 68 of file win32/ebox/ebox.c.

◆ dorun

int dorun = 0

Definition at line 67 of file win32/ebox/ebox.c.

◆ in_EBOX

in_EBOX_streamt* in_EBOX

Definition at line 79 of file win32/ebox/ebox.c.

◆ integral

int64 integral =0

Definition at line 77 of file win32/ebox/ebox.c.

◆ IOmap

char IOmap[4096]

Definition at line 64 of file win32/ebox/ebox.c.

◆ mutex

pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER

Definition at line 76 of file win32/ebox/ebox.c.

◆ ob

uint32 ob

Definition at line 72 of file win32/ebox/ebox.c.

◆ ob2

int16 ob2

Definition at line 73 of file win32/ebox/ebox.c.

◆ ob3

uint8 ob3

Definition at line 74 of file win32/ebox/ebox.c.

◆ os

int os

Definition at line 71 of file win32/ebox/ebox.c.

◆ out_EBOX

out_EBOX_streamt* out_EBOX

Definition at line 80 of file win32/ebox/ebox.c.

◆ schedp

struct sched_param schedp

Definition at line 63 of file win32/ebox/ebox.c.

◆ stream1

int16 stream1[MAXSTREAM]

Definition at line 84 of file win32/ebox/ebox.c.

◆ stream2

int16 stream2[MAXSTREAM]

Definition at line 85 of file win32/ebox/ebox.c.

◆ streampos

int streampos

Definition at line 83 of file win32/ebox/ebox.c.

◆ t2

struct timeval tv t1 t2

Definition at line 66 of file win32/ebox/ebox.c.

◆ thread1

pthread_t thread1

Definition at line 65 of file win32/ebox/ebox.c.

◆ tmax

int tmax =0

Definition at line 68 of file win32/ebox/ebox.c.

◆ toff

int64 toff

Definition at line 69 of file win32/ebox/ebox.c.



soem
Author(s): Arthur Ketels and M.J.G. van den Molengraft
autogenerated on Wed Mar 2 2022 01:01:49