Macros | Functions | Variables
linux/red_test/red_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 "ethercat.h"
Include dependency graph for linux/red_test/red_test.c:

Go to the source code of this file.

Macros

#define EC_TIMEOUTMON   500
 
#define NSEC_PER_SEC   1000000000
 
#define stack64k   (64 * 1024)
 

Functions

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

Variables

uint8 currentgroup = 0
 
int DCdiff
 
int deltat
 
uint8digout = 0
 
int dorun = 0
 
int expectedWKC
 
int64 gl_delta
 
boolean inOP
 
char IOmap [4096]
 
boolean needlf
 
uint8 ob
 
uint16 ob2
 
int os
 
struct sched_param schedp
 
struct timeval tv t1 t2
 
pthread_t thread1
 
pthread_t thread2
 
int tmax = 0
 
int64 toff
 
volatile int wkc
 

Detailed Description

Example code for Simple Open EtherCAT master.

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

This is a redundancy test.

(c)Arthur Ketels 2008

Definition in file linux/red_test/red_test.c.

Macro Definition Documentation

◆ EC_TIMEOUTMON

#define EC_TIMEOUTMON   500

Definition at line 27 of file linux/red_test/red_test.c.

◆ NSEC_PER_SEC

#define NSEC_PER_SEC   1000000000

Definition at line 26 of file linux/red_test/red_test.c.

◆ stack64k

#define stack64k   (64 * 1024)

Definition at line 303 of file linux/red_test/red_test.c.

Function Documentation

◆ add_timespec()

void add_timespec ( struct timespec *  ts,
int64  addtime 
)

Definition at line 159 of file linux/red_test/red_test.c.

◆ ec_sync()

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

Definition at line 176 of file linux/red_test/red_test.c.

◆ ecatcheck()

OSAL_THREAD_FUNC ecatcheck ( void *  ptr)

Definition at line 227 of file linux/red_test/red_test.c.

◆ ecatthread()

OSAL_THREAD_FUNC_RT ecatthread ( void *  ptr)

Definition at line 190 of file linux/red_test/red_test.c.

◆ main()

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

Definition at line 305 of file linux/red_test/red_test.c.

◆ redtest()

void redtest ( char *  ifname,
char *  ifname2 
)

Definition at line 48 of file linux/red_test/red_test.c.

Variable Documentation

◆ currentgroup

uint8 currentgroup = 0

Definition at line 45 of file linux/red_test/red_test.c.

◆ DCdiff

int DCdiff

Definition at line 36 of file linux/red_test/red_test.c.

◆ deltat

int deltat

Definition at line 34 of file linux/red_test/red_test.c.

◆ digout

uint8* digout = 0

Definition at line 40 of file linux/red_test/red_test.c.

◆ dorun

int dorun = 0

Definition at line 33 of file linux/red_test/red_test.c.

◆ expectedWKC

int expectedWKC

Definition at line 41 of file linux/red_test/red_test.c.

◆ gl_delta

int64 gl_delta

Definition at line 35 of file linux/red_test/red_test.c.

◆ inOP

boolean inOP

Definition at line 44 of file linux/red_test/red_test.c.

◆ IOmap

char IOmap[4096]

Definition at line 30 of file linux/red_test/red_test.c.

◆ needlf

boolean needlf

Definition at line 42 of file linux/red_test/red_test.c.

◆ ob

uint8 ob

Definition at line 38 of file linux/red_test/red_test.c.

◆ ob2

uint16 ob2

Definition at line 39 of file linux/red_test/red_test.c.

◆ os

int os

Definition at line 37 of file linux/red_test/red_test.c.

◆ schedp

struct sched_param schedp

Definition at line 29 of file linux/red_test/red_test.c.

◆ t2

struct timeval tv t1 t2

Definition at line 32 of file linux/red_test/red_test.c.

◆ thread1

pthread_t thread1

Definition at line 31 of file linux/red_test/red_test.c.

◆ thread2

pthread_t thread2

Definition at line 31 of file linux/red_test/red_test.c.

◆ tmax

int tmax = 0

Definition at line 34 of file linux/red_test/red_test.c.

◆ toff

int64 toff

Definition at line 35 of file linux/red_test/red_test.c.

◆ wkc

volatile int wkc

Definition at line 43 of file linux/red_test/red_test.c.



soem
Author(s): Arthur Ketels and M.J.G. van den Molengraft
autogenerated on Mon Feb 28 2022 23:46:58